Personal project · NLP prototype
RAG for Research Paper Q&A
This retrieval-augmented generation (RAG) pipeline retrieves three passages from a research paper and uses them as context for GPT-4o-mini to answer the reader’s question.
- Scope
- Question answering over an uploaded PDF
- When
- 2026
PDF retrieval & command-line Q&A
Try demo
A fictional document supports local keyword retrieval and extractive responses. The visual inspection interface is new for this portfolio; no LLM API or upload runs here. This interface was created for the portfolio.
The question
How can a question-answering tool use an uploaded paper rather than relying only on a model’s prior knowledge?
Supporting figure
What reaches the language model?
RETRIEVAL ARCHITECTUREContext sent with the question
“Answer the question based only on the following context.”
Approach
PyPDF loads a document and a recursive splitter creates 1,000-character chunks with 200-character overlap. OpenAI embeddings index chunks in Chroma. For each question, the pipeline retrieves the three closest chunks and supplies them as context to GPT-4o-mini through LangChain.
Project work
The command-line tool lets a reader ask questions about a PDF. For each question it retrieves three passages and passes them to the answer model. The retrieved text and chunking settings can be inspected when an answer misses relevant context.
Results & evidence
The public repository contains the pipeline and an example question. It demonstrates loading, chunking, embedding, retrieval, and generation; it does not include a comparative evaluation of retrieval quality or answer faithfulness.
Scope & interpretation
A prompt asking the model to stay within context does not guarantee factual or complete answers. The next useful extension is an annotated question set, source-page attribution, and separate evaluation of retrieval coverage and answer support.
Project materials
Public code and a method diagram; this portfolio does not upload documents to an API.