Work / Academic Literature Navigator
Generative AIAcademic Literature Navigator
A retrieval-augmented research assistant. Upload a paper, ask a question, and get an answer grounded in the paper itself, with citations down to page and section.
images/literature-navigator.svg01Problem
Academic papers are long, dense and laid out for print. A general-purpose chatbot will happily summarise one, but it can also blend in outside knowledge or invent details, and it rarely shows where a claim came from.
For research work that is the wrong trade-off. I wanted answers that come only from the paper, and that point to exactly where in the paper they come from.
02How it works
- Parse: GROBID, running in Docker, turns the PDF into structured TEI XML. This keeps sections and pages rather than flattening the paper into a wall of text.
- Chunk: LangChain's recursive splitter cuts the text into chunks of 1,000 characters with 200 overlapping, carrying paper, year, page and section metadata.
- Embed and index: chunks are embedded with OpenAI
text-embedding-3-largeand stored in a FAISS vector index. - Retrieve: maximal marginal relevance (MMR) fetches 20 candidate chunks and keeps the 8 that are relevant and not repetitive. Both values can be changed in the UI.
- Answer: GPT-4, at temperature 0, writes the answer from the retrieved sources only.
03Grounding and citations
The system prompt does most of the trust work:
- Answer only from the provided sources.
- Cite every claim as
[paper_id, year, page, section], so a reader can check it in seconds. - If the evidence isn't there, say so instead of guessing.
04Application
- FastAPI backend:
POST /upload_pdfparses and chunks a paper and returns a document ID.POST /askruns the retrieval chain for that document. - Streamlit front end: upload a PDF, ask a question, and tune
kandfetch_kwithout touching code.
05What I'd do next
This is a demo, built to show the pattern end to end. To take it further I'd persist the FAISS index instead of rebuilding it per question, and support a whole library of papers instead of one. I'd also add an evaluation set to measure retrieval quality and citation faithfulness rather than judging it by eye.
Next project
Research Centre Quality Tiers →
Screenshot comingimages/research-centre.png