Skip to content
RAG & SearchArXiv Research Assistant

Production RAG Pipeline

/Case Study

A production-grade Retrieval-Augmented Generation system that answers natural language questions about AI research papers with fully cited, grounded responses. Built to demonstrate the enterprise RAG pattern used in real-world document intelligence systems.

Category
RAG & Search
Type
ArXiv Research Assistant
Core stack
Python · FastAPI · Qdrant
Status
Live at production-rag-pipeline.vercel.app
/04 · RAG & Searchproduction-rag-pipeline.vercel.app

A production-grade Retrieval-Augmented Generation system that answers natural language questions about AI research papers with fully cited, grounded responses.

/Architecture

Ingestion pipeline
50 ArXiv PDFs downloaded via the arxiv Python client, parsed with PyMuPDF, chunked into 646 overlapping 512-word segments with citation metadata per chunk (title, authors, published date, arXiv URL).
Hybrid retrieval
BM25 keyword search (rank-bm25) and dense vector similarity (BAAI/bge-small-en-v1.5, 384-dim embeddings) run in parallel. Results fused with Reciprocal Rank Fusion (RRF).
Vector store
Qdrant Cloud (AWS us-east-1), cosine similarity, 646 vectors persisted and queryable over HTTP.
Reranking
cross-encoder/ms-marco-MiniLM-L-6-v2 re-scores top 20 hybrid candidates, returns top 5 chunks.
Generation
GPT-4o with citation-enforcement prompt. Every claim references a numbered source; ungrounded answers are refused.
Evaluation
RAGAs (Faithfulness, Context Recall) on a golden Q&A dataset. GitHub Actions CI gates every PR — regressions block merges.

/Stack

Backend
Python · FastAPI · uvicorn
Retrieval
rank-bm25 · sentence-transformers · Qdrant Cloud
Reranking
Hugging Face Transformers · cross-encoder/ms-marco-MiniLM-L-6-v2
LLM
OpenAI GPT-4o
Evaluation
RAGAs · pytest · GitHub Actions
Frontend
React · Vite · Tailwind CSS
Deployment
Railway (backend) · Vercel (frontend) · Qdrant Cloud

/Key engineering decisions

04 points
  1. Hybrid over vector-only

    Semantic search misses exact technical terms; BM25 catches model names and paper-specific terminology. RRF fuses both without score normalization.

  2. Two-stage retrieval

    Fast approximate search for recall, accurate cross-encoder for precision.

  3. Citation enforcement over best-effort

    Every claim tied to a retrieved chunk — auditable answers for enterprise deployment.

  4. CI-gated evaluation

    Automated RAGAs on every PR so retrieval tuning never silently degrades quality.