
Scientific RAG Assistant
Ask the Papers.
A multi-stage retrieval pipeline combining dense vector search, keyword matching, reciprocal rank fusion, and LLM reranking to surface the most relevant evidence from the indexed paper corpus.
Retrieval Pipeline
8-Stage Query Processing
Every query flows through this sequence. Click any step to explore — or watch the example query transform live as it moves through each stage.
Natural language question submitted through the chat interface.
Query
“What are unidirectional error correcting codes?”
plain text → pipeline entry pointClick any step · auto-advances every 3 s
Retrieval Strategy
Dual Search + RRF Fusion
Two fundamentally different retrieval methods run in parallel then combined with Reciprocal Rank Fusion — each compensates for the other's blind spots.
The query vector is compared against all chunk embeddings using cosine similarity. Captures semantic meaning— finds conceptually related chunks even when exact keywords don't appear.
ORDER BY embedding <=> $query_vec LIMIT 20Exact and partial term matching against raw chunk text. Reliable for proper nouns, acronyms, and technical terms that embeddings may not capture precisely.
WHERE text ILIKE '%query_term%' LIMIT 20Reciprocal Rank Fusion
Each method returns its own ranked list. RRF assigns a score to every chunk based on its rank in each list, then merges them. A chunk that ranks highly in both lists scores highest. The constant k=60 smooths top-rank dominance.
Technology
Production Stack
Each component was selected for performance, correctness, and minimal operational overhead on a single-node deployment.
Async Python API with automatic OpenAPI docs, dependency injection, and CORS middleware.
Primary store for chunk text and 1536-dim embeddings with an IVFFlat index for fast cosine similarity search.
In-memory answer cache with a 1-hour TTL. Eliminates repeated LLM calls for identical queries.
Dual role: text-embedding-3-small produces 1536-dim chunk embeddings; gpt-4o-mini handles LLM reranking and answer generation.
Evaluation
Retrieval Quality Metrics
The pipeline is evaluated against a curated set of query–paper pairs using standard information retrieval metrics.
Hit@K
1 if expected_paper ∈ top-K results, else 0Fraction of queries where the expected paper appears in the top-K retrieved chunks. Measures whether the retriever surfaces the correct source at all.
MRR
1/N · Σ 1/rank(expected_paper)Mean Reciprocal Rank rewards retrievers that surface the correct paper at a higher rank. A score of 1.0 means the expected paper is always ranked first.

Ready to explore the research?
Ask any question across 20 indexed papers. Grounded answers with full citations.
Open the Assistant