Skip to content

feat(ag2): add AG2 framework integration with Amazon Bedrock AgentCore#1154

Open
faridun-ag2 wants to merge 1 commit intoawslabs:mainfrom
faridun-ag2:feat/ag2-integration-example
Open

feat(ag2): add AG2 framework integration with Amazon Bedrock AgentCore#1154
faridun-ag2 wants to merge 1 commit intoawslabs:mainfrom
faridun-ag2:feat/ag2-integration-example

Conversation

@faridun-ag2
Copy link
Copy Markdown

Summary

  • Adds AG2 (formerly AutoGen) as a new agentic framework integration under 03-integrations/agentic-frameworks/ag2/
  • AG2 has native Amazon Bedrock support (LLMConfig(api_type="bedrock")), no OpenAI API key required — AWS credentials from IAM role or environment are sufficient
  • Two examples included: single-agent tool use and multi-agent GroupChat workflow

Changes

  • ag2_agent_hello_world.py — single AssistantAgent backed by Claude 3 Sonnet on Bedrock, with a weather tool registered via AG2's @register_for_llm / @register_for_execution decorator pattern
  • ag2_multi_agent_example.py — two-agent GroupChat workflow: researcher gathers information using a tool, analyst synthesizes findings into a structured summary
  • requirements.txtag2[bedrock]>=0.11.0, bedrock-agentcore, bedrock-agentcore-starter-toolkit
  • README.md — setup guide, code walkthrough, AG2 vs Microsoft AutoGen comparison table

Notes

AG2 (ag2 on PyPI) and Microsoft AutoGen (autogen-agentchat) are separate projects with incompatible APIs. This example uses AG2 imports (from autogen.agentchat import AssistantAgent), not Microsoft AutoGen imports (from autogen_agentchat.agents import AssistantAgent).

Test plan

  • 24 unit/integration tests pass locally without AWS credentials: pytest test_ag2_agents.py -v
  • ag2_agent_hello_world.py tested locally with real Bedrock credentials
  • ag2_multi_agent_example.py tested locally with real Bedrock credentials
  • agentcore invoke -l '{"prompt": "what is the weather in NYC?"}' returns {"result": "..."}

- ag2_agent_hello_world.py: single-agent weather example using AG2's
  native Bedrock support (LLMConfig api_type="bedrock"), no OpenAI key needed
- ag2_multi_agent_example.py: two-agent GroupChat workflow (researcher +
  analyst) demonstrating AG2's multi-agent orchestration
- requirements.txt: ag2[bedrock]>=0.11.0 + bedrock-agentcore dependencies
- README.md: setup guide, code walkthrough, AG2 vs MS AutoGen comparison
- test_ag2_agents.py: 24 unit/integration tests, all passing, no AWS required
@github-actions github-actions bot added 03-integrations 03-integrations agentic-frameworks 03-integrations/agentic-frameworks labels Mar 20, 2026
@faridun-ag2
Copy link
Copy Markdown
Author

Hey @manuwaik !

We'd love to get your eyes on this PR when you have a moment.

This adds an AG2 integration example — AG2 (https://github.com/ag2ai/ag2) has native Amazon Bedrock support built in, which makes it a natural fit for AWS-native deployments. No OpenAI API key required — just IAM credentials.

Two examples included:

  • ag2_agent_hello_world.py — single agent with tool use, mirrors the existing autogen/ example structure
  • ag2_multi_agent_example.py — multi-agent GroupChat workflow (researcher + analyst), showcasing AG2's orchestration capabilities

Happy to address any feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

03-integrations 03-integrations agentic-frameworks 03-integrations/agentic-frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant