https://github.com/langchain-ai/rag-from-scratch
RAG From Scratch
![Untitled](https://prod-files-secure.s3.us-west-2.amazonaws.com/db3a3c19-5ae3-4c59-8da3-e1dc2b8a0858/4223c7a9-c2c5-4b9e-b84a-f40adf590d31/Untitled.png)
Query Translation
Process of taking a question and translating it into a form better for retrieval
Multi Query
Rag Fusion
Decomposition
Step-Back
- Create a more generic step-back question from the prompt
HyDE (Hypothetical Document Embeddings)
- Generate a hypothetical document from the query, and instead of using the embedding of the query, use the embedding of the generated document to retrieve relevant context.
Routing
Routing the potentially decomposed question to the relevant data source (DB)
Logical Routing
- Give knowledge of the various data sources and let the LLM decide which data source to use.
Semantic Routing