yogesh-yadav/enterprise-rag-engin
0
๐ Enterprise RAG Engine: Document Intelligence System
A robust, hallucination-free Retrieval-Augmented Generation (RAG) system built to perform accurate Q&A over complex or enterprise PDF documents. This application ensures high-fidelity answers by strictly grounding the AI's responses in the uploaded document context.
โจ Features
- Intelligent PDF Ingestion: Upload any PDF to automatically extract, split, and index its contents.
- Zero-Cost Native Embeddings: Uses the locally optimized
all-MiniLM-L6-v2Hugging Face model for textual vector embeddings. - Maximal Marginal Relevance (MMR) Search: Prevents context flooding by retrieving chunks that perfectly balance semantic similarity with topical diversity.
- Deterministic AI Synthesis: Powered by
Mistral AI(via LangChain) operating attemperature=0.0to eliminate artificial hallucinations. - Custom Chat UI: A sleek, dark-themed chat interface with distinct user and model message layouts.
๐ ๏ธ Tech Stack
- Frontend/UI: Streamlit
- Framework: LangChain
- Vector Database: ChromaDB
- Embeddings: Hugging Face (
sentence-transformers) - LLM: Mistral AI (
mistral-small-2603)
๐ Setup & Installation (Local & Hugging Face Spaces)
1. Prerequisites
Ensure you have Python 3.10+ installed.
2. Environment Variables
You need a Mistral API key to run the generation model.
- Local Setup: Create a
.envfile in the root directory and add:
MISTRAL_API_KEY="your_mistral_api_key_here"- Hingging Face Space: Go to your Space settings -> Variables and secrets -> Add a New Secret named
MISTRAL_API_KEYwith your actual key.
3. Dependencies
Ensure your requirements.txt includes the following (adjust versions as needed to avoid conflicts):
streamlit
python-dotenv
langchain-core
langchain-community
langchain-text-splitters
langchain-mistralai
chromadb
pypdf
sentence-transformers