This project implements a Retrieval-Augmented Generation (RAG) workflow that uses,
- ๐ธ๏ธ Web search via Tavily
- ๐ Document retrieval via vector database
- ๐ฌ Local LLMs via Ollama
- ๐ Dynamic reasoning and control flow using LangGraph
- ๐ Tracing and evaluation using Langfuse
- Hybrid RAG with both web and vector-based retrieval
- Automatic query reformulation
- Relevance filtering before answer generation
- Hallucination detection and correction
- Tracing via Langfuse
- Modular node/edge logic using LangGraph
This RAG system is built with a hybrid retrieval architecture combining multiple search strategies:
- ChromaDB Vector Search: Retrieves documents based on semantic similarity using dense embeddings from a Chroma collection.
- BM25 Lexical Search: Identifies relevant documents using traditional keyword-based matching with BM25 scoring.
- Hybrid Retrieval: Integrates results from both semantic and lexical searches using Reciprocal Rank Fusion (RRF) for balanced and robust retrieval.
Create a .env file in the project root:
TAVILY_API_KEY=your_tavily_api_key
LANGFUSE_PUBLIC_KEY=your_langfuse_public_key
LANGFUSE_SECRET_KEY=your_langfuse_secret_key