How nikhil-agrawal123/explainable-rag-system works
Project type and purpose
• This is a backend-only, explainable Retrieval-Augmented Generation (RAG) pipeline implemented as a FastAPI service.
• It ingests documents, chunks and embeds them, stores embeddings in ChromaDB, retrieves evidence, builds an explainable graph, and generates answers with trust scores.
• It uses local LLMs (Ollama), SpaCy for entity/relation extraction, LangChain for chunking, and LangSmith for tracing.
File structure
• app/main.py: FastAPI entry point.
• app/api: API router definitions (endpoints.py) and dependency injection (dependencies.py).
• app/core: configuration loader (config.py) and environment settings.
• app/db: ChromaDB client wrapper.
• app/models: Pydantic schemas for requests/responses.
• app/pipeline: Six pipeline stages (ingestion, decomposition, retrieval, graph construction, generation, scoring) and chunk/metadata utilities.
• app/utils: LLM wrappers (LLM calls to Ollama), visualizer for graph rendering.
• app/static: Swagger CSS customization (UI).
• test/: Unit tests for each pipeline module, database, embedding, graph, retrieval.
README for additional insights
• The pipeline is documented in DataForge_nikhil24380.pdf.
• Features highlight local embedding & domain classification, SpaCy extraction, LangChain splitters, ChromaDB persistence, LangSmith tracing, evidence graphs, fully local operation.
• Quickstart shows environment variables for Ollama & LangSmith connections.
• API endpoints list clarifies the surface area of the service.