Skip to main content

charm-adapter-ag2

charm-adapter-ag2 is the AG2 multi-agent adapter for the Charm agent framework. AG2 (formerly AutoGen's multi-agent runtime) orchestrates conversational agents that exchange messages in a group; this adapter exposes that runtime to Charm as a first-class backend, so a Charm application can spawn, route, and observe AG2 group chats with the same typed primitives it uses for any other executor. It is for teams already on Charm who want AG2's round-robin / selector patterns without writing glue code, and for AG2 users who want Charm's scheduling, tracing, and policy layer on top.

Features

  • Maps AG2 GroupChat, AssistantAgent, and UserProxyAgent to Charm's Executor/Agent interfaces with full message-flow tracing.
  • Supports both round_robin and auto (LLM-based speaker selection) group-chat modes; selection prompts are surfaced through Charm's observability hooks.
  • Two-way streaming: AG2 messages flow into Charm streams and Charm control events (pause, cancel, redirect) propagate back into the AG2 run.
  • Built-in compatibility shim pins against tested AG2 versions so adapter upgrades and AG2 upgrades are released in lockstep.
  • Async-native; integrates with Charm's @charm.task decorators and Runtime.submit(...) API.

Installation

pip install charm-adapter-ag2
# pulls in charm-core and a pinned ag2 release
pip install "charm-adapter-ag2[openai]"   # adds the OpenAI client AG2 uses by default

Quick start

import charm
from charm_adapter_ag2 import AG2GroupChat, AG2Assistant

with charm.Runtime("charm.yaml") as rt:
    planner = AG2Assistant("planner", system_prompt="Break the task into steps.")
    coder   = AG2Assistant("coder",   system_prompt="Write the code.")
    chat = AG2GroupChat([planner, coder], mode="round_robin")

    result = rt.submit(chat, message="Build a fizzbuzz CLI in Python.")
    print(result.final_message)

API

  • AG2Assistant(name, *, system_prompt, llm_config=None) — a Charm Agent backed by an AG2 AssistantAgent.
  • AG2GroupChat(agents, *, mode="round_robin"|"auto", max_turns=12) — a Charm Executor that runs an AG2 group chat.
  • from charm_adapter_ag2 import AG2_VERSION — the pinned AG2 version string.

Configuration

charm.yaml accepts an ag2: section for default llm_config, timeout, and tracing level. Environment variables AG2_MODEL and AG2_API_KEY are forwarded to AG2's config when llm_config is omitted.

License

MIT

Metadata

Release files for charm-adapter-ag2 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charm-adapter-ag2 0.1.0
File Size Uploaded Provenance Actions
charm_adapter_ag2-0.1.0.tar.gz 6.5 kB Without provenance Details for charm_adapter_ag2-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for charm-adapter-ag2 0.1.0
File Interpreter ABI Platform Actions
charm_adapter_ag2-0.1.0-py3-none-any.whl Python 3 none any Details for charm_adapter_ag2-0.1.0-py3-none-any.whl

Total release size: 14.0 kB

Release files / charm_adapter_ag2-0.1.0.tar.gz

Download URL charm_adapter_ag2-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
276b0847b16f029708b03bfb89fd3447a46d8681fe35e4c0f5ef2c21b9d71432
BLAKE2b-256 checksum
How to use checksums
12be15d3a0086ed1879b86730eb9fa5837c32a05a7851ae6ffd7b6720a79781f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / charm_adapter_ag2-0.1.0-py3-none-any.whl

Download URL charm_adapter_ag2-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfaeacabb4d5c4a2d5f83644f5dbf1ffb8b50ce71e07aa57590bc41ea91797ba
BLAKE2b-256 checksum
How to use checksums
a977973112dd44d0eb4545ea687336bd4c750e9349e174b499a5f9e3fd92563c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for charm-adapter-ag2 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page