Part 3 · Build

Build the agent on your own machine

Part 3 has nine guided TypeScript stages (0–8) plus a Stage 9 transfer project. This page gets the local tools working, proves offline Stage 0, and then hands you to the repository without pretending the website can see your progress.

A launchpad, not an online IDE

Your code, model keys, outputs and progress stay in your local clone. This static website neither runs the course nor reads course/progress.json.

The course itself is in English. The site is in nine languages, but the stage guides, the café menu and the twenty test cases are not translated — translating the measured inputs would change the exercise, which is the same reason the Lab's cases stay English.

Before you begin

  • You can read and edit basic TypeScript: functions, objects, loops and await.
  • You have Git, Node.js 24, a terminal and a code editor.
  • Allow about four hours for the nine guided stages (0–8); the Stage 9 transfer project is open-ended, and you can stop and return later.

Done the Lab? Stages 1–4 will be review — this time you write the code.

Run offline Stage 0 first

  1. 1. Clone and install

    Clone the public repository, enter it, and install the exact locked dependencies.

    That clone and install pull the whole website — several hundred megabytes, because the course shares the site's manifest. The course itself imports one package. Give it a few minutes on a slow connection.

    git clone https://github.com/HUDongpin/agent-edu.git
    cd agent-edu
    npm ci
  2. 2. Make the one Stage 0 edit

    Open course/stage0-hello/run.ts and replace the empty QUESTION string with a question of your own.

    export const QUESTION = "What should I notice about an API?";
  3. 3. Run and check it without a key

    Offline mode uses a bundled deterministic stand-in. It is the safest preflight: no provider request, private recording or token charge.

    npm run course:offline
    npx tsx course/stage0-hello/run.ts --offline
    npx tsx course/check.ts 0 --offline

The check succeeds when you see

PASS  you asked the model something
PASS  an answer came back

  stage 0 complete.

Choose a Provider only when you are ready

Scripted offline mode

Needs no key and makes no paid request. It proves the code path, but cannot demonstrate model variation.

--offline

DeepSeek

The default live Provider. Your terminal process reads DEEPSEEK_API_KEY; live stages incur DeepSeek charges and print their measured spend.

export DEEPSEEK_API_KEY=your_key_here

Claude

An optional local Provider for comparison. Set the key and CAFE_PROVIDER. Claude pricing can be much higher, so inspect the printed estimate before a run.

export ANTHROPIC_API_KEY=your_key_here
export CAFE_PROVIDER=anthropic

Costs are Provider-side

Offline is free. Live totals vary with the selected model, tokens, cache and current Provider prices. Treat any course estimate as dated; the Provider dashboard is the billing record.

Progress belongs to this clone

The course checker writes course/progress.json locally. The website cannot observe that file, so it shows no percentage and no Resume state for Part 3 — only the note you make for yourself below.

npx tsx course/report.ts
# reads course/progress.json in this clone

Nothing here checks your work. If you have finished the stages, you can note that for yourself. It is kept in this browser, it is sent nowhere, and you can remove it at any time.

What you will take away

Stage 9 asks you to move beyond the café and document an agent in a domain you know. A reviewable submission includes:

  • the problem boundary and what the model is allowed to decide;
  • one realistic failure input that breaks the simple rules;
  • a small eval set with evidence, not just selected good outputs;
  • a code-enforced gate before the most irreversible action;
  • the Provider, tool and untrusted-input boundaries;
  • a short retrospective on failures, trade-offs and the next test.

If the local setup is too steep

Return to the browser Lab and practise rules → prompt → eval first. It teaches the same control handoff without asking you to install a development environment.