Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 9 additions & 41 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,16 @@ Deploy infrastructure to AWS.

```bash
agentcore deploy
agentcore deploy --target production
agentcore deploy -y --progress # Auto-confirm with progress
agentcore deploy -v --json # Verbose JSON output
```

| Flag | Description |
| ----------------- | --------------------- |
| `--target <name>` | Deployment target |
| `-y, --yes` | Auto-confirm prompts |
| `--progress` | Real-time progress |
| `-v, --verbose` | Resource-level events |
| `--json` | JSON output |
| Flag | Description |
| --------------- | --------------------- |
| `-y, --yes` | Auto-confirm prompts |
| `--progress` | Real-time progress |
| `-v, --verbose` | Resource-level events |
| `--json` | JSON output |

### status

Expand All @@ -72,14 +70,12 @@ Check deployment status.
```bash
agentcore status
agentcore status --agent MyAgent
agentcore status --target production
```

| Flag | Description |
| ------------------------- | ------------------- |
| `--agent <name>` | Specific agent |
| `--agent-runtime-id <id>` | Specific runtime ID |
| `--target <name>` | Deployment target |

### validate

Expand Down Expand Up @@ -169,26 +165,6 @@ agentcore add identity \
| `--api-key <key>` | API key value |
| `--json` | JSON output |

### add target

Add a deployment target.

```bash
agentcore add target \
--name production \
--account 123456789012 \
--region us-west-2 \
--description "Production environment"
```

| Flag | Description |
| ---------------------- | -------------- |
| `--name <name>` | Target name |
| `--account <id>` | AWS account ID |
| `--region <region>` | AWS region |
| `--description <desc>` | Description |
| `--json` | JSON output |

### remove

Remove resources from project.
Expand All @@ -197,7 +173,6 @@ Remove resources from project.
agentcore remove agent --name MyAgent --force
agentcore remove memory --name SharedMemory
agentcore remove identity --name OpenAI
agentcore remove target --name dev

# Reset everything
agentcore remove all --force
Expand Down Expand Up @@ -241,7 +216,7 @@ Invoke local or deployed agents.
```bash
agentcore invoke "What can you do?"
agentcore invoke --prompt "Hello" --stream
agentcore invoke --agent MyAgent --target production
agentcore invoke --agent MyAgent
agentcore invoke --session-id abc123 # Continue session
agentcore invoke --new-session # Fresh session
agentcore invoke --json # JSON output
Expand All @@ -251,7 +226,6 @@ agentcore invoke --json # JSON output
| ------------------- | ------------------------- |
| `--prompt <text>` | Prompt text |
| `--agent <name>` | Specific agent |
| `--target <name>` | Deployment target |
| `--session-id <id>` | Continue specific session |
| `--new-session` | Start fresh session |
| `--stream` | Stream response |
Expand Down Expand Up @@ -282,13 +256,8 @@ Check for CLI updates.

```bash
agentcore update # Check and install
agentcore update --check # Check only
```

| Flag | Description |
| ------------- | ------------------------ |
| `-c, --check` | Check without installing |

---

## Common Patterns
Expand All @@ -298,7 +267,7 @@ agentcore update --check # Check only
```bash
# Validate and deploy with auto-confirm
agentcore validate
agentcore deploy --target production -y --json
agentcore deploy -y --json
```

### Scripted Project Setup
Expand All @@ -307,8 +276,7 @@ agentcore deploy --target production -y --json
agentcore create --name MyProject --defaults
cd MyProject
agentcore add memory --name SharedMemory --strategies SEMANTIC
agentcore add target --name dev --account 123456789012 --region us-west-2
agentcore deploy --target dev -y
agentcore deploy -y
```

### JSON Output for Automation
Expand Down
24 changes: 6 additions & 18 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ Main project configuration using a **flat resource model**. Agents, memories, an
- `PYTHON_3_12`
- `PYTHON_3_13`

