Joel Stevick

Production RAG, line by line

Exercises

Changes to make in your own copy of the demo's public repository: RAG, the eval harness and the MCP server, simplest first. Each comes with the test that proves it, how to see it work, and the solution step by step.

How each exercise works

Fork joelstevick-demo-rag-pipeline on GitHub, clone your fork, and run npm install and npm test. The suite runs the Worker in workerd, Cloudflare's runtime, on your machine, against a local D1 database and a local OAuth store, with scripted models: it needs no Cloudflare account and no API key.

Each exercise starts from the commit its page names. Make a branch there, make the change, and run the exercise's test until it passes and the rest of the suite still does.

Every change stays in your copy. Each exercise has a solution branch in the public repository to compare your work with.

Fork joelstevick-demo-rag-pipeline on GitHub, clone your fork, then cd into it. With the GitHub CLI (gh), signed in, this one command does both:

gh repo fork AiFirstDevelopment/joelstevick-demo-rag-pipeline --clone && cd joelstevick-demo-rag-pipeline

Then, in your clone:

npm install
npm test

The exercises

  1. 1Filters on search RAG
    Add file, from_page and to_page to the MCP server's search_documents tool, so a client can search one file and a range of its pages.