Different agents are good at different things. Multi-agent workflows fall apart when each one starts from zero. Statefulai makes the memory between them — so a handoff is a single line, not a 4 k token re-introduction.
Same ticket, three agents, one shared memory. Each turn reads from the memory the previous turn wrote.
StripeUsageClient.record(). Wrap in per-invoice lock; emit BillingFlushed on success. Drafted 3 files, 84 lines.
zod validation on Stripe response. Annotated diff with 1 blocking comment, 2 nits. Suggested fix is 6-line patch.
pnpm typecheck and pnpm test --filter billing. All green. Opened PR with the merged diff and a single-paragraph rationale citing ADR-014.
Three guarantees make multi-agent handoffs trustworthy.
Every agent action writes a structured event to episodic memory: who, what, when, files touched, decision rationale. The next agent reads the event, not the chat log.
Agent 2 retrieves with the same branch filter as Agent 1. Cross-branch leakage doesn't happen by accident — you have to opt in.
Every memory the agent uses is cited in its output. Humans (or other agents) can verify the chain of reasoning across the handoff.