Skip to content

feat(templates): add agui-python-strands template - #21

Closed
Hweinstock wants to merge 5 commits into
refactorfrom
feat/agui-python-strands-template
Closed

feat(templates): add agui-python-strands template#21
Hweinstock wants to merge 5 commits into
refactorfrom
feat/agui-python-strands-template

Conversation

@Hweinstock

Copy link
Copy Markdown
Owner

Spec

Add support for an AG-UI Strands Python template to the refactor architecture.

Problem

The refactor branch does not yet support AGUI templates.
AGUI + runtime: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-agui.html · AGUI: https://docs.ag-ui.com/introduction

Definition of Done

  • Customers can use the template and have it render the Strands AG-UI assets into their project on both project creation and add runtime.
  • The template supports containers and memory, and no other context (to keep it simple).

Verification

  • Create a project with the template, add a runtime with the container version, run the dev server with both, curl them locally, then deploy and invoke them e2e.
  • Verify the template shows up in the TUI create flow, and take a screenshot.

Notes

Based on aws#2170.

Naming note: the spec drafted the name as agui-strands-python, but this PR is stacked on aws#2170, whose whole purpose is a consistent <category>-<language>-<framework> scheme (agent-python-strands, a2a-python-strands, mcp-python-fastmcp). To stay consistent with the convention aws#2170 establishes, the template ships as agui-python-strands (confirmed with the requester).

What changed

  • src/assets/templates/agui-python-strands/ — new template assets: an AG-UI Strands agent (create_strands_app serving /invocations + /ping on 8080), Bedrock-only model/load.py, memory wiring (memory/session.py), pyproject.toml, and Dockerfile/.dockerignore/.gitignore (byte-identical to the a2a-python-strands siblings).
  • src/core/project/templates/runtime.ts — resolver for strands/Python/AGUI, mirroring the A2A resolver but with only the simple context (name, memory, otel, entrypoint) — no OS/filesystem-mount/identity context, per the spec.
  • src/handlers/project/shortcuts.tsagui-python-strands shortcut (Python · strands · AGUI · Bedrock · long+short-term memory, CodeZip default).
  • src/handlers/project/create/screen.tsx — the template appears in the interactive create wizard.
  • Testsmanager.test.ts and add/runtime/index.test.ts cover create, add runtime, --build Container, and --memory for the new template.

AGUI was already a first-class protocol in the refactor branch (ProtocolModeSchema, DEV_PORTS.AGUI=8080, and the dev inspector), so no changes were needed there.

Verification evidence

All account IDs / ARNs redacted.

1. project create renders the template (AGUI protocol + memory)

$ agentcore project create --name AguiTest --template agui-python-strands --skip-git
Created project 'AguiTest' in ./AguiTest
# agentcore.json runtimes[0]:
{ "name": "agui_python_strands", "build": "CodeZip", "entrypoint": "main.py",
  "codeLocation": "app/agui_python_strands", "runtimeVersion": "PYTHON_3_14", "protocol": "AGUI" }
# memories[0].name = "agui_python_strandsMemory" (SEMANTIC, USER_PREFERENCE, SUMMARIZATION, EPISODIC)

2. add runtime with the container version

$ agentcore project add runtime --name agui_container --template agui-python-strands --build Container
added runtime 'agui_container' to 'AguiTest'
# runtimes[1]: { "name": "agui_container", "build": "Container", "dockerfile": "Dockerfile", "protocol": "AGUI", ... }
# app/agui_container/ contains a rendered Dockerfile

3. Dev server + local curl — CodeZip runtime (full Bedrock round-trip)

$ agentcore project dev --mode headless --agent agui_python_strands --port 8090 --no-traces &
[agui_python_strands] Uvicorn running on http://0.0.0.0:8090
$ curl localhost:8090/ping                 ->  {"status":"healthy"}
$ curl -N -X POST localhost:8090/invocations -d '{"threadId":"t1","runId":"r1","state":{},
    "messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"}],
    "tools":[],"context":[],"forwardedProps":{}}'
