Skip to content

metalmancode/RAG-Project

Repository files navigation

Premium RAG Chatbot & Evaluation Pipeline

A professional, state-of-the-art Retrieval-Augmented Generation (RAG) application built with Python, FastAPI, and LlamaIndex. This project features a 5-stage advanced pipeline and a premium web interface for high-precision document interrogation.


🏗️ 5-Stage Advanced Pipeline

Our system utilizes a cutting-edge pipeline to ensure every answer is grounded in your facts:

  1. Indexing: Documents are chunked, embedded, and cached in a local vector database.
  2. Transformation (HyDE): Uses Hypothetical Document Embeddings to "imagine" an answer, drastically improving retrieval recall for vague questions.
  3. Retrieval: Searches the vector database using both the original and transformed queries.
  4. Reranking: A cross-encoder model scores results, keeping only the most relevant context.
  5. Generation: The CondensePlusContextChatEngine assembles history and context into a final factual response.

📁 Project Structure

├── src/                    # Core RAG engine and API logic
├── static/                 # Front-end (HTML/CSS/JS)
├── evaluation/             # Benchmarking scripts & results
├── notebooks/              # Experimental Jupyter notebooks
├── scripts/                # Utility & legacy scripts
├── data/                   # Knowledge base files (PDF/TXT)
├── local_storage/          # Persisted Vector Store (ignored)
├── run_app.py              # Main Application Entry Point
├── evaluate.py             # Evaluation Entry Point
└── requirements.txt        # Shared dependencies

🚀 Quick Start

1. Prerequisites

2. Setup

Clone the repository and install dependencies:

git clone https://github.com/metalmancode/RAG-Project.git
cd RAG-Project

# Option A: Using Pip
pip install -r requirements.txt

# Option B: Using Conda
conda env create -f environment.yml
conda activate rag-project-env

3. Environment Config

Create a .env file in the root:

GROQ_API_KEY=your_key_here

4. Run the Platform

python run_app.py

👉 Access the dashboard at http://localhost:8000/ui/


🎨 Interactive Control Center

The premium web interface allows you to tune the engine in real-time:

  • Control Center: Adjust Similarity Top K and Reranker Top N on the fly.
  • Dynamic Model Switching: Swap between Llama 70B (High Precision) and Llama 8B (High Speed) without restarting.
  • HyDE Toggle: Instantly enable or disable query transformation to see the impact on quality.
  • Knowledge Ingestion Wizard: Replace the bot's memory by simply uploading new files and renaming the persona.
  • Evaluation Lab: A dedicated experiment view to run Stage 1-4 benchmarks directly in the browser.

📊 Benchmarking & Documentation

  • Evaluation Manual: Detailed instructions on running complex offline experiments.
  • Web UI Guide: Full walkthrough of the control panel and settings.

⚖️ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors