CoolFace
Apppublic

Sohel2309/enterprise-rag

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

Enterprise RAG Platform

Production-grade retrieval-augmented generation system with hybrid retrieval, intelligent reranking, and conversation memory.

![Live Demo](https://sohel2309-enterprise-rag.hf.space)

![GitHub](https://github.com/Sohel2309/Enterprise-RAG)

Overview

Enterprise RAG Platform combines BM25 sparse + BGE dense embeddings with Cohere reranking to deliver accurate, context-aware answers. Features conversation memory, real-time document upload, and automated RAGAS evaluation.

๐Ÿ“Š Key Results

MetricScore
Faithfulness0.842
Answer Relevancy0.900 โญ
Context Precision0.877
Context Recall0.721
Indexed Chunks7,536
Evaluated QA Pairs45

๐Ÿ—๏ธ Architecture

Retrieval Pipeline:

  • โ€”BM25 (sparse) + BGE-large embeddings (dense) with RRF fusion
  • โ€”Cohere cross-encoder reranking (top-60 โ†’ top-10)
  • โ€”DeBERTa-v3 NLI hallucination detection per-chunk

Generation:

  • โ€”Groq openai/gpt-oss-120b with 3-turn conversation memory
  • โ€”Automatic session management + real-time document ingestion

๐Ÿš€ Tech Stack

FastAPI ยท Streamlit ยท FAISS ยท BGE Embeddings ยท Cohere Reranking ยท Groq LLM ยท RAGAS Evaluation ยท HuggingFace Spaces

โšก Quick Start

bash
# Install
pip install -r requirements.txt

# Run locally
uvicorn api.rag_api:app --reload --port 8000  # Terminal 1

streamlit run ui/streamlit_app.py             # Terminal 2

# Visit http://localhost:8501

๐Ÿ“ Project Structure

text
Enterprise-RAG/
โ”œโ”€โ”€ api/                 # FastAPI backend
โ”œโ”€โ”€ ingestion/           # PDF/DOCX parsing + 5 chunking strategies
โ”œโ”€โ”€ retrieval/           # BM25 + FAISS + Cohere reranking
โ”œโ”€โ”€ generation/          # Groq LLM client
โ”œโ”€โ”€ evaluation/          # RAGAS + hallucination detection
โ”œโ”€โ”€ ui/                  # Streamlit dashboard (3 tabs)
โ””โ”€โ”€ data/
    โ””โ”€โ”€ processed/       # Pre-indexed chunks (FAISS + BM25)

๐ŸŽฏ Features

โœ… Hybrid retrieval (BM25 + dense embeddings)

โœ… Intelligent reranking with Cohere

โœ… Multi-turn conversation memory

โœ… Real-time PDF/DOCX upload

โœ… Automated hallucination detection

โœ… Interactive evaluation dashboard

๐Ÿ“ˆ Benchmark

Fixed-size chunking outperformed sentence-based by 17% on context precision. Evaluated on 50 ArXiv papers with 355 QA pairs.

๐Ÿ” Evaluation Methodology & Limitations

The metrics in Key Results are produced by an LLM-as-judge evaluation, not a human-labeled benchmark. The judge model is openai/gpt-oss-120b, run against a held-out set of QA pairs using the exact same retrieval configuration as production (hybrid retrieval + Cohere reranking). The current reported run evaluated 45 valid samples.

Two limitations worth stating plainly:

  • โ€”Self-judging bias: the same model (openai/gpt-oss-120b) is used for both answer generation and evaluation scoring. LLM judges are known to show some self-preference bias, so these scores should be read as internal, project-level evidence of pipeline quality โ€” not as an external or industry benchmark.
  • โ€”Sample size: 45 samples is directional evidence appropriate for a project of this scope, not a statistically rigorous evaluation.

These numbers are useful for demonstrating that retrieval and generation quality were measured and iterated on, not just assumed to work.

๐Ÿ”— Links

  • โ€”Live Demo: https://sohel2309-enterprise-rag.hf.space
  • โ€”Code: https://github.com/Sohel2309/Enterprise-RAG

MIT License | Last Updated: June 2026