data: {"type":"RUN_STARTED",...}
data: {"type":"TEXT_MESSAGE_CONTENT","delta":"hello"}
data: {"type":"TEXT_MESSAGE_CONTENT","delta":" from agui"}
data: {"type":"RUN_FINISHED","outcome":{"type":"success"}}

4. Dev server + local curl — Container runtime — image builds, container serves AG-UI, /ping healthy and the SSE stream flows. (The local container uses the desktop instance-profile role, which lacks Bedrock, so the model call is blocked locally; the deployed container below proves the Bedrock path end-to-end.)

5. Deploy + invoke both runtimes end-to-end

$ agentcore project deploy
Deployed project 'AguiTest' to target 'default'
# CodeZip runtime:
$ aws bedrock-agentcore invoke-agent-runtime --agent-runtime-arn <codezip-arn> --payload '{...RunAgentInput...}' out.json
{ "contentType": "text/event-stream; charset=utf-8", "statusCode": 200 }
  -> data: {"type":"RUN_FINISHED","outcome":{"type":"success"}}
# Container runtime:
$ aws bedrock-agentcore invoke-agent-runtime --agent-runtime-arn <container-arn> --payload '{...}' out.json
{ "contentType": "text/event-stream; charset=utf-8", "statusCode": 200 }
  -> data: {"type":"TEXT_MESSAGE_CONTENT","delta":"hello"} ... {"delta":" deployed"}
  -> data: {"type":"RUN_FINISHED","outcome":{"type":"success"}}

6. TUI create flow — the template appears and is selectable

 ✓ name ── ✓ type ── ● template ── ○ review
 choose a template
 ╭──────────────────────────────────────────────────────────────────────────────╮
 │ ○ agent-python-strands (recommended)  Strands agent on Bedrock with memory     │
 │ ○ agent-python                        minimal Python agent on Bedrock          │
 │ ○ mcp-python-fastmcp                  MCP server exposing tools via FastMCP     │
 │ ○ a2a-python-strands                  Strands agent speaking the A2A protocol   │
 │ ● agui-python-strands                 Strands agent speaking the AG-UI protocol │
 ╰──────────────────────────────────────────────────────────────────────────────╯

How to reproduce

bun install
bun run compile:linux-x64          # or your platform target
BIN=./dist/bin/agentcore-linux-x64

# scaffold + container runtime
$BIN project create --name AguiTest --template agui-python-strands --skip-git
cd AguiTest
$BIN project add runtime --name agui_container --template agui-python-strands --build Container

# run locally + curl (repeat with --agent agui_container)
$BIN project dev --mode headless --agent agui_python_strands --port 8090 --no-traces &
curl localhost:8090/ping
curl -N -X POST localhost:8090/invocations -H 'Content-Type: application/json' \
  -d '{"threadId":"t1","runId":"r1","state":{},"messages":[{"id":"m1","role":"user","content":"hi"}],"tools":[],"context":[],"forwardedProps":{}}'

# deploy + invoke (needs AWS creds with Bedrock access)
$BIN project deploy

Tests: bun test (2740 pass), bun run typecheck, bun run lint:check, bun run format:check all green.

@Hweinstock
Hweinstock force-pushed the feat/agui-python-strands-template branch from 72d1a5a to 20bfea3 Compare September 2, 2026 23:03
@Hweinstock
Hweinstock changed the base branch from feat/rename-templates to refactor September 2, 2026 23:30
@Hweinstock
Hweinstock force-pushed the feat/agui-python-strands-template branch from 20bfea3 to dbf8c37 Compare September 2, 2026 23:32
## Deployment

`agentcore project deploy` deploys the agent into Amazon Bedrock AgentCore. Invoke it with
the AWS CLI (`bedrock-agentcore invoke-agent-runtime`) using an AG-UI `RunAgentInput` payload.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should advertise that our cli can invoke with agentcore project invoke runtime ... lets verify a command on a real deployed agent and update the docs here.

@Hweinstock Hweinstock closed this Sep 3, 2026
@Hweinstock
Hweinstock deleted the feat/agui-python-strands-template branch September 3, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant