Spaces:
Running
Running
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -3,35 +3,12 @@ title: RAG Engine
|
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version: 1.36.0
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
---
|
| 11 |
|
| 12 |
# RAG Engine 🧠
|
| 13 |
|
| 14 |
-
|
| 15 |
-
1. **Document Ingestion & Chunking** (sliding window with overlap)
|
| 16 |
-
2. **Dense Vector Embeddings** (cosine similarity search)
|
| 17 |
-
3. **Sparse BM25 Keyword Search** (lexical matching for exact terms)
|
| 18 |
-
4. **Hybrid Retrieval with Reciprocal Rank Fusion (RRF)**
|
| 19 |
-
5. **Context-Augmented Generation** with source citations
|
| 20 |
|
| 21 |
-
|
| 22 |
-
Use the tabs on the left to:
|
| 23 |
-
- **💬 Ask Question**: Query the knowledge base with real-time source grounding and faithfulness scoring.
|
| 24 |
-
- **🔬 Pipeline Inspector**: Directly observe the raw output of Vector Search vs. BM25 Search vs. RRF Rank Fusion.
|
| 25 |
-
- **📚 Knowledge Base**: Inspect loaded documents or upload custom text/PDF files to index them immediately.
|
| 26 |
-
|
| 27 |
-
### 📐 Architecture
|
| 28 |
-
- **Chunking**: ~400-word passages with 50-word overlap to balance semantic focus and boundary continuity.
|
| 29 |
-
- **Embeddings**: Deterministic token hash embeddings by default (100% offline, zero-dependency), compatible with HuggingFace SentenceTransformers.
|
| 30 |
-
- **Hybrid Fusion**: Merges dense and sparse ranks via Reciprocal Rank Fusion:
|
| 31 |
-
RRF(d) = \sum_{m} \frac{w_m}{60 + \text{rank}_m(d)}
|
| 32 |
-
- **Generation**: Formats grounded context into system prompts. Provides extractive summaries on CPU or full LLM generation when an API key is provided.
|
| 33 |
-
|
| 34 |
-
### 🛠️ Transparency & Code
|
| 35 |
-
- **Author**: Jayan Gupta
|
| 36 |
-
- **Source Code & Unit Tests**: [GitHub Repository](https://github.com/JayanGupta/RAG-Engine)
|
| 37 |
-
- **Design Philosophy**: Simple, clean Python without heavy abstraction layers or type boilerplate.
|
|
|
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: static
|
|
|
|
|
|
|
| 7 |
pinned: true
|
| 8 |
---
|
| 9 |
|
| 10 |
# RAG Engine 🧠
|
| 11 |
|
| 12 |
+
Interactive demonstration of **Retrieval-Augmented Generation (RAG)** built from scratch to explain how modern RAG pipelines work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
- **GitHub Repository**: [JayanGupta/RAG-Engine](https://github.com/JayanGupta/RAG-Engine) (Full Python pipeline, Streamlit dashboard, Jupyter notebook, and test suite).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|