This is an early release preview. You may encounter bugs.
AG2 logo
Unclaimed

Tool coding

AG2

Open-source framework for building AI agents and orchestrating cooperation among multiple agents

A 82/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About AG2.

AG2 is a Python framework for building AI agents and coordinating several of them on a task. Its core building block is an Agent that talks to a model provider, calls tools, and returns a reply, and the framework is async throughout. Continuing from a reply keeps the same conversation and its history.

Tools are plain Python functions marked with a decorator, and AG2 runs the full tool-calling loop. A tool can pause a run to ask a person for confirmation or missing information, and a hook decides how that question is answered (a CLI prompt, a web UI, or a queue). When agents need to work together, a Network hub holds the registry, a write-ahead log, and the audit trail, and agents talk over typed channels: free-form conversation, strict one-question consulting, round-robin discussion, and declarative workflow graphs for conditional handoffs.

Optional harness primitives layer onto an agent: a knowledge store it can read and write across runs, compaction strategies that summarize dropped history instead of discarding it, and a working-memory policy that injects stored memory into the system prompt on every turn. Further concepts include structured output, middleware, observers, telemetry, evaluation, and testing. Model providers are selected through per-provider configs, with extras for OpenAI, Anthropic, Gemini, Ollama, and others.

Version 1.0 replaced the earlier AutoGen-derived API. That classic framework, with ConversableAgent, GroupChat, and swarms under the autogen namespace, now lives in a separate AG2 Classic repository and remains maintained, and 1.0 is not a drop-in upgrade from it.

  • Agents: a core Agent class that calls a model, runs tools, and continues conversations with history
  • Tools: decorated Python functions with the tool-calling loop handled by the framework
  • Human in the loop: tools can pause a run to collect approval or input through a configurable hook
  • Multi-agent Network: a hub with registry, write-ahead log, and audit trail, connecting agents over typed channels
  • Channel types: conversation, consulting, round-robin discussion, and workflow graphs for conditional handoffs
  • Knowledge and compaction: persistent knowledge stores, summarizing history compaction, and working-memory injection
  • Advanced patterns: structured output, middleware, observers, telemetry, evaluation, and testing
  • Provider configs: OpenAI, Anthropic, Gemini, Ollama, and other model providers
  • AG2 Classic: the earlier AutoGen-style API kept in a separate maintained repository

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with AG2.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get AG2 →

Browse the catalog