AI Agentic Handbook

Roadmap RAG Engineer

RAG Engineer Roadmap 2026

Most wrong answers from a RAG system are retrieval failures in fluent prose, and this roadmap teaches you to catch them where they start: in parsing, chunking and search.

In brief

To become a RAG engineer, learn embeddings and vector search, then document ingestion and chunking, hybrid search with reranking, grounded generation with citations, retrieval evaluation, and finally production concerns like freshness, permissions and cost. At 10–12 hours a week this takes about four months.

A support team asks its new assistant how long customers have to return a damaged item. It answers thirty days, cites the returns policy, and is wrong. The policy does say thirty days, and then, in a table two pages later, fourteen for electrical goods. The parser flattened that table into a line of loose numbers, the chunker cut the exception away from the rule, and the model did exactly what it was asked with the evidence it was given. Every part of the failure happened before the model was called.

That is the RAG engineer's territory. The job is search engineering with a language model at the end of the pipe. Your days go on unglamorous questions: why a scanned contract came out of the parser in the wrong reading order, whether a part number is better found by keyword than by meaning, which of fifty candidates deserve the five places in the prompt, and how a document deleted on Tuesday is still being quoted on Thursday. You are answerable for one thing above all, that the right evidence reached the model, and you prove it with numbers.

The chapters follow the path a document takes. Embeddings and vector indexes come first, because every later trade-off is between recall and speed. Then ingestion, where most quality is won or lost, then hybrid search and reranking, then the prompt that turns evidence into a cited answer. Evaluation comes fifth, once there is a pipeline worth measuring. Production comes last, because freshness, permissions and cost only bite when documents keep changing and users are not all allowed to see the same things.

Each chapter ends with a project on a corpus you choose, ideally an ugly one with PDFs, tables and duplicates; clean Markdown teaches little. Keep one golden set of questions with the evidence marked and carry it through every chapter. If the "already there?" line describes you, skip the chapter and put the hours into the project.

How long
About 4 months at 10–12 hours a week
Where to start from
You can write Python and have called an LLM API.
What you'll work with
Embeddings, Vector databases, pgvector, BM25, Hybrid search, Rerankers, Chunking, Document parsing, Retrieval metrics, Citations
What's inside
6 chapters, 40 steps (roughly 12 h of reading and practice) and 6 projects to build

Work through the chapters in order. Tick each step when you've done it; your progress stays in this browser. Use the filters to see only articles, concepts or interview practice, and skip any chapter you already know.

Chapter 1 Weeks 1–3

How meaning becomes searchable

An embedding model turns a passage into a few hundred numbers, and a vector index finds the ones nearest a query in a few milliseconds. Both steps are approximate. The model decides what counts as similar, often not the way your users would, and the index skips most of the corpus to stay fast, giving up a little recall for speed you can tune.

The usual mistake is to read the similarity score as a measure of relevance. It measures closeness in one model's geometry, nothing more. A score of 0.82 means different things on different corpora, and a question about something your documents never mention still returns its nearest neighbours, neatly ranked. Learn what the numbers mean before you build anything on them.

By the end of this chapter You can embed text, search it by similarity and explain what the scores do and don't tell you.

Already there? You can explain bi-encoders versus cross-encoders and how HNSW trades recall for speed.

The reading list

7 steps · about 6.5 h · 0 done
  1. 01Article · 5 min

    RAG in plain English: letting the AI look it up

    A quick, code-free picture of the whole loop. Skim it if you have built one before; it fixes the vocabulary used everywhere after.

  2. 02Concept · 5 min

    Embedding

    Pay attention to what the model was trained to treat as similar. That choice, made by someone else, sets the ceiling on your search.

  3. 03Concept · 5 min

    Cosine similarity

    The score has no fixed meaning across models or corpora, which is why a single relevance threshold rarely survives real questions.

  4. 04Concept · 5 min

    Bi-encoder

    Question and document never meet inside this model. That is what makes it fast, and why it misses distinctions a reranker later catches.

  5. 05Concept · 5 min

    Vector database

    Look past query speed to the dull features: filters, updates, deletes, backups. Those decide whether you can still run it next year.

  6. 06Concept · 5 min

    HNSW

    Its settings are your dial between recall and latency. You will turn that dial in the project, so understand what each one costs.

  7. 07Official docs · about 6 h

    Index and query a corpus with pgvector ↗

    Start here rather than with a new service. You keep joins and transactions, and you can measure before deciding to migrate.

    Vector search inside Postgres, which is often enough before a dedicated vector database earns its cost.

