pranav-afk

Single-agent debugging is mostly a solved shape: see the prompt, see the tool call, see the output.

Multi-agent graphs are different. The pattern that keeps biting teams:

  1. Agent A hands off to agent B
  2. B calls a tool
  3. Result goes back to A
  4. A decides something based on it
  5. Three steps later the final answer is clearly wrong

The failure is usually not at step 5. The wrongness happened at the handoff (step 2). By the time you stare at the final output, you’re reconstructing the chain from logs by hand.

That is the multi-agent debugging tax.


Why handoffs break silently

In a single chain, one component owns the state story.

In a multi-agent run, state is often implicit:

  • A logs: “I passed the right thing.”
  • B logs: “I received something reasonable.”
  • Both look “correct” in isolation.
  • The gap between what A intended and what B actually operated on is where silent failures live.

If you only log each agent’s own outputs, that gap never shows up.


Three things that help (before perfect tooling)

1. Treat the handoff as a first-class event

Log more than “agent A finished” / “agent B started”:

  • decision to hand off (why)
  • payload on the wire
  • what the receiver was told
  • what the receiver could access (tools, memory scopes, permissions)

That last line matters. Payload can match while authority still diverges (B can’t read the memory A assumed it could).

2. Prefer step inspection over full re-run

Re-running the whole graph to debug is slow and dangerous when tools have side effects (email sent, ticket updated, money moved).

What you want first is: jump to the handoff step and inspect state there.

3. Detect divergence early (cheap)

A useful pattern from practice: snapshot at the boundary.

  • Sender snapshot: what A put on the wire
  • Receiver snapshot: what B bound as working state before its first tool/LLM call
  • Diff them

If they diverge, you catch it at step 2, not step 5. Cheaper than full replay: compare snapshots, don’t re-execute the graph.

Fork-from-node (test a different tool/policy from that state without replaying upstream) is the recovery half. Detection is the half most teams never build.


What this means for “agent observability”

Generic “show me LLM spans” helps single chains.

Multi-agent systems need boundary-aware ops:

  • nested / linked runs across agents
  • what memory was visible at a decision
  • what tools were authorized
  • cost and retries rolled up per logical task

That’s the direction we’re building toward with Cartha (SDK-first: traces, scoped memory, budgets, multi-agent nest). We’re still early on full fork-from-node and automatic handoff divergence probes — and we’re honest about that.

If you only take one idea away: log the handoff, not just the agents.


Questions for you

If you run multi-agent graphs (LangGraph or otherwise):

  1. Do you log handoffs as first-class events, or only per-agent I/O?
  2. When you “replay,” is it full re-run or step-level inspect?
  3. Have you built any check that sender payload == receiver interpreted state?

Curious what’s worked (or failed) for you in production.

Docs / try: cartha.in/how-to-use