How srishhhhx/multidoc-adaptive-rag works
Project type and purpose
• This is a full-stack AI application (“Multi-Doc Adaptive RAG Agent”) that combines a React.js frontend with a Python/FastAPI backend.
• Its goal is to answer complex natural-language queries by orchestrating a Retrieval-Augmented Generation (RAG) pipeline across multiple documents and real-time web search, with self-correcting loops and quality gates.
File structure
• Top-level components:
• api.py, config.py, session_manager.py, state.py, utils.py, rag_workflow.py, multimodal_loader.py, document_loader.py, document_processor.py — these form the FastAPI backend and LangGraph workflow definition.
• chains/ – modular LangChain/LangGraph “nodes” for each pipeline step (query router, reranker, generator, evaluators, etc.).
• frontend/ – React/Vite/Tailwind-based UI, Dockerfile, nginx.conf for production.
• Key patterns:
• A layered architecture: UI → HTTP API → Orchestrator (rag_workflow.py) → chain nodes → external services/data stores.
• A dynamic graph pipeline in LangGraph, with quality‐gate loops (self-correction) and a router that chooses tools.
• Configuration & deployment:
• .env.example for keys, Dockerfile for frontend, nginx.conf, Uvicorn for backend.
README for additional insights
• The README confirms the tech stack (React, FastAPI, LangGraph, FAISS/Chroma, Tavily, Gemini LLMs).
• It describes performance optimizations (batch LLM calls, GPU reranking).
• It outlines advanced pipeline features: Query Analysis Router, cross-encoder reranking, self-correction loops, circuit breakers.