literature-rag
Hybrid RAG over my thesis and the ~300 papers it cites, served to Claude Code over MCP
literature-rag is a retrieval-augmented generation (RAG) system over my PhD thesis on Lassa virus genomic surveillance and the roughly 300 papers it cites. I built it as a toy project to challenge myself and to assist me in the process of my thesis writing: finding the source of a claim, checking a number against the paper it came from, and finding where a new paper belongs in the thesis.
It combines the main ingredients of a modern retrieval pipeline:
- Structured text: publisher XML from Europe PMC where a paper is open access, GROBID otherwise, so every passage keeps its section and the references it cites.
- Hybrid search: lexical search (BM25) and semantic search with open-weight embedding models (Qwen3-Embedding), fused with reciprocal rank fusion and reranked by a cross-encoder.
- Local models: everything runs on a MacBook Pro M1 Max, so no paper and no unpublished chapter leaves the laptop.
- MCP server: three read-only tools for Claude Code to search the papers and the thesis, whose descriptions tell the model that a passage is a lead to check, not evidence.