Skip to content

Multi-Agent#

Jump into the AG2 Playground

AG2 Playground

Time for our AG2 agents to let their robotic hair down and have some fun. Jump in with agent orchestrations in the AG2 Playground: watch the flow between agents as they work, execute tools, and hand off to one another.

What's Inside

Interactive demos covering orchestration patterns and integrations. Pick one, select or type a prompt, hit Run, and watch agents light up as they think, stream responses, and coordinate in real time.

Want to do something similar, grab the code snippets on the Code tab for each demo or see the links to the topic in our documentation.

No account required, jump into playground.ag2.ai.

Intelligent Agent Handoffs: Routing Control in Multi-Agent Systems with AG2

Intelligent Agent Handoffs

A customer messages your support system: "My laptop keeps shutting down randomly." The triage agent routes it to technical support. So far, so good. But the tech agent doesn't know whether this is a hardware or software issue, doesn't check the customer's account tier, and when it can't solve the problem, it hallucinates an answer instead of escalating. The customer leaves frustrated. The agent never knew it was supposed to hand off.

This is the handoff problem. And it's harder than it looks.

Deep Web Research with AG2 and GPT Researcher

GPT Researcher x AG2

Ask an LLM to research a topic and write a report. It'll produce something -- sometimes quite good. But probe the sources, check the claims, or ask for substantial revisions and the limitations show up fast. The agent that searched the web is also the one drawing conclusions from it. There's no review step between research and writing. Errors and gaps pass straight through to the final document.

The fix isn't a better prompt. It's division of labor.

GPT Researcher, created by Assaf Elovic, is built on this idea: specialized agents, each with a distinct job, working through a staged pipeline. A researcher gathers, an editor outlines, a reviewer challenges the findings, a revisor incorporates the feedback, and a writer only touches finalized content. Every handoff is a quality check.

This post walks through the build-with-ag2 example, which runs the full pipeline with AG2 as the orchestration layer. The example ships with two run modes -- a terminal script and a web UI built on AG-UI that shows pipeline progress in real time and includes a human-in-the-loop review step before writing begins.

AG2 OpenTelemetry Tracing: Full Observability for Multi-Agent Systems

AG2 OpenTelemetry Tracing

Multi-agent systems are powerful -- but when something goes wrong, figuring out where and why is painful. Which agent made the bad decision? Was the LLM call slow, or did the tool fail? How many tokens did that group chat actually use?

AG2 now has built-in OpenTelemetry tracing that gives you full visibility into your multi-agent workflows. Every conversation, agent turn, LLM call, tool execution, and speaker selection is captured as a structured span -- connected by a shared trace ID and exportable to any OpenTelemetry-compatible backend.

Key highlights:

  • Four simple API functions to instrument agents, LLM calls, group chats, and A2A servers
  • Hierarchical traces that mirror how agents process conversations
  • Distributed tracing across services using W3C Trace Context propagation
  • Works with any backend -- Jaeger, Grafana Tempo, Datadog, Honeycomb, Langfuse, and more
  • Follows OpenTelemetry GenAI Semantic Conventions for standard interoperability