PixioLab
Cover of Guide 01, RAG, Explained

Guide 01 · 62 pages · 16 chapters

RAG, Explained

Retrieval-augmented generation from first principles to production.

By PixioLab

Included in the full program and the guide library. See the 45-day roadmap.

What's inside

  1. 01

    Why RAG exists

    A language model writes from memory. RAG lets it look things up first. This chapter covers the core idea, the two lanes every RAG system has, and exactly what changes in the prompt.

    What an LLM does on its own · Four limits of an LLM working alone · The open-book idea · The two lanes of every RAG system · What the model actually sees · What RAG fixes, and what it doesn't

  2. 02

    The pipeline, stage by stage

    Seven stages turn raw files into a cited answer: parse, chunk, embed, index, retrieve, rerank and generate. Each one has a classic mistake, and most RAG bugs are one of them.

    Stage 1 · Parse: get clean text out of files · Stage 2 · Chunk: cut text into retrievable pieces · Stage 3 · Embed: turn text into vectors · Stage 4 · Index: store vectors for fast search · Stage 5 · Retrieve: find candidates, with filters · Stage 6 · Rerank: sort the short list carefully · Stage 7 · Assemble the prompt and generate · All seven stages on one page

  3. 03

    Hybrid search and rank fusion

    Vector search understands meaning but blurs exact details. Keyword search is the opposite. Run both, merge the ranked lists, and you get the retrieval baseline most production systems start from.

    The gap in vector search · Use both: hybrid search · How to merge two ranked lists · Does hybrid really help?

  4. 04

    A minimal pipeline you can run

    Everything from Chapters 01–03 in one small Python file: chunk, embed, store, hybrid search with RRF, rerank, and generate an answer with checked citations. About 95 lines, no framework.

    Part 1 · Chunk and embed · Part 2 · Hybrid search, RRF and rerank · Part 3 · Generate with citations, then check them · What it leaves out, on purpose

  5. 05

    Advanced tactics, by failure

    Basic RAG handles easy questions. These tactics handle the hard ones. Each fixes a specific failure, costs something, and should be added only when your measurements show that failure.

    Group 1 · Fix the question · Group 2 · Fix the index · Group 3 · Fix the results · Group 4 · Check the work · Pick by problem

  6. 06

    Beyond one-shot retrieval

    Some questions need several searches, some need connected facts, some need no search at all, and some need SQL. This chapter maps those cases and points to the guides that go deeper.

    From one search to many: agentic RAG · Connected facts: GraphRAG · When you can skip search: long context and caching · Numbers in tables: text-to-SQL · Memory: retrieval over the agent's own history

  7. 07

    Multimodal RAG

    A lot of what a company knows isn't plain text: presentations full of charts, scanned forms, wiring diagrams, product photos, recorded meetings. There are three ways to make that searchable, and most teams end up mixing them.

    Road 1 · Turn everything into text · Road 2 · One embedding space for text and images · Road 3 · Search images of whole pages · Which road should you take?

  8. 08

    Evaluate and debug

    How to know whether your RAG system works, which half is failing when it doesn't, and how to turn a wrong answer into a measured fix. This chapter covers the RAG-specific core; Guide 03 goes deep on evaluation in general.

    Why testing comes first · Score the two halves separately · The seven ways RAG breaks · A worked debugging example · Two reminders from the field

  9. 09

    RAG in production

    What changes when real users arrive: latency and cost budgets, documents that change, permissions, attackers, and the checks you run before launch. Reliability patterns that apply to every LLM feature live in Guide 04; this chapter covers what is specific to RAG.

    Latency: a budget per stage · Cost: a worked model · Freshness: keep the index in step with the sources · Who may see what · Attacks aimed at RAG · Guardrails and monitoring · Before you launch

  10. 10

    When to use RAG, and when not to

    RAG is one tool among several. Picking the wrong one is the most expensive mistake in this guide, because no amount of tuning fixes it.

    RAG next to the alternatives · Eight quick cases

  11. 11

    The state of the field

    Since 2025, people have argued about whether RAG is dead. Read closely, both sides agree on more than the headlines suggest, and what they agree on tells you which skills to invest in.

    Two terms you'll hear in this debate · The case that RAG is dying · The case that RAG is alive · What both sides agree on · What's changing

  12. 12

    Choosing your stack

    Every RAG system is built from the same handful of component types. Learn the categories and the questions to ask of each, and you can evaluate any product, including the ones that don't exist yet.

    Questions that decide most choices · Three starter stacks · Patterns from published production systems

  13. 13

    Build it: projects and practice

    Reading gives you the map; building gives you the skill, and the numbers you'll talk about in interviews. Guide 05 has the full project specs; this chapter shows how they fit together.

    A suggested order · Practice for interviews

  14. 14

    Cheat sheet

    The defaults, the numbers and the debugging order on one page.

  15. 15

    Glossary

    Every term defined in a box in this guide, A to Z, with the chapter where it's introduced.

  16. 16

    Sources and further reading

    Everything this guide cites, grouped by chapter, followed by a short reading list. Company results are as the companies published them, so test claims on your own data before relying on them.