Skip to main content
AG2 is an agent framework built on the autogen API. The AG2Instrumentor captures ConversableAgent chats, replies, and tool execution as OpenInference AGENT and TOOL spans in Arize AX.

Prerequisites

  • Python 3.10+
  • An Arize AX account (sign up)
This guide uses AG2’s offline multi-agent and tool-call pattern, so it does not need an LLM provider key.

Launch Arize AX

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Configure credentials

Setup tracing

AG2 instrumentation supports the AG2 0.14.x autogen API. AG2 v1 uses a different middleware API and is not yet supported.

Run AG2

Expected output

Verify in Arize AX

  1. Open your Arize AX space and select project ag2-tracing-example.
  2. You should see a new trace within ~30 seconds with AGENT spans for the chat and reply, plus a TOOL span named get_weather.
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize AX. Call AG2Instrumentor().instrument(...) before starting a chat.
  • Import or instrumentation error. Install an AG2 0.14.x release; AG2 v1 is not supported by this instrumentor.
  • The example asks for an LLM key. Keep both agents’ llm_config=False; this offline example runs a local tool instead of calling a model.

Resources

OpenInference AG2 Instrumentor

AG2 repository