Skip to content

Feat/agui strands pattern#62

Merged
kaleko merged 4 commits intomainfrom
feat/agui-strands-pattern
Mar 24, 2026
Merged

Feat/agui strands pattern#62
kaleko merged 4 commits intomainfrom
feat/agui-strands-pattern

Conversation

@razkenari
Copy link
Copy Markdown
Contributor

@razkenari razkenari commented Mar 20, 2026

Summary

Adds AG-UI protocol support to FAST with two new agent patterns (agui-strands-agent, agui-langgraph-agent), a shared frontend parser, and restructures the project layout for consistency across all patterns.

Changes

Commit 1: Restructure agent patterns and shared modules

  • Rewrite strands-single-agent and langgraph-single-agent with consistent structure — each pattern now has its own tools/ module (gateway, code_interpreter) and imports shared utilities from utils/
  • Pin all Python dependency versions with == in requirements.txt
  • Fix langgraph parser to use LangChain standard tool_call_chunks for tool input streaming
  • Fix all Dockerfile COPY paths to match current directory layout

Commit 2: Add AG-UI agent patterns and frontend support

  • agui-strands-agent: Strands agent wrapped with ag-ui-strands (StrandsAgent). Creates agent per-request to ensure correct Memory scoping and fresh MCP connections.
  • agui-langgraph-agent: LangGraph agent wrapped with copilotkit (LangGraphAGUIAgent). Uses ActorAwareLangGraphAgent subclass to rebuild the graph per-request for fresh Gateway tokens.
  • Frontend AG-UI parser (parsers/agui.ts): Maps AG-UI events (TEXT_MESSAGE_CONTENT, TOOL_CALL_START, etc.) to the shared StreamEvent types. Auto-selected for any pattern with agui- prefix.
  • AG-UI payload format: AgentCoreClient.invoke() automatically sends RunAgentInput (threadId, messages, runId) for agui-* patterns.
  • Documentation: docs/AGUI_INTEGRATION.md — covers architecture, patterns, frontend integration, deployment, and CopilotKit reference.
  • Bump CDK dependencies (@aws-cdk/aws-bedrock-agentcore-alpha, @aws-cdk/aws-bedrock-alpha)
  • Add AGUI protocol comments in backend-stack.ts and config.yaml

Key design decisions

  • Both AG-UI patterns use BedrockAgentCoreApp as the entrypoint (not standalone FastAPI), so AgentCore Runtime headers (WorkloadAccessToken, Authorization, Session-Id) are available for Gateway auth, Memory, and secure user identity extraction from JWT.
  • AG-UI patterns deploy with HTTP protocol — AgentCore Runtime's AGUI protocol flag only changes error formatting (RUN_ERROR events vs HTTP error codes). The agent container handles AG-UI event formatting internally.
  • One parser for all AG-UI patterns — both Strands and LangGraph AG-UI wrappers produce standard AG-UI events, so a single parseAguiChunk parser handles both.
  • CopilotKit kept separate — CopilotKit is referenced in docs as an optional richer frontend.

Testing

  • Deployed and validated all 4 strands-single-agent, langgraph-single-agent, agui-strands-agent, and agui-langgraph-agent patterns end-to-end (CDK deploy → AgentCore Runtime → Amplify frontend)
  • Verified: text streaming, tool calls (Gateway + Code Interpreter), Memory persistence, user identity extraction

@github-actions

This comment was marked as outdated.

@razkenari razkenari force-pushed the feat/agui-strands-pattern branch from c025e1c to a82de42 Compare March 21, 2026 17:15
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 21, 2026
@razkenari razkenari force-pushed the feat/agui-strands-pattern branch 7 times, most recently from a1c29c5 to bbeeae3 Compare March 22, 2026 13:20
@razkenari razkenari marked this pull request as ready for review March 22, 2026 13:25
@razkenari razkenari requested a review from a team March 22, 2026 13:25
@razkenari razkenari marked this pull request as draft March 22, 2026 13:40
@razkenari razkenari force-pushed the feat/agui-strands-pattern branch 2 times, most recently from 5e57b6b to da4afe0 Compare March 22, 2026 14:50
@razkenari razkenari force-pushed the feat/agui-strands-pattern branch from da4afe0 to b0806f8 Compare March 22, 2026 15:49
@razkenari razkenari marked this pull request as ready for review March 22, 2026 15:50
@kaleko kaleko merged commit d125016 into main Mar 24, 2026
9 checks passed
@kaleko kaleko deleted the feat/agui-strands-pattern branch March 25, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend docker documentation Improvements or additions to documentation frontend infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants