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.
Our system utilizes a cutting-edge pipeline to ensure every answer is grounded in your facts:
- Indexing: Documents are chunked, embedded, and cached in a local vector database.
- Transformation (HyDE): Uses Hypothetical Document Embeddings to "imagine" an answer, drastically improving retrieval recall for vague questions.
- Retrieval: Searches the vector database using both the original and transformed queries.
- Reranking: A cross-encoder model scores results, keeping only the most relevant context.
- Generation: The
CondensePlusContextChatEngineassembles history and context into a final factual response.
├── 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
- Python 3.10+ or Conda
- A Groq API Key
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-envCreate a .env file in the root:
GROQ_API_KEY=your_key_herepython run_app.py👉 Access the dashboard at http://localhost:8000/ui/
The premium web interface allows you to tune the engine in real-time:
- Control Center: Adjust
Similarity Top KandReranker Top Non 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.
- Evaluation Manual: Detailed instructions on running complex offline experiments.
- Web UI Guide: Full walkthrough of the control panel and settings.
This project is licensed under the MIT License - see the LICENSE file for details.