Building even a simple ๐ฝ๐ฟ๐ผ๐ฑ๐๐ฐ๐๐ถ๐ผ๐ป ๐ด๐ฟ๐ฎ๐ฑ๐ฒ ๐ฅ๐ฒ๐๐ฟ๐ถ๐ฒ๐๐ฎ๐น ๐๐๐ด๐บ๐ฒ๐ป๐๐ฒ๐ฑ...

Here are some of the moving parts in the RAG based systems that you will need to take care of and continuously tune in order to achieve desired results:
๐ฅ๐ฒ๐๐ฟ๐ถ๐ฒ๐๐ฎ๐น:
๐ ) Chunking - how do you chunk the data that you will use for external context.
- Small, Large chunks.
- Sliding or tumbling window for chunking.
- Retrieve parent or linked chunks when searching or just use originally retrieved data.
๐ ) Choosing the embedding model to embed and query and external context to/from the latent space. Considering Contextual embeddings.
๐ ) Vector Database.
- Which Database to choose.
- Where to host.
- What metadata to store together with embeddings.
- Indexing strategy.
๐ ) Vector Search
- Choice of similarity measure.
- Choosing the query path - metadata first vs. ANN first.
- Hybrid search.
๐ ) Heuristics - business rules applied to your retrieval procedure.
- Time importance.
- Reranking.
- Duplicate context (diversity ranking).
- Source retrieval.
- Conditional document preprocessing.
๐๐ฒ๐ป๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป:
๐ ) LLM - Choosing the right Large Language Model to power your application.
โ It is becoming less of a headache the further we are into the LLM craze. The performance of available LLMs are converging, both open source and proprietary. The main choice nowadays is around using a proprietary model or self-hosting.
๐ ) Prompt Engineering - having context available for usage in your prompts does not free you from the hard work of engineering the prompts. You will still need to align the system to produce outputs that you desire and prevent jailbreak scenarios.
And letโs not forget the less popular part:
๐) Observing, Evaluating, Monitoring and Securing your application in production!
What other pieces of the system am I missing? Let me know in the comments ๐
#LLM #AI #MachineLearning
