CoolFace
Apppublic

yogesh-yadav/enterprise-rag-engin

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

๐Ÿ“„ 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-v2 Hugging 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 at temperature=0.0 to 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 .env file in the root directory and add:
env
    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_KEY with your actual key.

3. Dependencies

Ensure your requirements.txt includes the following (adjust versions as needed to avoid conflicts):

text
streamlit
python-dotenv
langchain-core
langchain-community
langchain-text-splitters
langchain-mistralai
chromadb
pypdf
sentence-transformers