feat(py#strands-agent): add AG-UI protocol support with CopilotKit React connection#543
Open
nx-plugin-for-aws wants to merge 12 commits intomainfrom
Open
feat(py#strands-agent): add AG-UI protocol support with CopilotKit React connection#543nx-plugin-for-aws wants to merge 12 commits intomainfrom
nx-plugin-for-aws wants to merge 12 commits intomainfrom
Conversation
Add a `protocol` option to the ts#strands-agent and py#strands-agent generators, allowing users to choose between HTTP (default) and A2A (Agent-to-Agent) protocol for their Strands Agents. - Add `protocol` enum (HTTP/A2A) to both generator schemas - Pass protocol through to CDK/Terraform infrastructure (ProtocolType) - Include protocol in component metadata for downstream consumption - Vend A2AExpressServer (TS) and A2AServer (Python) code for A2A agents - Update @strands-agents/sdk to 1.0.0-rc.1 for A2A support - Update strands-agents-tools to 0.3.0 - Update documentation for both TS and Python agent guides Closes #323
- Reorganize templates into common/http/a2a directories for clarity - A2A servers use port 9000 (per Strands SDK default) instead of 8080 - Python A2A uses to_fastapi_app() for hot-reload via fastapi dev - Dockerfiles EXPOSE correct port (9000 for A2A, 8080 for HTTP) - Python A2A uses uvicorn in Dockerfile for proper server start - Use spread pattern for protocol-specific deps in withVersions - Add strands-agents[a2a] dep for Python, @a2a-js/sdk for TypeScript - React connection generator throws if target agent uses A2A protocol - Move A2A docs sections below HTTP/FastAPI sections in guides
…cation docs - Add A2A agent generation to smoke tests for both Python and TypeScript - Document A2A agent invocation using strands-agents-tools[a2a_client] (Python) - Document A2A agent invocation using @a2a-js/sdk (TypeScript)
- Fix A2AExpressServer API: use serve() not start(), port via constructor - Wrap A2A index.ts in async main() to avoid top-level await in CJS bundle - Update TS A2A docs to match corrected template code
The strands-agents[a2a] dependency pulls in greenlet which requires C++ compilation. Using computeType=None avoids the bundle-arm target which triggers cross-platform pip install and fails on CI runners without the required C++ compiler flags.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #543 +/- ##
==========================================
- Coverage 89.45% 88.05% -1.40%
==========================================
Files 94 96 +2
Lines 3158 3224 +66
Branches 695 726 +31
==========================================
+ Hits 2825 2839 +14
- Misses 154 199 +45
- Partials 179 186 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
📚 Documentation translations have been updated and committed (bba165c) to this PR. |
Contributor
|
📚 Documentation translations have been updated and committed (5736a80) to this PR. |
…act connection - Add AG-UI as a protocol option for py#strands-agent generator - Generate AG-UI server using ag-ui-strands (StrandsAgent + create_strands_app) - AG-UI uses HTTP as the AgentCore protocol type (SSE over POST) - Add react -> py#strands-agent connection generator with CopilotKit - Generated CopilotProvider supports IAM (SigV4), Cognito (JWT), and no-auth - Add AG-UI to ts#strands-agent schema with clear error (not yet supported) - Update dungeon adventure tutorial to use AG-UI protocol - Add connection guide for react -> py#strands-agent (AG-UI) - Update smoke tests with AG-UI agent generation and connection - Add @ag-ui/client, @copilotkit/react-core, @copilotkit/react-ui to TS versions - Add ag-ui-protocol, ag-ui-strands to Python versions Closes #480.
5736a80 to
deb2a0a
Compare
Contributor
|
📚 Documentation translations have been updated and committed (1604179) to this PR. |
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.
Reason for this change
Addresses the feature request in #480 to add support for the AG-UI protocol in the Strands Agent generators. AG-UI enables standardized agent-to-frontend communication for rich, interactive chat experiences powered by CopilotKit.
This PR builds on top of #539 (A2A protocol support) which establishes the protocol pattern.
Description of changes
AG-UIto theprotocolenum option for bothts#strands-agentandpy#strands-agentgenerator schemasprotocol=AG-UI, generates amain.pyusingag-ui-strands(StrandsAgent+create_strands_app()) to expose the agent via the AG-UI protocol over FastAPIHTTPas the AgentCore protocol type (AG-UI is HTTP-based with SSE over POST)react -> py#strands-agentconnection generator that generates CopilotKit components:<AgentNameCopilotProvider>wrapping the app with@copilotkit/react-coreHttpAgentfrom@ag-ui/clientfor AG-UI connectionserve-localintegration for developmentDescription of how you validated changes
create-nx-workspacepnpm linkprotocol=AG-UIconnectiongenerator to connect React -> py#strands-agentnx run-many --target build --allpassesIssue # (if applicable)
Closes #480.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license