Build your own RAG Pipeline
Retrieval-augmented generation from first principles: chunk documents, embed them, retrieve by similarity, and generate answers grounded in what was retrieved.
- Intermediate
- About 8–16 h
- 4 checkpoints
- 1 tutorial · Python
Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.
Choose a tutorialWhy build it
RAG is the most common pattern in LLM applications. Building each stage by hand shows where answers go wrong: in chunking, in retrieval or in generation.
You will be able to
- Chunk and embed a document collection.
- Retrieve by vector similarity and improve it with query rewriting or re-ranking.
- Generate answers that cite their sources.
- Evaluate retrieval separately from generation.
Skills it exercises
Recommended on Applied AI Engineer and AI Agent Engineer.
How you know you are there
Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.
- Checkpoint 1Self-check
Index
Done when: Documents are chunked, embedded and stored, and a query returns the top-k chunks with scores.
- Checkpoint 2Self-check
Grounded answers
Done when: Answers are generated only from retrieved chunks and cite their chunk IDs.
- Checkpoint 3Self-check
Better retrieval
Done when: Multi-query, HyDE or re-ranking is added, and precision@k on 10 labelled questions is compared before and after.
- Checkpoint 4Self-check
Abstain
Done when: Questions the documents cannot answer get an explicit 'not found' instead of an invented answer.
Stretch goals
- Hybrid search with BM25 (see Build your own Search Engine).
- Route questions to different indexes.
Step-by-step guides
Pick one in a language you know (tutorial languages: Python). They open on the author’s site.
- Python
RAG for Document Search(external site)
Python notebooks: indexing, retrieval, query translation, routing and generation.
Where to go next
Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.
Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.