A RAG pipeline that answers questions from your PDFs — with sources.
- Role
- AI engineer · Solo
- Platform
- Python
- Discipline
- AI & Data
- Year
- 2026
A Retrieval-Augmented Generation pipeline that lets users ask questions about PDF documents. The LLM answers from the source material rather than from its own parametric memory.
LLMs confidently make things up. For document Q&A, answers must come from the document — and irrelevant context in the prompt makes answers worse, not better.
- 01
Ingest
Extracted text from PDFs and split it into overlapping chunks.
- 02
Index
Generated vector embeddings and indexed them in a vector database for semantic search.
- 03
Retrieve & assemble
Retrieved the most relevant chunks and formatted them into a structured prompt.
- 04
Chain & tune
Chained retriever, prompt template, and LLM into one pipeline; tuned chunk size, overlap, and top-k to reduce irrelevant context.
Grounded answers
Responses are built from retrieved document passages.
Semantic search
Finds relevant passages by meaning, not just keywords.
Tunable retrieval
Chunk size, overlap, and top-k are configurable.
Single pipeline
One invocable chain from question to answer.
- A working end-to-end RAG pipeline over arbitrary PDFs.
- Tuned chunking and top-k retrieval to keep irrelevant context out of prompts.
“Most RAG quality problems are retrieval problems. Time spent on chunking and top-k paid off more than prompt tweaking.”
Need something similar? See my AI & Automation service.
Job Spring
A full-stack job portal connecting recruiters and job seekers.
Read case study
I'm looking for full-time full-stack and AI engineering roles, and I take on select freelance projects.