S

A RAG pipeline that answers questions from your PDFs — with sources.

Role
AI engineer · Solo
Platform
Python
Discipline
AI & Data
Year
2026
PDF
Chunk
Embed
Retrieve
LLM
Overview

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.

PythonLLM APIVector DBEmbeddingsPDF Parsing
The challenge

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.

Approach
  1. 01

    Ingest

    Extracted text from PDFs and split it into overlapping chunks.

  2. 02

    Index

    Generated vector embeddings and indexed them in a vector database for semantic search.

  3. 03

    Retrieve & assemble

    Retrieved the most relevant chunks and formatted them into a structured prompt.

  4. 04

    Chain & tune

    Chained retriever, prompt template, and LLM into one pipeline; tuned chunk size, overlap, and top-k to reduce irrelevant context.

Key features

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.

Outcome
  • A working end-to-end RAG pipeline over arbitrary PDFs.
  • Tuned chunking and top-k retrieval to keep irrelevant context out of prompts.
What I learned

“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.

Next project

Job Spring

A full-stack job portal connecting recruiters and job seekers.

Read case study
Job Spring preview
Next step

I'm looking for full-time full-stack and AI engineering roles, and I take on select freelance projects.