Skip to content

Repository files navigation

🌍 AtlasRAG

Enterprise-Grade RAG with Real-Time Response Scoring

CI Python AI Streamlit Vector Store

AtlasRAG is not just a chatbot β€” it's an evaluation-augmented Knowledge Intelligence System that solves the biggest problem in enterprise GenAI: Reliability.

Every response is audited in real-time by an internal LLM-as-a-Judge evaluation engine that scores for Faithfulness (no hallucinations) and Relevance (actually useful answers) before it ever reaches the user.

πŸš€ Get Started Β· πŸ“– Documentation Β· πŸ› Report Bug


✨ Why AtlasRAG?

Most RAG systems blindly trust their LLM output. AtlasRAG doesn't.

Feature Standard RAG ❌ AtlasRAG βœ…
Search Type Vector Only Hybrid (Vector + BM25 Keyword)
Accuracy Prone to Hallucinations Every Answer Scored Before It's Shown
Evaluation None (Blind Trust) LLM-as-a-Judge (Real-Time Audit)
Privacy Cloud Vector DB In-Memory Vector Store (Data Never Leaves)
Cost High (OpenAI GPT-4) Optimized (Gemini 2.5 Flash)
Dependencies Heavy SDK chains (LangChain, ChromaDB, gRPC) Lightweight Direct APIs (zero framework overhead)

πŸš€ Key Features

βš–οΈ Evaluation-Augmented Architecture

Every response is mathematically scored before being presented to the user.

  • Faithfulness Score β€” Checks if the answer is grounded strictly in the retrieved documents.
  • Relevance Score β€” Verifies if the answer actually addresses the user's query.

πŸ” Hybrid Search Engine

Combines the best of both retrieval paradigms for maximum accuracy:

  • Vector Search (NumPy In-Memory Store) β€” Semantic understanding and conceptual matching.
  • Keyword Search (Rank-BM25) β€” Exact matching of domain-specific jargon and technical terms.

🧠 Dynamic Knowledge Base

  • User-Controlled Chunking β€” Adjust chunk sizes (500–2000 tokens) via the UI to optimize for precision or context.
  • Live Ingestion β€” Upload PDF documents directly through the sidebar. The system handles chunking, embedding, and indexing in real-time.
  • In-Memory Processing β€” Knowledge is indexed in RAM for blazing-fast retrieval.

πŸ’Ύ Smart Chat Management

  • Chat History β€” Automatically saves your conversation context.
  • Export & Clear β€” Download your full chat history as JSON or clear it with a single click.

πŸ—οΈ System Architecture

AtlasRAG Architecture

Flow: PDFs are ingested into a vector store β†’ User queries trigger a Hybrid Search (Vector + BM25) β†’ The LLM generates an answer β†’ An Evaluation Judge audits the response for faithfulness and relevance β†’ Only then is the answer shown to the user.


πŸ› οΈ Tech Stack

Component Technology Why?
LLM (Inference) Gemini 2.5 Flash Latest high-speed model for reasoning & generation
LLM (Judge) Gemini 2.5 Flash Same high-tier model used for unbiased self-evaluation
Embeddings Sentence-Transformers (all-MiniLM-L6-v2) Fast, lightweight, local β€” no API quota needed
Vector Store Custom In-Memory (NumPy) Pure-Python cosine similarity β€” zero dependency crashes
Search Algorithm BM25 + Vector Hybrid retrieval for maximum recall
PDF Parsing pypdf Robust PDF text extraction
Frontend Streamlit Interactive UI with real-time metric dashboards

βš™οΈ Installation & Setup

Prerequisites

1. Clone the Repository

git clone https://github.com/R-Roy03/AtlasRAG.git
cd AtlasRAG

2. Create a Virtual Environment

python -m venv venv

# Windows
venv\Scripts\activate

# macOS / Linux
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure API Key

Create a .env file in the project root:

GOOGLE_API_KEY="your_google_api_key_here"

5. Launch AtlasRAG

streamlit run app.py

The app will open in your browser at http://localhost:8501 πŸŽ‰


πŸ“– Usage Guide

  1. Launch the application with streamlit run app.py.
  2. Upload PDFs β€” Drag and drop your documents into the sidebar.
  3. Build Knowledge Base β€” Click "Update Knowledge Base" to trigger chunking and embedding.
  4. Ask Questions β€” Chat naturally. AtlasRAG retrieves context and generates grounded answers.
  5. Review Scores β€” Every response includes Faithfulness and Relevance scores so you know you can trust it.

πŸ“ Example

Query: "Explain Kirchhoff's Current Law (KCL) with an example."

AtlasRAG Response:

"Kirchhoff's Current Law (KCL) states that the algebraic sum of the currents meeting at a junction in an electric circuit is equal to zero. Example: In a junction with entering currents I₁, I₃ and leaving currents Iβ‚‚, Iβ‚„: I₁ + I₃ = Iβ‚‚ + Iβ‚„."

Metric Score Status
Faithfulness 100% βœ… Grounded in source documents
Relevance 100% βœ… Directly answers the query

πŸ“‚ Project Structure

AtlasRAG/
β”œβ”€β”€ app.py                        # Main Streamlit application
β”œβ”€β”€ .streamlit/config.toml        # Dark theme configuration
β”‚
β”œβ”€β”€ ingestion/                    # Document processing pipeline
β”‚   β”œβ”€β”€ loader.py                 #   PDF loader (pypdf) + Document class
β”‚   β”œβ”€β”€ chunker.py                #   Recursive text splitter
β”‚   └── vector_store.py           #   Pure-Python vector store (NumPy + Sentence-Transformers)
β”‚
β”œβ”€β”€ retrieval/                    # Search & retrieval engines
β”‚   └── hybrid_search.py          #   Hybrid Vector + BM25 retriever
β”‚
β”œβ”€β”€ inference/                    # LLM generation
β”‚   └── generator.py              #   Gemini 2.5 Flash (REST API)
β”‚
β”œβ”€β”€ evaluation/                   # Quality assurance
β”‚   └── metrics.py                #   LLM-as-a-Judge evaluator
β”‚
β”œβ”€β”€ assets/                       # Static assets
β”‚   └── atlas_icon.svg            #   App icon
β”‚
β”œβ”€β”€ .github/workflows/
β”‚   └── main.yml                  # CI/CD pipeline
β”‚
β”œβ”€β”€ test_retrieval.py             # Test suite
β”œβ”€β”€ requirements.txt              # Dependencies
└── LICENSE                       # MIT License

πŸ›‘οΈ Stability & Future-Proofing

This project uses a lightweight dependency stack with direct API calls β€” no heavy SDK chains that break across versions. Simply run:

pip install -r requirements.txt

All dependencies will be restored to working versions.


πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘€ Author

Rakesh Raushan

GitHub


⭐ If AtlasRAG helped you, consider giving it a star! ⭐

Built with πŸ–€ by Rakesh Raushan

About

Hybrid RAG (BM25 + NumPy in-memory vector store) with LLM-as-a-Judge response scoring and a retrieval evaluation harness. Built with Gemini 2.5 Flash.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages