Custom RAG
From-scratch retrieval-augmented generation with hybrid search, cross-encoder reranking, and a measured eval suite.
Overview
Built an end-to-end RAG system on a fully free/local stack: fastembed (bge-base-en) embeddings, ChromaDB vector store, BM25 lexical search fused via Reciprocal Rank Fusion, then a bge-reranker-base cross-encoder for two-stage retrieve-then-rerank, with Groq (llama-3.1-8b) for generation. Designed a 59-question gold set over a corpus seeded with archived "distractor" documents so ranking quality actually matters. Reranking nearly doubled hard-question Recall@1 (0.333 to 0.583) and reached 0.818 Recall@1 / 0.897 MRR overall; also showed why LLM-as-judge at k=5 cannot see ranking gains. Served through FastAPI with /upload and /ask endpoints and a static chat UI.