ag2ai

69 mods across 5 repositories, 4.9k stars between them.

ag2-add-custom-tool

25

ag2ai/ag2-skills

Skill Claude CodeCodex

Add a custom Python tool to an AG2 Agent using the @tool decorator. Use when the user wants to give an Agent a new capability backed by Python code (API calls, DB queries, computations, file ops). Covers sync and async tools, parameter typing, Pydantic schema customisation, returning typed Input / ToolResult (text /…

10 1mo ago A 116 tokens original Apache-2.0

ag2-ag-ui

26

ag2ai/ag2-skills

Skill Claude CodeCodex

Expose an AG2 Agent over the AG-UI protocol so a frontend (CopilotKit, custom React/Next.js, or any AG-UI client) can stream responses (text and reasoning), render tool calls, sync shared state, and track sub-task steps. Wraps the agent with AGUIStream(agent) and mounts it in FastAPI via stream.dispatch(...) or…

10 1mo ago A 114 tokens original Apache-2.0

ag2-eval-comparison

27

ag2ai/ag2-skills

Skill Claude CodeCodex

Compare AG2 agents, models, or prompts to decide which is better. runvariants scores several named agents on one suite and ranks them on a leaderboard (Variants holds a mapping of named Agent instances plus an axis label). runpairwise with pairwisejudge does head-to-head LLM comparison using a dual-order position swap…

10 1mo ago A 190 tokens original Apache-2.0

ag2-evaluation

28

ag2ai/ag2-skills

Skill Claude CodeCodex

Evaluate, test, and track an AG2 Agent offline. Build a Suite of tasks, run the agent with runagent, and grade answers with prebuilt scorers (finalanswermatches, toolcalled, notoolerrors, tokenbudget) or a custom @scorer — including the agentjudge LLM judge. Read the RunResult scorecard (passrate, scorestats…

10 1mo ago A 173 tokens original Apache-2.0

ag2-hitl

29

ag2ai/ag2-skills

Skill Claude CodeCodex

Pause an AG2 Agent mid-run to collect human input via context.input(), or gate a tool call with approvalrequired() middleware. Use when the user wants the agent to ask for confirmation, request missing info (passwords, API keys, data), or have a human approve sensitive / irreversible / expensive tool calls (sending…

10 1mo ago A 81 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Persist agent state across runs, shape what the LLM sees per turn, and cap history to fit a context window. Covers KnowledgeStore (memory / sqlite / disk / redis), KnowledgeConfig (store=, exposetool=, writeeventlog=, compact=, aggregate=, bootstrap=) and its opt-out flags, aggregation strategies…

10 1mo ago A 193 tokens original Apache-2.0

ag2-live

31

ag2ai/ag2-skills

Skill Claude CodeCodex

Build realtime voice / live audio agents with AG2's ag2.live module. Wrap a prompt + provider config in LiveAgent and open a bidirectional voice session with agent.run(), pumping mic audio in and playing synthesized speech out. Covers the two realtime providers — Gemini Live (GeminiRealTimeConfig) and OpenAI Realtime…

10 1mo ago A 208 tokens original Apache-2.0

ag2-mcp

32

ag2ai/ag2-skills

Skill Claude CodeCodex

Host an MCP server that exposes an AG2 Agent (plus prompts and resources) to MCP clients like Claude Desktop, Cursor, or the MCP Inspector. Wrap the agent with MCPServer(agent) — it surfaces Agent.ask() as a single conversational tool and serves over stdio (runstdio()) or streamable HTTP (it is itself an ASGI app for…

10 1mo ago A 209 tokens original Apache-2.0

ag2-middleware

33

ag2ai/ag2-skills

Skill Claude CodeCodex

Intercept the AG2 agent loop with BaseMiddleware — wrap full turns (onturn), each LLM call (onllmcall), each tool execution (ontoolexecution), or each human-input request (onhumaninput). Use for retry, logging, history trimming, request mutation, tool auditing, guardrails, or rate limiting. Built-ins…

10 1mo ago A 128 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Send images, audio, video, or documents into an AG2 Agent alongside text. Pass ImageInput, AudioInput, VideoInput, or DocumentInput as positional args to agent.ask(...). Use when the user wants the agent to process non-text input — describe a photo, transcribe audio, summarise a PDF, analyse a video. Covers…

10 1mo ago A 138 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Open an AG2 network discussion channel — N-party (2+) round-robin where each participant speaks in fixed order, cycling until explicit close or TTL. Use when the user wants a brainstorm with a fixed cast, a panel discussion, or round-robin reviewers. Covers agentclient.open(type="discussion", target=[...]…

10 1mo ago A 194 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Govern an AG2 multi-agent network — identity (Passport, Resume), per-agent Rule with two top-level blocks access (AccessBlock) and limits (LimitsBlock, which nests RateBlock + InboxBlock), the swappable HubArbiter / RuleBasedArbiter access-&-routing seam, AuthAdapter / AuthRegistry registration, channel-level…

10 1mo ago A 264 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Build a multi-agent AG2 network — load this whenever two or more Agents need to interact. The network is the standard multi-agent pattern in ag2. Covers Hub.open, LocalLink, HubClient.register, Passport, Resume, channel lifecycle (PENDING → ACTIVE → CLOSING → CLOSED), the two 2-party channel adapters (consulting for…

10 1mo ago A 206 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Shape what an AG2 network agent perceives and which actions its LLM can take. Covers the five auto-injected LLM-facing tools that ship via NetworkPlugin (delegate, peers, channels, tasks, context) plus the adapter-owned say; replacing the default handler with agentclient.onenvelope(callback) (gateways, headless…

10 1mo ago A 274 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Build an AG2 network workflow channel — the orchestrated N-party adapter driven by a declarative TransitionGraph. Use when the user needs conditional handoffs, multi-step pipelines, context-aware routing, feedback loops, or is migrating from the classic GroupChat + Agent.handoffs pattern. Covers TransitionGraph…

10 1mo ago A 222 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Monitor an AG2 agent's stream — log events, detect repeated tool calls, track token spend, build trigger-driven observers, route observer alerts to the model, and halt on FATAL conditions. Covers @observer(...) (stateless), BaseObserver (stateful), built-ins (TokenMonitor, LoopDetector), Watch primitives (EventWatch…

10 1mo ago A 160 tokens original Apache-2.0

ag2-overview

41

ag2ai/ag2-skills

Skill Claude CodeCodex

Map of AG2 capabilities and which sibling skill to reach for. Load first when the user mentions building with AG2 (ag2) but the specific feature isn't yet clear — agents, tools, model config, delegation, memory, observers, structured output, HITL, AG-UI, MCP server hosting, A2A protocol, realtime voice, telemetry…

10 1mo ago A 82 tokens original Apache-2.0

ag2-quickstart

42

ag2ai/ag2-skills

Skill Claude CodeCodex

Build a minimal AG2 Agent end to end — pick a model provider, set a prompt, call agent.ask(), then continue the conversation with reply.ask() (multi-turn). Use when the user is starting a new AG2 project, has no working Agent yet, or needs the multi-turn chaining pattern. Covers OpenAIConfig, AnthropicConfig…

10 1mo ago A 106 tokens original Apache-2.0

ag2-shell-tool

43

ag2ai/ag2-skills

Skill Claude CodeCodex

Give an AG2 Agent the ability to run shell commands. Covers SandboxShellTool (client-side subprocess via LocalEnvironment, works with any provider) and the provider-native ShellTool (OpenAI Responses execution). Use when the user wants the Agent to execute commands, build/test code, manage files, or operate on a…

10 1mo ago C 99 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Get a typed Python value back from an AG2 Agent instead of free text. Pass responseschema= (a Pydantic model, dataclass, primitive, union, ResponseSchema, or @responseschema validator) and read the parsed result via await reply.content(). Use when the user wants validated structured output, classification, extraction…

10 1mo ago A 117 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Single-agent recursion and parallel fan-out within one AG2 Agent — auto-injected runsubtask / runsubtasks(parallel=True) (opt in via tasks=TaskConfig(...)) for self-delegation, and Agent.astool() as a lightweight no-hub way to call one named agent from inside another. Use when a single coordinator wants to break work…

10 1mo ago A 173 tokens original Apache-2.0

ag2-telemetry

46

ag2ai/ag2-skills

Skill Claude CodeCodex

Add OpenTelemetry traces to an AG2 Agent via TelemetryMiddleware (ag2.middleware.builtin). Emits spans for the full turn, each LLM call, each tool execution, and each human-input request, following the OpenTelemetry GenAI semantic conventions. Compatible with any OTLP backend — Jaeger, Grafana Tempo, Datadog…

10 1mo ago A 113 tokens original Apache-2.0

ag2-testing

47

ag2ai/ag2-skills

Skill Claude CodeCodex

Test AG2 agents and tools without hitting a real LLM provider. Pass TestConfig(...) from ag2.testing as the agent's config (or per-ask) to mock LLM responses, inject ToolCallEvents to simulate tool execution, and assert success / error paths. Use when the user is writing pytest tests for an Agent or Tool.

10 1mo ago A 80 tokens original Apache-2.0

ag2ai/ag2-skills

Skill Claude CodeCodex

Wire AG2's shipped tools into an Agent — both provider-native server-side tools (web search, web fetch, code execution, MCP, image generation, memory) and locally-executed common toolkits (filesystem, DuckDuckGo, Exa, Tavily, skills). Use when the user wants capabilities AG2 already ships rather than writing custom…

10 1mo ago A 103 tokens original Apache-2.0