Skip to content

How to trace and monitor multi-agent systems

To trace multi-agent systems, send traces for each agent in a shared session so you can see every step, handoff and failure across all agents. PRISM groups these traces by session ID and shows you every step, handoff and failure across all agents.

By Arun Prasad · Published · Last updated

On this page

Why multi-agent systems matter

You need to monitor the whole run, not just each agent, because a task can fail even when every step passes. Standard monitoring shows that the request went through, not whether the answer was right.

A multi-agent run can pass at every agent and still fail at a handoff. AI agents don't fail like normal software: a tool can return a 200 and the task can still fail.

Here is a hypothetical case. A triage agent hands a refund request to a billing agent. The billing agent calls its refund tool and gets a 200 back. But the triage agent passed along the wrong order, so the customer's actual goal was never met. Every step looks healthy. Only the final outcome, checked against what the user wanted, shows the failure.

This pattern is a known problem in multi-agent system design: each individual step can succeed while the overall task fails.

Step 1: Decide whether you need more than one agent

Use several agents only when one agent with several tools can't do the job. More agents mean more handoffs, more context to track, and more places to fail.

This step also answers "How do multiagent systems work?" in practice. A request comes in. One agent handles part of it, using its own tools or instructions. It then passes its result, and whatever state the next agent needs, onward. Another agent continues until the task is done. Each pass is a handoff. Each handoff is a place where information can be dropped or misread.

Two questions help you decide:

  • Can one agent hold all the tools and instructions without getting confused? If yes, start there. You will have fewer handoffs to trace.
  • Does the work mostly read or mostly write? Agents that change things (send emails, issue refunds, update records) need more care than agents that only gather information, because a misstep in a write operation is harder to undo.

Step 2: Map the agents, roles and handoffs

Create a table that lists each agent, its role, the tools it has, and what it must pass to the next agent. This contract is what you'll verify in steps 3 and 4.

You need to know your system's topology before you trace it. The handoffs are what you will trace later, so mapping them first tells you where failures are most likely to occur.

A simple table is enough. This one is a hypothetical support app:

AgentRoleToolsPasses on
TriageReads the request and picks a specialistNoneIntent, customer ID, order ID
BillingHandles payment questionsRefund tool, order lookupOutcome, what it changed
SummaryWrites the final replyNoneFinal answer

Two plain topology names cover many setups:

  • Router with specialists: one agent decides which specialist should handle each request.
  • Chain: each agent's output becomes the next agent's input.

Real systems often mix these. For each handoff, write down exactly what the receiving agent must have to do its job, that list becomes the contract you check in Steps 3 and 4.

Step 3: Trace every agent run and handoff

Send traces for every agent in a multi-agent task and keep them in one session using a shared session_id, so the entire task appears together in PRISM. Connected traces are how you attribute a failure to a specific agent or handoff rather than guessing which part of the system broke.

PRISM by Block Convey's Agent Observability has four connected views:

  • Traces: per-run request, response, model, cost, timing and scores.
  • Sessions: the multi-turn journey and drift.
  • Agent Runs: steps, tool calls, retries, handoffs and state.
  • Scores & Alerts.

What you see depends on what your integration sends. Agent steps and handoffs appear when your integration sends them.

Two setup details matter for multi-agent apps:

  • Sessions: traces that share a session_id form one conversation. You can't backfill this later, so set it from the first request.
  • OpenTelemetry: turns are grouped only from attributes you declare (gen_ai.conversation.id, session.id or prismtrace.session_id). PRISM does not infer sessions.

For frameworks, PRISM supports LangChain (PRISMtraceCallbackHandler), LangGraph (wrap_langgraph), LiteLLM, Google ADK (PRISMtraceADKAdapter, labeled Beta in the SDK) and the OpenAI Agents SDK (labeled Preview in the SDK). If your stack isn't on that list, use the Python SDK, the HTTP API or OpenTelemetry.

Step 4: Score outcomes against the user's goal

Create evaluator rules that judge whether the user got what they came for, not whether each agent succeeded. Use both deterministic rules (same result every time, no model) and an LLM judge (reads the exchange). Scoring at the system level is what shows whether the user got what they came for, not just whether each agent returned a result.

It helps to score at three levels:

  • Agent: did this agent do its own job?
  • Handoff: did the next agent get what it needed?
  • System: did the user get what they came for?

PRISM's Evaluators come in two kinds:

  • Deterministic rules give the same verdict for the same input, use no model, and run on 100% of sessions.
  • LLM-as-judge rules have a model read the exchange.

The LLM judge scores every incoming trace until the plan's daily allowance runs out. After that, only the deterministic rules run until the allowance resets at 00:00 UTC. Each verdict links to the rule, the span, the source checked and the reason, so you can see why a run was marked down.

Core scores are on the Free plan. Custom evaluators and the Evaluators Hub need Builder or above (paid plans from $20/month).

Step 5: Find repeated failures and turn them into tests

Look for patterns in your failures using PRISM's grouping and root-cause analysis, then write tests from the failing scenarios so they don't happen again. One failure is an anecdote; a pattern shared by many sessions tells you what to fix first.

PRISM's Agent Observability groups repeated failures into patterns and shows how many sessions share each one. AI Remediation traces a failure to a likely cause: prompt, missing source, retrieval, stale state, tool choice, parameter, guardrail or workflow step.

After a fix is merged, PRISM compares pass rates for the 7 days before and the 7 days after the merge. People review and merge changes.

Synthetic Scenarios can help here. You describe your app, and PRISM writes simulated users from that description and your Knowledge Base. A failing scenario becomes a regression test.

How this looks in production

In production, PRISM's Agent Runs view shows every step, tool call, retry and handoff across all the agents in a task. Each agent's model exchange arrives as its own trace; a shared session_id ties them into one conversation you can read from start to finish. The Sessions view shows the full multi-turn journey and any drift across turns. Scores appear alongside each trace, so you can see which agent or handoff caused a system-level failure without reading every exchange manually.

The HTTP API sends one request per exchange to POST /api/traces, authenticated with the X-PRISMtrace-Key header. Keys look like pt-sk-... and are shown once.

Example:

Example · text
# Example: send one agent's exchange as a trace
curl -X POST https://api.prism.blockconvey.com/api/traces \
  -H "X-PRISMtrace-Key: pt-sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "model": "the-model-this-agent-called",
    "input_messages": [{"role": "user", "content": "I need a refund for order 1234."}],
    "output_message": "I have processed your refund request for order 1234.",
    "latency_ms": 1240,
    "session_id": "task-abc-123"
  }'

The message in input_messages and output_message are sample values. Replace them with your own.

What each field means:

  • project_id: the PRISM project the trace belongs to.
  • model: the model that agent called for this exchange.
  • input_messages and output_message: what went into the agent and what it returned. input_messages is an array of objects with role and content; output_message is a string.
  • latency_ms: how long the exchange took.
  • session_id: the shared identifier that groups every agent's trace into one task. Include the same value on every trace from one task, the triage, billing and summary exchanges from Step 2 all carry it, so they appear together in Agent Runs and Sessions.

These fields are required (session_id is strongly recommended and must be set from the first request; it cannot be backfilled). If you use the Python SDK instead, install it with pip install "prismtrace-sdk>=0.5.1" and import prismtrace. The SDK is Python only. Other languages use the HTTP endpoint or OpenTelemetry (endpoint /api/otlp, over http/protobuf or http/json).

Common mistakes

Most mistakes come from checking the parts and not the whole run.

  • Judging only each agent's output. Every agent can look fine while the final answer misses the user's goal. Fix: use PRISM's Evaluators to score the system outcome (not just each agent's output), as described in Step 4.
  • Ignoring handoffs. The state one agent passes to the next is where context gets lost. Fix: write down what each handoff must carry (Step 2) and check that it arrives.
  • Not sharing a session ID across agents. Traces that don't share a session_id don't form one conversation, and you can't backfill it. Fix: set the same session_id on every trace from the first request.
  • Treating a 200 status as success. A tool can return a 200 and the task can still fail. Fix: judge the outcome against the user's goal, not the status code.
  • Calling a change an improvement after one run. Agents can take different paths on the same input. Fix: run the same scenario more than once and compare the results before you treat a change as confirmed.

How do I know which agent in my system caused a failure? Group traces by session_id so the whole task is visible in one place. PRISM's Agent Runs view shows every step, tool call, retry and handoff in order. Combine that with Evaluator scores on each span to pinpoint which agent or handoff produced a wrong or incomplete result.

How do I test agent behavior before shipping to production? Synthetic Scenarios lets you describe your app and generates simulated users from that description and your Knowledge Base. A failing scenario becomes a regression test you can run before each release.

Find where your agents hand off and fail

Connect your multi-agent app and follow each task from the first message to the final answer.

Free to start, 100 credits each month.