Build your own RAG pipeline
Setup & orientation·2 min

Run the grader

0 / 2
# grade this stage (from your course directory)
npx theinference test --stage run-the-grader --watch

This is your first green check. It proves the loop works — edit, save, watch it grade — before you write any pipeline code. Every later step plugs into this exact loop.

The run / learn loop

You work in your own editor and terminal:

  1. Log in (once): npx theinference login — approves in your browser, and passing stages then tick off here automatically
  2. Scaffold the course: npx theinference course start rag-pipeline ./rag-pipeline
  3. Install dependencies: cd rag-pipeline && npm install
  4. Run the grader in watch mode: npx theinference test --stage run-the-grader --watch

For process steps the grader runs your program through ./your_program.sh <command> (which runs cli.ts) and compares stdout to a frozen reference. For adapter steps it calls a function from tests/adapters.ts on fixed inputs and compares the returned numbers. Steps unlock in order.

What to do

Your task

Run the grader

Nothing to write — the setup command is already wired in cli.ts. Just run the grader and watch this step pass.

cli.ts
case "setup": {
  console.log("setup");
  break;
}
The data ships with the course

Unlike the real-world version, there is no model download. The vendored corpus, QA set, and the recorded cassette all live in fixtures/data/, and the embedder is pure n-gram hashing — so everything runs offline and deterministically. (See NOTES.md for the SQuAD + MiniLM upgrade path.)

Keep the grader in a split pane
  • npx theinference test --stage <stage> --watch re-runs on every save — bump --stage as you advance (each lesson shows its command).
  • Debug to stderr (console.error); the grader only reads stdout, so a stray console.log will fail an exact-match check.
  • With --stage set, a fully green run means your current stage is complete.

How it's graded

Your program is run as ./your_program.sh setup. Its stdout must be exactly:

setup