How kuldeep27396/agentic-rag works
Project type and purpose
• This is an educational, full-stack demo application showcasing a Retrieval-Augmented Generation (RAG) system that evolves from Traditional RAG to Agentic RAG.
• The core is a Streamlit-based UI that interacts with a modular Python back-end implementing routing, retrieval, and generation.
File structure
• Top-level scripts:
• launch_demo.py, run_enhanced_ui.py – orchestration/entry points
• agentic_rag_demo.py, enhanced_streamlit_app.py – Streamlit apps (demo vs full-featured)
• agentic_rag_complete_demo.ipynb – Jupyter tutorial
• Configuration:
• requirements.txt, requirements_ui.txt – dependencies
• .streamlit/secrets.toml, .env.example – API keys and secrets
• Documents folder: sample markdown files for local retrieval.
README insights
• The README describes:
• Three routing modes (LOCAL, WEB, HYBRID)
• Intelligent Router and Quality Assessor modules
• Vector DB (FAISS), Embeddings (HuggingFace), LLM (Groq), Web Search (Serper.dev)
Main components & relationships
a. User Interface (UI)
• Streamlit app that captures user queries and renders results/visualizations
b. Intelligence Layer
• Intelligent Router: decides LOCAL vs WEB vs HYBRID
• Quality Assessor (QA): evaluates and filters retrieved context
c. Retrieval Layer
• LOCAL: vector similarity search on FAISS over sample documents
• WEB: real-time Serper.dev API calls for web results
• HYBRID: merges local & web contexts
d. Data Layer
• Documents (MD files) + persisted FAISS index
e. AI Layer
• Embeddings service (HuggingFace Embeddings)
• LLM (Groq via LangChain) for routing decisions and final answer generation
Interaction flow:
User → UI → Router → {Local Retrieval ↔ Vector DB ↔ Documents; Web Search → QA} → QA → LLM → UI
Architectural patterns & design principles
• Layered architecture: clear separation of UI, intelligence, retrieval, data, and AI services
• Modular pipeline: each stage (routing, retrieval, quality assessment, generation) is decoupled