TheFocus.AI TheFocus.AI
Part 3: Trajectories — Single-Tool Agent + Logger

Part 3: Trajectories — Single-Tool Agent + Logger

Chapters 07–09: Build the smallest possible agent harness, instrument it to record everything, and fine-tune the 1B until it emits valid tool calls.

TUTOR WITH THEFOCUS.AI

Agent Integration

Copy this prompt into Claude, ChatGPT, or any external AI assistant. It points the assistant to the course instructions and links it to your student profile to track your progress and customize observations.

Please tutor me in this lesson using the following context. First, read the instructions at: https://courses.thefocus.ai/llms.txt My Student ID is: <none> The lesson markdown source is at: https://courses.thefocus.ai/fine-tune-local-agent/03-trajectories/07-the-harness.md

You are not enrolled yet. Enroll to generate a Student ID to track lesson completions and store learning notes.

Part 3: Trajectories

Single-tool agent + logger · ~2–3 days

This is where the actual insight of the whole project lands: you are not fine-tuning the model on your code. You are fine-tuning it on the shape of agentic behavior. Build the smallest possible harness, log everything it does, distill a teacher’s traces, and tune the 1B until it emits syntactically valid tool calls. Not smart ones. Valid ones.

ChapterWhat You’ll Do
07 · The HarnessTwo hundred lines, one tool: the smallest agent loop that works
08 · The LoggerThe trajectory schema — the actual artifact of this part
09 · Teacher TracesDistill Claude’s traces into training data, tune, and measure validity rate

What You’ll Have After Part 3

  • harness.py — the loop
  • trajectory.jsonl — a few hundred teacher traces
  • to_training_data.py — trajectory JSONL → mlx-lm chat JSONL, with masking
  • A number: tool-call validity rate before and after tuning — your first proof that any of this works

Chapter 07 →