Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
When one agent hands work to another, the hand-off payload is a context-engineering artifact. Pass too little and the next agent lacks what it needs; pass the entire history and you've recreated the shared-context blob. A clean hand-off is a deliberately-shaped briefing: the goal, the relevant findings, the decisions made, the open questions — not the raw transcript. Designing hand-off schemas is what makes agent pipelines composable, debuggable, and cheap. It's the multi-agent analogue of a good function signature.
The demo defines a typed hand-off payload that the upstream agent fills and the downstream agent consumes — a contract, not a transcript dump. The structure forces the upstream agent to distill rather than forward everything.
from dataclasses import dataclass, field
@dataclass
class HandOff:
goal: str
findings: list[str]
decisions: list[str]
open_questions: list[str]
# deliberately NO 'full_transcript' field — distill, don't forward
def research_agent(task) -> HandOff:
return HandOff(
goal=task,
findings=["Supply delay risk is high", "FX exposure is moderate"],
decisions=["Focus the report on supply chain"],
open_questions=["Is the FX hedge still active?"],
)
def writer_agent(h: HandOff) -> str:
qs = ("; ".join(h.open_questions)) or "none"
return f"GOAL: {h.goal}\nWRITE-UP based on: {h.findings}\nFlagging open: {qs}"
print(writer_agent(research_agent("Summarize Q2 risks")))python3 main.py