**Node.js:**

- `NODE_18`
- `NODE_20`
- `NODE_22`

---

## Memory Resource
Expand Down Expand Up @@ -132,7 +126,6 @@ Main project configuration using a **flat resource model**. Agents, memories, an
| `SEMANTIC` | Vector-based similarity search for relevant context |
| `SUMMARIZATION` | Compressed conversation history |
| `USER_PREFERENCE` | Store user-specific preferences and settings |
| `CUSTOM` | Custom strategy implementation |

Strategy configuration:

Expand Down Expand Up @@ -161,13 +154,14 @@ Strategy configuration:
| `type` | Yes | Always `"ApiKeyCredentialProvider"` |
| `name` | Yes | Credential name (3-255 chars) |

The actual API key is stored in `.env.local` for local development and in AWS Secrets Manager for deployed environments.
The actual API key is stored in `.env.local` for local development and in AgentCore Identity service for deployed
environments.

---

## aws-targets.json

Array of deployment targets.
Deployment target

```json
[
Expand All @@ -176,12 +170,6 @@ Array of deployment targets.
"description": "Production (us-west-2)",
"account": "123456789012",
"region": "us-west-2"
},
{
"name": "dev",
"description": "Development (us-east-1)",
"account": "123456789012",
"region": "us-east-1"
}
]
```
Expand All @@ -205,9 +193,9 @@ current list.
API keys for local development. This file is gitignored.

```bash
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AI...
AGENTCORE_CREDENTIAL_{projectName}OPENAI=sk-...
AGENTCORE_CREDENTIAL_{projectName}ANTHROPIC=sk-ant-...
AGENTCORE_CREDENTIAL_{projectName}GEMINI=...
```

Environment variable names should match the credential names in your configuration.
24 changes: 2 additions & 22 deletions docs/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ agentcore add agent \

1. **Entrypoint**: Your code must expose an HTTP endpoint that accepts agent invocation requests
2. **Code location**: Directory containing your agent code
3. **Language**: Python, TypeScript, or Other (requires container build)
3. **Language**: Python

### BYO Options

Expand All @@ -102,7 +102,7 @@ agentcore add agent \
| `--type byo` | Use BYO mode (required) |
| `--code-location <path>` | Directory containing your agent code |
| `--entrypoint <file>` | Entry file (e.g., `main.py` or `index.ts`) |
| `--language <lang>` | `Python`, `TypeScript`, or `Other` |
| `--language <lang>` | `Python` |

## Framework Comparison

Expand All @@ -112,23 +112,3 @@ agentcore add agent \
| AWS Bedrock native | Yes | No | No | No |
| Tool ecosystem | Growing | Extensive | Moderate | Moderate |
| Memory integration | Native | Via libs | Via libs | Via libs |

## Changing Frameworks

To switch frameworks for an existing project, you'll need to:

1. Create a new agent with the desired framework:

```bash
agentcore add agent --name NewAgent --framework LangChain_LangGraph
```

2. Migrate your agent logic to the new framework's structure

3. Remove the old agent (optional):
```bash
agentcore remove agent --name OldAgent
```

Agent framework and model provider are only used during template generation. The generated code can be modified to use
any compatible SDK or model.
21 changes: 8 additions & 13 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ The dev server automatically:
For non-Bedrock providers, add keys to `agentcore/.env.local`:

```bash
AGENTCORE_IDENTITY_OPENAI=sk-...
AGENTCORE_IDENTITY_ANTHROPIC=sk-ant-...
AGENTCORE_IDENTITY_GEMINI=AI...
AGENTCORE_CREDENTIAL_{projectName}OPENAI=sk-...
AGENTCORE_CREDENTIAL_{projectName}ANTHROPIC=sk-ant-...
AGENTCORE_CREDENTIAL_{projectName}GEMINI=...
```

The variable names must match `envVarName` in your identity providers.

## Debugging

### Log Files
Expand Down Expand Up @@ -92,20 +90,17 @@ cd app/MyAgent
uv sync
```

**API key not found:** Check that `.env.local` has the correct variable name matching your identity provider's
`envVarName`.

## Hot Reload

The dev server watches for file changes and automatically reloads. Edit your agent code and the changes take effect
immediately.

## Dev vs Deployed Behavior

| Aspect | Local Dev | Deployed |
| ---------- | ------------- | ------------------------ |
| API Keys | `.env.local` | AWS Secrets Manager |
| Memory | Not available | AgentCore Memory service |
| Networking | localhost | VPC/Public |
| Aspect | Local Dev | Deployed |
| ---------- | ------------- | -------------------------- |
| API Keys | `.env.local` | AgentCore Identity service |
| Memory | Not available | AgentCore Memory service |
| Networking | localhost | Public |

Memory requires deployment to test fully. For local testing, you can mock these dependencies in your agent code.
58 changes: 38 additions & 20 deletions docs/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ agentcore deploy

### Adding Memory to an Agent Without Memory

If you created an agent without memory and want to add it later:
If you created an Strands agent without memory and want to integrate it with your agent later:

1. Add a memory to your project:

```bash
agentcore add memory --name MyMemory --strategies SEMANTIC
agentcore add memory --name MyMemory --strategies SEMANTIC,SUMMARIZATION
```

2. Create the `memory/` directory in your agent:
Expand All @@ -93,7 +93,7 @@ If you created an agent without memory and want to add it later:

retrieval_config = {
f"/users/{actor_id}/facts": RetrievalConfig(top_k=3, relevance_score=0.5),
f"/users/{actor_id}/preferences": RetrievalConfig(top_k=3, relevance_score=0.5),
f"/summaries/{actor_id}/{session_id}": RetrievalConfig(top_k=3, relevance_score=0.5)
}

return AgentCoreMemorySessionManager(
Expand All @@ -109,25 +109,44 @@ If you created an agent without memory and want to add it later:

4. Update `main.py` to use the session manager:

```python
from memory.session import get_memory_session_manager

@app.entrypoint
async def invoke(payload, context):
session_id = getattr(context, 'session_id', 'default-session')
user_id = getattr(context, 'user_id', 'default-user')
session_manager = get_memory_session_manager(session_id, user_id)

agent = Agent(
model=load_model(),
session_manager=session_manager, # Add this line
...
)
```
```python
from memory.session import get_memory_session_manager

def agent_factory():
cache = {}
def get_or_create_agent(session_id, user_id):
key = f"{session_id}/{user_id}"
if key not in cache:
# Create an agent for the given session_id and user_id
cache[key] = Agent(
model=load_model(),
session_manager=get_memory_session_manager(session_id, user_id),
system_prompt="""
You are a helpful assistant. Use tools when appropriate.
""",
tools=tools+[mcp_client]
)
return cache[key]
return get_or_create_agent
get_or_create_agent = agent_factory()

@app.entrypoint
async def invoke(payload, context):
session_id = getattr(context, 'session_id', 'default-session')
user_id = getattr(context, 'user_id', 'default-user')
agent = get_or_create_agent(session_id, user_id)
session_manager = get_memory_session_manager(session_id, user_id)

agent = Agent(
model=load_model(),
session_manager=session_manager, # Add this line
...
)
```

5. Deploy:
```bash
agentcore deploy
agentcore deploy
```

## Memory Strategies
Expand All @@ -137,7 +156,6 @@ If you created an agent without memory and want to add it later:
| `SEMANTIC` | Vector-based similarity search for relevant context |
| `SUMMARIZATION` | Compressed conversation history |
| `USER_PREFERENCE` | Store user-specific preferences and settings |
| `CUSTOM` | Custom strategy implementation |

You can combine multiple strategies:

Expand Down
Loading
Loading