The final code lesson. Compose week-4 primitives:
The input: 2 short queries. The output: a Tasks entry per run with version, call count, and pass/fail.
run = AgentRun(version="answer_v2")
for query in queries:
run.handle(query)
run.persist_to_tasks() # one Task per runMinimal generic input. Same shape as production: queries in, observability + side-effect-logged trace out.
This is week 4 in 50 lines.
That's the point. Each primitive is small. Composing them gives you a real, observable, production-shaped agent. Tomorrow: quiz. Day after: graduation.
A tiny agent that:
Production shape, minimal code. The same skeleton is what real agent products run — just bigger registries, longer traces, more sophisticated tools. The primitives are identical.
id returned by CREATE_TASK is your run id; you can later read it back to confirm the run loggedtitle field carries a 1-line summary; notes (optional) carries the full trace JSONIn a real product you'd persist to a database. The write primitive is the same — append a row keyed by run id. Tasks is the simplest possible such side effect.
Inputs (queries)
↓
┌─── PromptRegistry.render("answer", v=2) ──────┐
│ │
↓ │
tracked_call Trace.record │
↓ ↑ │
Agent.run_sync │ │
↓ │ │
answer ←──── (loop over queries) ┘ │
↓ │
Trace.summary() → Composio Tasks.append ────────┘
Week 4 is observability and shipping. That's what this exercises.
The final code lesson. Compose week-4 primitives:
The input: 2 short queries. The output: a Tasks entry per run with version, call count, and pass/fail.
run = AgentRun(version="answer_v2")
for query in queries:
run.handle(query)
run.persist_to_tasks() # one Task per runMinimal generic input. Same shape as production: queries in, observability + side-effect-logged trace out.
This is week 4 in 50 lines.
That's the point. Each primitive is small. Composing them gives you a real, observable, production-shaped agent. Tomorrow: quiz. Day after: graduation.
A tiny agent that:
Production shape, minimal code. The same skeleton is what real agent products run — just bigger registries, longer traces, more sophisticated tools. The primitives are identical.
id returned by CREATE_TASK is your run id; you can later read it back to confirm the run loggedtitle field carries a 1-line summary; notes (optional) carries the full trace JSONIn a real product you'd persist to a database. The write primitive is the same — append a row keyed by run id. Tasks is the simplest possible such side effect.
Inputs (queries)
↓
┌─── PromptRegistry.render("answer", v=2) ──────┐
│ │
↓ │
tracked_call Trace.record │
↓ ↑ │
Agent.run_sync │ │
↓ │ │
answer ←──── (loop over queries) ┘ │
↓ │
Trace.summary() → Composio Tasks.append ────────┘
Week 4 is observability and shipping. That's what this exercises.
Create a free account to get started. Paid plans unlock all tracks.