Joel Stevick
Cover of Agentic Workflows: Building a RAG Pipeline That Cites Its Sources

The book · free to read · 54,000 words

Agentic Workflows: Building a RAG Pipeline That Cites Its Sources

The series' pipeline, written down. You build Howard's Lantern, a question box over the driving laws of all 51 states, by hand, one stage at a time, in TypeScript, and compare each stage with the production code.

Start reading

Prefer paper or Kindle? Paperback · Kindle, on Amazon.

Contents

  1. Introduction

    Introduction

    1. What it is not
    2. What you are going to build
    3. Why the check exists
    4. Who this is for
    5. Typing it yourself
    6. What you need before Chapter 1
    7. How to read the code
    8. When the model is replaced
  2. Chapter 1

    Talking to a Model

    1. What the thing on the other end actually is
    2. Your first call
    3. The request, field by field
    4. Tokens
    5. The response
    6. One place for the things that change
    7. The system prompt
    8. A reply your code can read
    9. Where this leaves you
  3. Chapter 2

    Writing From a Book

    1. The corpus
    2. The rules
    3. The call
    4. In production
    5. What it still cannot do
  4. Chapter 3

    The Check That Is Not the Model

    1. Why it is not a prompt
    2. What counts as a figure
    3. The checker
    4. Proving it
    5. In production
    6. Where this leaves you
  5. Chapter 4

    Finding It by Its Words

    1. Words
    2. BM25
    3. Retrieval by words
    4. Proving it
    5. What words cannot do
    6. In production
    7. Where this leaves you
  6. Chapter 5

    Finding It by Meaning

    1. Text as a point in space
    2. The provider
    3. The search
    4. Two rankings into one
    5. Proving it
    6. In production
    7. Where this leaves you
  7. Chapter 6

    Saying It the Law’s Way

    1. The question’s words match the wrong laws
    2. The rules the rephraser is given
    3. The rephraser
    4. What a search does to the shortlist
    5. In production
    6. Where this leaves you
  8. Chapter 7

    Choosing What It Reads

    1. Ranking by wording is not ranking by answering
    2. The reranker
    3. The fallback is its own retrieval
    4. In production
    5. Where this leaves you
  9. Chapter 8

    Once Found, Look It Up

    1. The answer that was true and no use
    2. The section as a key
    3. Proving it
    4. In production
    5. Where this leaves you
  10. Chapter 9

    A Corpus You Can Trust

    1. Fetched, from the source, and nowhere else
    2. Cut into subsections
    3. The record that holds the index to the corpus
    4. A model may choose, and code decides
    5. As of
    6. Proving it
    7. In production
    8. Where this leaves you
  11. Chapter 10

    Failing Closed

    1. The rule
    2. One turn, end to end
    3. Built from the environment
    4. What the deployed pipeline does with a failure
    5. Where this leaves you
  12. Chapter 11

    Measuring the Whole Thing

    1. What the tests cannot say
    2. The golden set
    3. The register, measured
    4. The harness
    5. What it is not
    6. In production
    7. Where this leaves you
  13. Chapter 12

    Tests That Never Call the Model

    1. A model that answers from a script
    2. A test is a mutation pair
    3. Where the layers stub, and what each can catch
    4. Where this leaves you
  14. Conclusion

    Conclusion

    1. What will be obsolete
    2. What will not
    3. What to do next
  15. Appendix A

    Glossary

  16. Appendix B

    The Finished Pipeline

    1. What is here
    2. package.json
    3. tsconfig.json
    4. .gitignore
    5. ask/talk.ts
    6. ask/setup.ts
    7. ask/scope.ts
    8. ask/corpus.ts
    9. ask/answer.ts
    10. ask/figures.ts
    11. ask/check.ts
    12. ask/check.test.ts
    13. ask/retrieve.ts
    14. ask/retrieve.test.ts
    15. ask/vectors.ts
    16. ask/fuse.ts
    17. ask/fuse.test.ts
    18. ask/rephrase.ts
    19. ask/rerank.ts
    20. ask/schedule.ts
    21. ask/sections.ts
    22. ask/widen.test.ts
    23. ask/chunk.ts
    24. ask/manifest.ts
    25. ask/corpus.test.ts
    26. ask/pipeline.ts
    27. ask/live.ts
    28. ask/ask.ts
    29. ask/eval-cases.ts
    30. ask/register.ts
    31. ask/eval.ts
    32. ask/pipeline.test.ts

Also by Joel Stevick

The 25x Developer: building real applications with AI agents, quickly, without giving up the testing that keeps them working. On Amazon.