Build this

Semantic search over 10,000 documents

Put it in a public repository. It's finished when:

  • Indexed in pgvector or a vector database
  • Query latency measured at p50 and p95
  • Recall compared with exact (brute-force) search

0 of 3

Chapter 2 Weeks 4–6

Getting documents in without breaking them

Most RAG quality is decided before any search runs. A PDF stores characters and their positions, not paragraphs, so a naive extractor reads a two-column page straight across, folds the footer into the body and turns a price table into a row of orphaned numbers. Whatever comes out of the parser is all the retriever will ever see.

Chunking is where the second set of failures lives. Cut too small and a question whose answer spans two chunks finds only half of it: the rule in one, the exception in the next. Cut too large and the right sentence is diluted by everything around it. People choose 512 tokens because a tutorial did. Choose yours by measuring recall on questions with the evidence marked.

By the end of this chapter You can turn PDFs, tables and web pages into clean, well-sized chunks, and pick the chunk size by measurement.

Already there? You've chosen a chunking strategy by comparing recall across options on your own documents.

The reading list

7 steps · about 1.5 h · 0 done
  1. 01Concept · 5 min

    Layout-aware parsing

    Run your ugliest PDF through a plain text extractor first and read the output. You will see exactly what this step exists to prevent.

  2. 02Concept · 5 min

    Chunking

    Keep one question in mind as you read: where do my documents naturally break, and does my splitter respect those breaks?

  3. 03Concept · 5 min

    Chunk overlap

    The cheap answer to evidence that straddles a boundary. Note its cost as well: near-duplicate chunks crowding each other out of the top results.

  4. 04Concept · 5 min

    Contextual enrichment (breadcrumbs)

    A chunk that says "the limit is 30 days" without naming the product can't be found. This attaches the missing context, with Anthropic's measured gain.

  5. 05Concept · 5 min

    Parent-document retrieval

    The cleanest fix for an answer split across two chunks: match on a small passage, then hand the model the whole section around it.

  6. 06Article · 10 min

    Choose your chunk size by measurement, not folklore

    The method for this chapter's project. Notice why it labels evidence spans rather than documents: every chunk size finds the right document.

  7. 07Question set · 10 questions · about 1 h

    Chunking & Embeddings

    Interview questions on chunking and embeddings. Answer each with a number you measured, not a rule you remember.

Build this

A chunking comparison on messy documents

Put it in a public repository. It's finished when:

  • Three strategies compared on the same questions
  • Recall@k reported for each
  • Tables and headings survive parsing

0 of 3

Chapter 3 Weeks 7–9

Two searches and a second opinion

Vector search and keyword search fail in opposite ways. Embeddings handle paraphrase but blur exact strings, so an error code or a part number lands near its neighbours rather than on itself. BM25 matches the string exactly and has no idea that "cancel" and "terminate" mean the same thing. Run both, merge the two lists by rank, and each covers most of the other's misses.

A reranker then reads the question and each candidate together and puts the best few on top. The common mistake is adding one to a candidate pool that never contained the answer. Measure recall at fifty before recall at five. If the right chunk isn't among the candidates, no amount of reordering will produce it.

By the end of this chapter You can combine keyword and vector search, rerank the results and show the gain at each stage in numbers.

Already there? You've shipped hybrid search with a reranker and know your recall at each stage.

