Ask Grounded Questions

Enter any query to see hybrid semantic search, context augmentation, and answer synthesis in real time.

Try asking:

🔬 RAG Pipeline Inspector

Observe how the query is broken down across Dense Vector Search, Sparse BM25 Keyword Search, and Reciprocal Rank Fusion (RRF).

1️⃣ Dense Vector Search

Measures semantic similarity via cosine distance.

2️⃣ Sparse BM25 Search

Captures exact lexical matches and keyword occurrences.

3️⃣ Reciprocal Rank Fusion (RRF) Merge

Combines dense and sparse rankings: Score = sum( weight / (60 + rank) )

📚 Knowledge Base Manager

View pre-loaded articles or add your own custom notes to test real-time client-side chunking and indexing.

Indexed Documents

Index a New Document

📐 How Retrieval-Augmented Generation Works

A transparent breakdown of the architecture, trade-offs, and why hybrid search outperforms naive vector-only systems.

Step 1

Document Chunking

Embedding a 50-page document into a single vector averages out specific facts. We split text into overlapping windows (~400 words with 50-word overlap) to preserve local semantic meaning.

Step 2

Dual Indexing

Chunks are indexed in two distinct data structures: a vector index for conceptual similarity and a BM25 index for exact identifiers and numerical values.

Step 3

Hybrid Retrieval & RRF

Dense search finds synonyms; BM25 finds exact terms. Reciprocal Rank Fusion (RRF) merges both lists without requiring score normalization.

Step 4

Prompt Augmentation

The top ranked passages are injected into the LLM system prompt. The LLM is instructed to answer strictly from the retrieved evidence and cite sources.

🛠️ Engineering Transparency Note

This project was built and documented by Jayan Gupta. AI coding tools were used for rapid scaffolding. The hybrid retrieval logic, mathematical RRF formulation, and evaluation pipeline were designed and validated to provide a clear, educational reference implementation.

GitHub Repository: github.com/JayanGupta/RAG-Engine