AgentCore projects use JSON configuration files in the agentcore/ directory.
| File | Purpose |
|---|---|
agentcore.json |
Project, agents, memories, and credentials |
aws-targets.json |
Deployment targets |
deployed-state.json |
Runtime state (auto-managed, do not edit) |
.env.local |
API keys for local development (gitignored) |
Main project configuration using a flat resource model. Agents, memories, and credentials are top-level arrays.
{
"name": "MyProject",
"version": 1,
"agents": [
{
"type": "AgentCoreRuntime",
"name": "MyAgent",
"build": "CodeZip",
"entrypoint": "main.py",
"codeLocation": "app/MyAgent/",
"runtimeVersion": "PYTHON_3_12"
}
],
"memories": [
{
"type": "AgentCoreMemory",
"name": "MyMemory",
"eventExpiryDuration": 30,
"strategies": [{ "type": "SEMANTIC" }]
}
],
"credentials": [
{
"type": "ApiKeyCredentialProvider",
"name": "OpenAI"
}
]
}| Field | Required | Description |
|---|---|---|
name |
Yes | Project name (1-23 chars, alphanumeric, starts with letter) |
version |
Yes | Schema version (integer, currently 1) |
agents |
Yes | Array of agent specifications |
memories |
Yes | Array of memory resources |
credentials |
Yes | Array of credential providers |
{
"type": "AgentCoreRuntime",
"name": "MyAgent",
"build": "CodeZip",
"entrypoint": "main.py",
"codeLocation": "app/MyAgent/",
"runtimeVersion": "PYTHON_3_12",
"networkMode": "PUBLIC",
"envVars": [{ "name": "MY_VAR", "value": "my-value" }],
"instrumentation": {
"enableOtel": true
}
}| Field | Required | Description |
|---|---|---|
type |
Yes | Always "AgentCoreRuntime" |
name |
Yes | Agent name (1-48 chars, alphanumeric + underscore) |
build |
Yes | "CodeZip" or "Container" |
entrypoint |
Yes | Entry file (e.g., main.py or main.py:handler) |
codeLocation |
Yes | Directory containing agent code |
runtimeVersion |
Yes | Runtime version (see below) |
networkMode |
No | "PUBLIC" (default) or "PRIVATE" |
envVars |
No | Custom environment variables |
instrumentation |
No | OpenTelemetry settings |
Python:
PYTHON_3_10PYTHON_3_11PYTHON_3_12PYTHON_3_13
{
"type": "AgentCoreMemory",
"name": "MyMemory",
"eventExpiryDuration": 30,
"strategies": [{ "type": "SEMANTIC" }, { "type": "SUMMARIZATION" }]
}| Field | Required | Description |
|---|---|---|
type |
Yes | Always "AgentCoreMemory" |
name |
Yes | Memory name (1-48 chars) |
eventExpiryDuration |
Yes | Days until events expire (7-365) |
strategies |
Yes | Array of memory strategies (at least 1) |
| Strategy | Description |
|---|---|
SEMANTIC |
Vector-based similarity search for relevant context |
SUMMARIZATION |
Compressed conversation history |
USER_PREFERENCE |
Store user-specific preferences and settings |
Strategy configuration:
{
"type": "SEMANTIC",
"name": "custom_semantic",
"description": "Custom semantic memory",
"namespaces": ["/users/facts", "/users/preferences"]
}{
"type": "ApiKeyCredentialProvider",
"name": "OpenAI"
}| Field | Required | Description |
|---|---|---|
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 AgentCore Identity service for deployed
environments.
Deployment target
[
{
"name": "default",
"description": "Production (us-west-2)",
"account": "123456789012",
"region": "us-west-2"
}
]| Field | Required | Description |
|---|---|---|
name |
Yes | Target name (used with --target flag) |
description |
No | Target description |
account |
Yes | AWS account ID (12 digits) |
region |
Yes | AWS region |
See AgentCore Regions for the current list.
API keys for local development. This file is gitignored.
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.