The reading list

7 steps · 40 min · 0 done
  1. 01Concept · 5 min

    BM25

    Decades old and still the scorer to beat on names, codes and rare jargon. Understand why rare words count for more.

  2. 02Concept · 5 min

    Hybrid search

    The default in most serious systems, for a plain reason: the two retrievers' errors barely overlap. Look for both kinds in your own queries.

  3. 03Concept · 5 min

    Reciprocal Rank Fusion (RRF)

    A few lines of code that merge two ranked lists without calibrating their scores against each other. Note what the constant k changes.

  4. 04Concept · 5 min

    Cross-encoder

    Sharper than any vector comparison and far too slow to run over the corpus, which is exactly why it only sees a short list.

  5. 05Concept · 5 min

    Query rewriting

    Users send follow-ups like "what about staging?" that mean nothing on their own. Rewriting turns them into something a retriever can match.

  6. 06Concept · 5 min

    Metadata filtering (pre, post, filtered ANN)

    Filters look like free precision. Read the part about recall, because a filter applied at the wrong stage quietly empties your results.

  7. 07Article · 5 min

    Hybrid search and reranking: a field guide

    Its rule using recall@50 and recall@5 tells you whether a reranker will help before you pay for the GPU to run one.

Build this

A retrieval pipeline with a scoreboard

Put it in a public repository. It's finished when:

  • Vector, keyword, hybrid and hybrid + rerank compared
  • Latency added by the reranker measured
  • Metadata filters applied before ranking

0 of 3

Chapter 4 Weeks 10–11

Answers that show their evidence

Retrieval hands you six good passages. The prompt still has to turn them into an answer a user can check. That means dropping near-duplicates, fitting a token budget, putting the strongest evidence where the model reads most carefully, and labelling every passage so each claim can point back to one.

Two failures dominate this chapter. The first is a fluent answer stitched partly from the passages and partly from the model's memory, with citations that look right and aren't. The second is a system that never says "I don't know", because nobody built a path for it. Treat abstention as a feature with its own test questions, and count refusals in your logs as carefully as you count answers.

By the end of this chapter You can assemble context so the model answers only from evidence, cites it, and abstains when the evidence isn't there.

Already there? Your RAG answers cite sources and refuse correctly on out-of-scope questions.

The reading list

6 steps · 40 min · 0 done
  1. 01Concept · 5 min

    Context assembly

    The step between ranking and the model. Every chunk you add is paid for on every query, so make each one earn its place.

  2. 02Concept · 5 min

    Lost in the middle

    Finding one fact in a long prompt is mostly solved; joining several is not. A question whose answer spans two chunks is the second kind.

  3. 03Concept · 5 min

    Grounding & groundedness checks

    Instructions get the model to use the sources. Checking that it did is a separate step, and the one most teams skip.

  4. 04Concept · 5 min

    Attribution & citations

    A citation is only useful if it points at the passage that actually backs the claim. The page is about measuring that, not formatting it.

  5. 05Concept · 5 min

    Abstention & relevance thresholds

    Your system needs a deliberate route to "I don't know", designed and tested like any other answer rather than left to the model's mood.

  6. 06Article · 10 min

    Your first RAG pipeline in pure Python

    Build it, then try its SAML example. A word match scores like a genuine hit, which shows why a fixed similarity floor can't decide relevance alone.

Build this

Cited answers, and honest refusals

Put it in a public repository. It's finished when:

  • Every claim links to a chunk
  • Out-of-scope questions get a refusal
  • Context fits a fixed token budget

0 of 3

Chapter 5 Weeks 12–14

Measuring the search, then the answer

A RAG system can fail in two places, and they need different fixes. If the right passage never reached the prompt, the problem is retrieval, and no prompt change will help. If it was there and the answer still went wrong, the problem is generation. Score the two separately or you will spend a week tuning the wrong half.

