feat(ag2): add AG2 framework integration with Amazon Bedrock AgentCore#1154
Open
faridun-ag2 wants to merge 1 commit intoawslabs:mainfrom
Open
feat(ag2): add AG2 framework integration with Amazon Bedrock AgentCore#1154faridun-ag2 wants to merge 1 commit intoawslabs:mainfrom
faridun-ag2 wants to merge 1 commit intoawslabs:mainfrom
Conversation
- 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
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:
Happy to address any feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
03-integrations/agentic-frameworks/ag2/LLMConfig(api_type="bedrock")), no OpenAI API key required — AWS credentials from IAM role or environment are sufficientChanges
ag2_agent_hello_world.py— singleAssistantAgentbacked by Claude 3 Sonnet on Bedrock, with a weather tool registered via AG2's@register_for_llm/@register_for_executiondecorator patternag2_multi_agent_example.py— two-agentGroupChatworkflow:researchergathers information using a tool,analystsynthesizes findings into a structured summaryrequirements.txt—ag2[bedrock]>=0.11.0,bedrock-agentcore,bedrock-agentcore-starter-toolkitREADME.md— setup guide, code walkthrough, AG2 vs Microsoft AutoGen comparison tableNotes
AG2 (
ag2on 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
pytest test_ag2_agents.py -vag2_agent_hello_world.pytested locally with real Bedrock credentialsag2_multi_agent_example.pytested locally with real Bedrock credentialsagentcore invoke -l '{"prompt": "what is the weather in NYC?"}'returns{"result": "..."}