Skip to main content
Available for: Python and TypeScript.

Installation

Usage

Wrap any ConversableAgent (or subclass) with wrap_autogen_agent. The wrapper patches generate_reply to trace every agent response.

With guardrails

Pass guardrails=True to run pre/post content checks on each agent reply.
For fine-grained control:
Wrap each agent individually. wrap_autogen_agent patches only the agent it receives — other agents in the conversation are not automatically traced.

Agent steps

Each agent span records zespan.agent.step (the number of replies that agent has generated so far), zespan.agent.max_steps (its max_consecutive_auto_reply, when it is a positive integer) and a stop reason: max_steps when the reply count reaches that limit, error when generating the reply failed. With the zespan-autogen middleware, the conversation span records the message count as the step and maps the team’s own stop text to done, max_steps, timeout, handoff or interrupted (no text, only that fixed value), and a handoff span records the target agent as its route. See Agent steps.