The common error is handing everything to a model judge and trusting the dashboard. A judge that passes nearly everything looks, on a chart, just like a system that works. Label a sample yourself, check how often the judge agrees with you on the failures specifically, and read the traces before you decide which number to chase.

By the end of this chapter You can measure retrieval and generation separately and say where each failure comes from.

Already there? You report recall@k and faithfulness for your system and track them over time.

The reading list

6 steps · 40 min · 0 done
  1. 01Concept · 5 min

    Recall@k

    The ceiling on everything downstream. Measure it against the evidence spans in your golden set, at the k you actually send to the model.

  2. 02Concept · 5 min

    nDCG

    Recall says the passage was found; nDCG says whether it was near the top. It becomes the number to watch once a reranker is involved.

  3. 03Concept · 5 min

    Faithfulness

    Faithful means supported by the sources given, not true. A perfectly faithful answer drawn from a stale document is still wrong.

  4. 04Concept · 5 min

    Context precision

    A useful partner to recall. It penalises evidence buried under noise, which is how a correct retrieval can still produce a muddled answer.

  5. 05Article · 10 min

    LLM-as-judge without fooling yourself

    Follow its worked example of correcting a judge's pass rate. High raw agreement with people can hide a judge that misses half the failures.

  6. 06Article · 5 min

    Error analysis, step by step: from 100 traces to a failure taxonomy

    Do this on about a hundred of your own traces. Record only the first failure in each; the later ones usually follow from it.

Build this

An eval suite for your RAG system

Put it in a public repository. It's finished when:

  • Retrieval and answer metrics on one dashboard
  • Judge agreement checked against your own labels
  • Top three failure types named with examples

0 of 3

Chapter 6 Weeks 15–17

Keeping it correct as documents change

A demo index is built once. A real one changes every hour: documents are edited, retitled, deleted and re-permissioned in the systems they come from, and each change has to reach the index before someone asks about it. The worst production bugs are quiet. A policy withdrawn last week is still quoted because its chunks were never removed. An intern's question surfaces a passage from a board paper because permissions were checked after the search, or not at all.

So this chapter is plumbing: incremental ingestion keyed on content hashes, deletes that propagate everywhere, access control applied inside the retrieval query, and a cost per question you can explain line by line. Senior interviews probe this ground hardest.

By the end of this chapter You can keep the index fresh, enforce permissions at retrieval time and control cost at scale.

Already there? You've run a RAG system with incremental updates and per-user access control.

The reading list

7 steps · about 1.5 h · 0 done
  1. 01Article · 5 min

    Anatomy of a production RAG system

    Every box between a question and a cited answer, each with a budget. Redo its cost arithmetic with your own chunk count and prices.

  2. 02Article · 10 min

    From toy RAG to a real one: embeddings, a vector store and an LLM

    The plumbing that lets a pipeline survive restarts and reruns: pinned versions, sensible retries, content-hash ids. Port your own project alongside it.

  3. 03Concept · 5 min

    Ingestion pipeline

    The half of the system that runs on the sources' clock rather than the user's. Most stale-index bugs start in its change detection.

  4. 04Concept · 5 min

    Tombstone

    Deletes are the change pipelines most often forget. Follow how the deletion travels to every copy, cache and replica, not just the main index.

  5. 05Concept · 5 min

    ACL (access control list)

    The rule to take away: check permissions inside the search, never after it. Filtering afterwards leaks through bugs and leaves narrow users with empty answers.

  6. 06Concept · 5 min

    Semantic cache

    Cheap wins with a sharp edge. Note the scoping by tenant, or one customer's cached answer reaches another.

  7. 07Question set · 10 questions · about 1 h

    Production RAG Systems

    Staff-level questions on multi-tenancy, security and incidents. Answer each in terms of blast radius, not boxes on a diagram.

Build this

Capstone: a RAG service that stays correct

Put it in a public repository. It's finished when:

  • Edits and deletes reach the index without a full rebuild
  • Users only retrieve documents they can open
  • Cost per query and cache hit rate reported

