Skip to content

Commit 67812a8

Browse files
committed
chore: add aws FAST templates of copilotkit with strands and langgraph
1 parent 1993ca2 commit 67812a8

110 files changed

Lines changed: 19510 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
.venv/
5+
*.egg-info/
6+
.uv/
7+
8+
# Node
9+
node_modules/
10+
dist/
11+
.vite/
12+
build/
13+
14+
# CDK
15+
cdk.out*/
16+
infra-cdk/cdk.out*/
17+
18+
# AWS
19+
aws-exports.json
20+
*.zip
21+
22+
# Terraform
23+
infra-terraform/.terraform/
24+
infra-terraform/*.tfstate
25+
infra-terraform/*.tfstate.backup
26+
infra-terraform/.terraform.lock.hcl
27+
infra-terraform/terraform.tfvars
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# CopilotKit + AWS AgentCore
2+
3+
Chat UI with generative charts, shared-state todo canvas, and inline tool rendering — deployed on AWS Bedrock AgentCore. Pick LangGraph or Strands.
4+
5+
## Prerequisites
6+
7+
| Tool | Version |
8+
|---|---|
9+
| AWS CLI | configured (`aws configure`) |
10+
| Node.js | 18+ |
11+
| Python | 3.8+ |
12+
| Docker | running |
13+
14+
## Quick Start
15+
16+
1. **Edit `config.yaml`** — set `stack_name_base` and `admin_user_email`
17+
18+
2. **Deploy:**
19+
```bash
20+
./deploy-langgraph.sh # LangGraph agent (infra + frontend)
21+
./deploy-langgraph.sh --skip-frontend # infra/agent only, skip frontend
22+
# or
23+
./deploy-strands.sh # AWS Strands agent (infra + frontend)
24+
./deploy-strands.sh --skip-frontend # infra/agent only, skip frontend
25+
```
26+
27+
3. **Open** the Amplify URL printed at the end. Sign in with your email.
28+
29+
## What's inside
30+
31+
| Piece | What it does |
32+
|---|---|
33+
| `frontend/` | Vite + React with CopilotKit chat, charts, todo canvas |
34+
| `agents/langgraph/` | LangGraph agent with tools + shared todo state |
35+
| `agents/strands/` | Strands agent with tools + shared todo state |
36+
| `infra-cdk/` | CDK: Cognito, AgentCore, CopilotKit Lambda bridge, Amplify |
37+
| `infra-terraform/` | Terraform equivalent — see `infra-terraform/README.md` |
38+
39+
## Architecture
40+
41+
```
42+
Browser → API Gateway → CopilotKit Lambda (Node.js, AG-UI bridge)
43+
44+
AgentCore Runtime
45+
46+
langgraph_agent.py / basic_agent.py
47+
↓ MCP (OAuth2 M2M)
48+
AgentCore Gateway → Lambda tools
49+
```
50+
51+
Auth: Cognito OIDC → Bearer token forwarded from browser through Lambda to AgentCore.
52+
53+
## Tear down
54+
55+
```bash
56+
cd infra-cdk && npx cdk destroy --all
57+
```
58+
59+
## Docs
60+
61+
- [CopilotKit](https://docs.copilotkit.ai)
62+
- [AWS Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/)

examples/integrations/agentcore/agents/__init__.py

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
5+
6+
WORKDIR /app
7+
8+
# Configure UV for container environment
9+
ENV UV_SYSTEM_PYTHON=1 \
10+
UV_COMPILE_BYTECODE=1 \
11+
DOCKER_CONTAINER=1 \
12+
OTEL_PYTHON_LOG_CORRELATION=true \
13+
PYTHONUNBUFFERED=1
14+
15+
# Copy and install agent-specific requirements first
16+
COPY agents/langgraph-single-agent/requirements.txt requirements.txt
17+
RUN uv pip install --no-cache -r requirements.txt && \
18+
uv pip install --no-cache aws-opentelemetry-distro==0.16.0
19+
20+
# Create non-root user
21+
RUN useradd -m -u 1000 bedrock_agentcore
22+
USER bedrock_agentcore
23+
24+
EXPOSE 8080
25+
26+
# Copy agent code and shared utilities
27+
COPY agents/langgraph-single-agent/langgraph_agent.py .
28+
COPY agents/utils/ utils/
29+
30+
# Healthcheck using Python (no extra dependencies needed)
31+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
32+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/ping', timeout=2)" || exit 1
33+
34+
# Start agent with OpenTelemetry instrumentation
35+
CMD ["opentelemetry-instrument", "python", "-m", "langgraph_agent"]

examples/integrations/agentcore/agents/langgraph-single-agent/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)