AssistantAgent and a UserProxyAgent enter a reasoning loop, or two specialized agents repeatedly miscommunicate on task handoffs, you need visibility at the conversation level — not just per-model. Agent Therapy is purpose-built to detect inter-agent miscommunication, coordination loops, role confusion, and termination failures in AutoGen workflows, and to score each participating agent’s behavior independently within the same session.
Prerequisites
Before you begin, make sure you have the following:- AutoGen installed in your Python environment (
pip install pyautogen) - An Agent Therapy account with an active API key — find yours in the Agent Therapy dashboard
- The
requestslibrary installed (pip install requests)
Registering Each Agent
In multi-agent setups, register each participant agent separately in Agent Therapy so that the health dashboard can attribute behavioral findings to the correct agent. For example, if your workflow uses anAssistantAgent and a UserProxyAgent, create two Agent Therapy agent records and capture the agent_id for each.
agent_id values — you’ll reference them every time you submit a session for this workflow.
Capturing AutoGen Chat History
After a conversation ends, extract the message history from yourGroupChat object or from a direct two-agent conversation. AutoGen stores each message as a dictionary with at minimum a role and content key.
GroupChat), use user_proxy.chat_messages[assistant] to retrieve the message list in the same dictionary format.
Submitting Multi-Agent Sessions
When submitting a session that involves multiple agents, include theparticipants field in your request body. This tells Agent Therapy which registered agents were active in the conversation so it can score each one separately.
participants list accepts any number of agent_id strings. Agent Therapy uses the name field in each agent’s registry entry to attribute turns in the log — make sure the AutoGen agent name values match or are noted in the context field if they differ.
Retrieving Session Results
After submitting a session, pollGET /sessions/{id} until the status field shows "completed". The response includes the full transcript, behavioral findings, and individual health scores for each participant.
Multi-Agent Health Dashboard
Once sessions are submitted with multipleparticipants, the Agent Therapy dashboard displays a Workflow View for that agent group. In this view:
- Each participating agent gets its own health score trend graph plotted over time
- Behavioral findings are tagged to the specific agent whose turns triggered them
- Coordination metrics appear at the workflow level, measuring things like turn balance, escalation frequency, and loop detection across the full conversation
- You can filter the session list by any individual participant to drill into one agent’s behavior in isolation
UserProxyAgent turns are treated as user input: Because
UserProxyAgent represents a human operator in AutoGen’s design, Agent Therapy treats its turns as user role messages rather than assistant role messages. This means UserProxyAgent turns are not included in the assistant-side behavioral scoring. If your UserProxyAgent is making autonomous LLM-backed decisions (i.e., human_input_mode="NEVER" with an LLM config), set "user_proxy_is_autonomous": true in your session metadata so Agent Therapy scores those turns as agent output instead.