0 of 3

Where people get stuck

  1. Tuning the prompt for a retrieval problem

    If the right chunk never reaches the model, no prompt fixes it. Check recall on the failing question before you edit a single instruction.

  2. Picking chunk size by habit

    512 tokens with 10% overlap is where tutorials start, not an answer. Sweep a few sizes against evidence-span labels and take the smallest that scores near the best.

  3. Vector-only search

    Embeddings blur error codes, SKUs and names that keyword search finds at once. Run BM25 alongside and merge the lists with RRF.

  4. Forgetting deletes

    A document removed from the source but still in the index will keep being quoted, which is a compliance problem as much as a quality one. Propagate tombstones and test that a deleted file stops appearing.

A last word

By the end you will have a retrieval pipeline you can explain stage by stage, a golden set with the evidence marked, and a scoreboard showing what each layer added and what it cost. Your opinions about chunk sizes and rerankers will come from your own numbers, which is what makes them worth hearing in an interview.

The roadmaps below take the same retrieval layer in other directions: into agents that search as one tool among several, into the platform that runs evaluations and deployments, or back out to the broader AI engineering role. Your golden set travels with you to all three.

Take this roadmap with you

Copy every step as a Markdown checklist for Notion, GitHub Issues or your notes, or send someone the link.

aiagentichandbook.com/roadmaps/rag-engineer/

Further reading

All 33 articles →

Talking a team out of RAG (when it is the wrong tool)

RAG is a default, not a requirement. When long context with prompt caching or text-to-SQL is the better design, what it costs and how fast it is with numbers, how per-document permissions change the answer, and the written threshold that flips the decision.

Prompt, retrieve or fine-tune? A decision guide

Diagnose the failure first, then pick the technique. A worked claims-triage case shows where fine-tuning pays in 2026: cost, not knowledge.

Your first eval set in an afternoon

Thirty to fifty real examples, five check types, a Wilson interval on the score, and a comparison that respects noise — in plain Python with no frameworks.

The real cost of an LLM feature: latency, tokens and the bill

Five terms make up the bill and two make up the wait. Reasoning tokens, cache writes, batch discounts and the self-host break-even, worked with stated assumptions.

Structured outputs that don't break

Getting JSON out of a model is easy; getting JSON your code can trust on every call is a system. Schemas, provider structured-output modes versus prompting, validation with targeted retries, and rendering partial JSON while it streams.

A reading list by level: the papers, posts and books worth your time

Twenty-eight primary sources, grouped from first steps to staff level, with one line on why each one still matters.

Questions people ask about this roadmap

What does a RAG engineer do?

A RAG engineer builds the retrieval layer behind AI answers — parsing and chunking documents, indexing them, combining keyword and vector search, reranking, and measuring retrieval quality so answers are grounded and cited.

Is RAG still relevant with long context windows?

Yes. Long context helps, but retrieval is still cheaper, faster, easier to keep fresh and easier to permission than putting everything in the prompt, and models still reason less reliably over very long inputs.

Do I need a vector database?

Not at first. Postgres with pgvector handles many production workloads. Move to a dedicated vector database when scale or filtering needs demand it.

What metrics should a RAG engineer track?

Recall@k and nDCG for retrieval, faithfulness and answer correctness for generation, plus latency and cost per query.

How long does this roadmap take?

About four months at 10–12 hours a week if you can already write Python.

Is this roadmap free?

Yes. Every step is a free handbook page or free official documentation.

Other roadmaps

All roadmaps →
About 6 months

AI Engineer

You want the broadest AI engineering job and aren't sure which specialism yet.

About 5 months

Agentic AI Engineer

You want to build systems that take actions, not just answer questions.

About 5 months

LLMOps & AI Platform Engineer

You come from DevOps, SRE or backend and want to own the AI platform.

More from the handbook

All free at aiagentichandbook.com