# Bedrock AgentCore

Source: /aws/services/bedrock-agentcore/

## Introduction

[Amazon Bedrock AgentCore](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html) is an agentic platform for deploying and operating AI agents at scale.
It provides managed building blocks for running agent code ([Runtime](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html)), exposing tools over [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) ([Gateway](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway.html)), and storing short-term and long-term context ([Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html)).

LocalStack emulates Bedrock AgentCore so you can create runtimes, gateways, and memories locally, invoke agents in Docker-backed sessions, and exercise MCP tool calls and memory APIs without deploying to AWS.
This is separate from [Bedrock](/aws/services/bedrock/) model inference: AgentCore hosts agent workloads, while Bedrock provides foundation model APIs.

The supported APIs are available on the API coverage section for [Bedrock AgentCore](#api-coverage) and [Bedrock AgentCore Control](#api-coverage-bedrock-agentcore-control).

## Getting started

This guide is designed for users new to Bedrock AgentCore and assumes basic knowledge of the AWS CLI and our [`lstk aws`](/aws/developer-tools/running-localstack/lstk/cloud-and-iac-commands/#aws) command.

Start your LocalStack container using your preferred method.
We will demonstrate how to:

1. Create an IAM execution role for AgentCore Runtime
2. Deploy an agent with a [direct code deployment](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-code-deploy.html) from S3
3. Invoke the agent runtime
4. Inspect runtime logs in CloudWatch Logs

### Create an execution role

AgentCore Runtime assumes an IAM role when it starts a session.
Create a trust policy that allows the AgentCore service principal to assume the role:

```bash
lstk aws iam create-role \
  --role-name agentcore-runtime-role \
  --assume-role-policy-document '{
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Principal": {"Service": "bedrock-agentcore.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }]
  }'
```

Attach a policy that covers the common Runtime permissions (ECR, Logs, and Bedrock model access):

```bash
lstk aws iam put-role-policy \
  --role-name agentcore-runtime-role \
  --policy-name agentcore-runtime-policy \
  --policy-document '{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Action": [
          "ecr:BatchCheckLayerAvailability",
          "ecr:BatchGetImage",
          "ecr:GetDownloadUrlForLayer",
          "ecr:GetAuthorizationToken"
        ],
        "Resource": "*"
      },
      {
        "Effect": "Allow",
        "Action": [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:DescribeLogGroups",
          "logs:DescribeLogStreams",
          "logs:PutLogEvents",
          "logs:PutResourcePolicy"
        ],
        "Resource": "*"
      },
      {
        "Effect": "Allow",
        "Action": [
          "bedrock:InvokeModel",
          "bedrock:InvokeModelWithResponseStream"
        ],
        "Resource": "*"
      }
    ]
  }'
```

### Package and upload agent code

Create a minimal HTTP agent that implements the [AgentCore Runtime contract](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-http-protocol-contract.html) (`GET /ping` and `POST /invocations` on port `8080`):

```python title="server.py" showLineNumbers
from http.server import BaseHTTPRequestHandler, HTTPServer


class AgentHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path != "/ping":
            self.send_error(404)
            return
        self.send_response(200)
        self.send_header("Content-Type", "application/json")
        self.end_headers()
        self.wfile.write(b'{"status":"healthy"}')

    def do_POST(self):
        if self.path != "/invocations":
            self.send_error(404)
            return
        length = int(self.headers["Content-Length"])
        body = self.rfile.read(length)
        self.send_response(200)
        self.send_header("Content-Type", self.headers.get("Content-Type", "application/json"))
        self.end_headers()
        self.wfile.write(body)

    def log_message(self, format, *args):
        pass


HTTPServer(("0.0.0.0", 8080), AgentHandler).serve_forever()
```

Zip the entry point and upload it to S3:

```bash
zip echo-agent.zip server.py
lstk aws s3 mb s3://agentcore-code-bucket
lstk aws s3 cp echo-agent.zip s3://agentcore-code-bucket/echo-agent.zip
```

### Create an agent runtime

Create a runtime that uses the uploaded archive as a [code configuration](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_CreateAgentRuntime.html):

```bash
lstk aws bedrock-agentcore-control create-agent-runtime \
  --agent-runtime-name docs_echo_agent \
  --role-arn arn:aws:iam::000000000000:role/agentcore-runtime-role \
  --network-configuration '{"networkMode":"PUBLIC"}' \
  --agent-runtime-artifact '{
    "codeConfiguration": {
      "code": {
        "s3": {
          "bucket": "agentcore-code-bucket",
          "prefix": "echo-agent.zip"
        }
      },
      "runtime": "PYTHON_3_13",
      "entryPoint": ["server.py"]
    }
  }'
```

```bash title="Output"
{
    "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu",
    "workloadIdentityDetails": {
        "workloadIdentityArn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:workload-identity-directory/default/workload-identity/docs_echo_agent-yofl177opu"
    },
    "agentRuntimeId": "docs_echo_agent-yofl177opu",
    "agentRuntimeVersion": "1",
    "createdAt": "2026-11-23T07:53:21.517910+00:00",
    "status": "CREATING"
}
```

Confirm the runtime is ready:

```bash
lstk aws bedrock-agentcore-control get-agent-runtime \
  --agent-runtime-id docs_echo_agent-yofl177opu
```

```bash title="Output"
{
    "agentRuntimeArn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu",
    "agentRuntimeName": "docs_echo_agent",
    "agentRuntimeId": "docs_echo_agent-yofl177opu",
    "agentRuntimeVersion": "1",
    "status": "READY",
    "platformVersion": "V1",
    "workloadIdentityDetails": {
        "workloadIdentityArn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:workload-identity-directory/default/workload-identity/docs_echo_agent-yofl177opu"
    },
    "agentRuntimeArtifact": {
        "codeConfiguration": {
            "code": {
                "s3": {
                    "bucket": "agentcore-code-bucket",
                    "prefix": "echo-agent.zip"
                }
            },
            "runtime": "PYTHON_3_13",
            "entryPoint": ["server.py"]
        }
    }
}
```

### Invoke the runtime

Create a JSON payload and invoke the runtime.
`invoke-agent-runtime` writes the response body to an outfile:

```bash
echo '{"prompt":"hello from LocalStack"}' > payload.json

lstk aws bedrock-agentcore invoke-agent-runtime \
  --agent-runtime-arn arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu \
  --qualifier DEFAULT \
  --content-type application/json \
  --payload fileb://payload.json \
  response.bin
```

```bash title="Output"
{
    "runtimeSessionId": "14c8e21f-d536-4963-af77-7edb409e8046",
    "contentType": "application/json",
    "statusCode": 200
}
```

```bash
cat response.bin
```

```bash title="Output"
{"prompt":"hello from LocalStack"}
```

LocalStack starts a dedicated Docker container per runtime session.
Sessions reuse the same container until you stop them or they exceed the configured maximum lifetime.

### View CloudWatch Logs

Runtime stdout and stderr are forwarded to CloudWatch Logs under:

`/aws/bedrock-agentcore/runtimes/<runtime-id>-<endpoint-name>`

List the log group created for the `DEFAULT` endpoint:

```bash
lstk aws logs describe-log-groups \
  --log-group-name-prefix /aws/bedrock-agentcore/runtimes/
```

```bash title="Output"
{
    "logGroups": [
        {
            "logGroupName": "/aws/bedrock-agentcore/runtimes/docs_echo_agent-yofl177opu-DEFAULT"
        }
    ]
}
```

:::note
LocalStack creates the log group and stream when a session starts.
Application lines appear only when your agent writes to stdout or stderr.
Log destination creation uses the runtime execution role credentials.
:::

## Runtime

### Container image deployments

You can also deploy a custom container image from LocalStack's [ECR](/aws/services/ecr/).
Push an image that listens on port `8080` and implements `/ping` and `/invocations`, then create a runtime with a container configuration:

```bash
lstk aws bedrock-agentcore-control create-agent-runtime \
  --agent-runtime-name container_echo_agent \
  --role-arn arn:aws:iam::000000000000:role/agentcore-runtime-role \
  --network-configuration '{"networkMode":"PUBLIC"}' \
  --agent-runtime-artifact '{
    "containerConfiguration": {
      "containerUri": "000000000000.dkr.ecr.us-east-1.amazonaws.com/agentcore-echo:latest"
    }
  }'
```

### Direct code deployments

Direct code deployments unpack your zip archive into `/var/task` inside a managed `python:*-slim` or `node:22-slim` image and run the configured entry point.
Supported managed runtimes include `PYTHON_3_10` through `PYTHON_3_14` and `NODE_22`.

:::note
LocalStack does not enforce the AWS zip size limits (250 MB compressed / 750 MB uncompressed).
:::

### Runtime updates and versioning

[`UpdateAgentRuntime`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_UpdateAgentRuntime.html) creates a new immutable version.
[`ListAgentRuntimeVersions`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_ListAgentRuntimeVersions.html) returns the version history:

```bash
lstk aws bedrock-agentcore-control update-agent-runtime \
  --agent-runtime-id docs_echo_agent-yofl177opu \
  --role-arn arn:aws:iam::000000000000:role/agentcore-runtime-role \
  --network-configuration '{"networkMode":"PUBLIC"}' \
  --description "updated for docs" \
  --platform-version V2 \
  --agent-runtime-artifact '{
    "codeConfiguration": {
      "code": {
        "s3": {
          "bucket": "agentcore-code-bucket",
          "prefix": "echo-agent.zip"
        }
      },
      "runtime": "PYTHON_3_13",
      "entryPoint": ["server.py"]
    }
  }'
```

```bash
lstk aws bedrock-agentcore-control list-agent-runtime-versions \
  --agent-runtime-id docs_echo_agent-yofl177opu
```

```bash title="Output"
{
    "agentRuntimes": [
        {
            "agentRuntimeId": "docs_echo_agent-yofl177opu",
            "agentRuntimeVersion": "2",
            "description": "updated for docs",
            "status": "READY"
        },
        {
            "agentRuntimeId": "docs_echo_agent-yofl177opu",
            "agentRuntimeVersion": "1",
            "status": "READY"
        }
    ]
}
```

Pass `--agent-runtime-version` to [`GetAgentRuntime`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetAgentRuntime.html) to read a specific version.

### Named endpoints

Every runtime gets a `DEFAULT` endpoint that tracks the latest version.
Create additional named endpoints to pin traffic to a specific version:

```bash
lstk aws bedrock-agentcore-control create-agent-runtime-endpoint \
  --agent-runtime-id docs_echo_agent-yofl177opu \
  --name PROD \
  --agent-runtime-version 1 \
  --description production
```

```bash title="Output"
{
    "targetVersion": "1",
    "agentRuntimeEndpointArn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu/runtime-endpoint/PROD",
    "endpointName": "PROD",
    "status": "CREATING"
}
```

Update the endpoint to point at a newer version, then invoke with `--qualifier PROD`:

```bash
lstk aws bedrock-agentcore-control update-agent-runtime-endpoint \
  --agent-runtime-id docs_echo_agent-yofl177opu \
  --endpoint-name PROD \
  --agent-runtime-version 2
```

:::note
You cannot create, update, or delete the `DEFAULT` endpoint.
Named endpoints must be deleted before you can delete their runtime.
:::

### Platform version and workload identity

`platformVersion` (`V1` or `V2`) is accepted on create and update and returned from get operations.
LocalStack always executes sessions with V1 semantics: each session starts a fresh container from the artifact.
V2 snapshot restore is not emulated.

Create, get, and update responses for runtimes also return `workloadIdentityDetails` with a workload identity ARN in the `default` directory.
Gateways return the same field once the gateway is ready (`CreateGateway` initially returns an empty `workloadIdentityDetails` object, matching AWS).

### Execution role credentials

When a session starts, LocalStack assumes the runtime execution role and injects temporary credentials into the container environment.
Outbound AWS API calls from your agent code therefore use that role, which lets you call services such as Secrets Manager or S3 from inside the runtime without shipping static keys.

### Lifecycle settings

`lifecycleConfiguration` accepts `idleRuntimeSessionTimeout` and `maxLifetime`.
LocalStack enforces both: idle sessions are stopped after `idleRuntimeSessionTimeout` seconds of inactivity, and sessions that exceed `maxLifetime` are terminated.

### Stop a runtime session

Use [`StopRuntimeSession`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StopRuntimeSession.html) to tear down an active session container:

```bash
lstk aws bedrock-agentcore stop-runtime-session \
  --agent-runtime-arn arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu \
  --runtime-session-id 14c8e21f-d536-4963-af77-7edb409e8046 \
  --qualifier DEFAULT
```

## Gateway

AgentCore Gateway exposes tools to agents.
LocalStack supports two gateway shapes:

- **MCP gateways** (`protocolType=MCP`): aggregate Lambda targets as MCP tools over JSON-RPC at the gateway `/mcp` endpoint.
- **HTTP forwarding gateways** (omit `protocolType`): forward HTTP requests to Runtime targets.

### Create an MCP gateway with a Lambda target

Create a gateway role that can invoke Lambda and AgentCore Runtime:

```bash
lstk aws iam create-role \
  --role-name agentcore-gateway-role \
  --assume-role-policy-document '{
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Principal": {"Service": "bedrock-agentcore.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }]
  }'

lstk aws iam put-role-policy \
  --role-name agentcore-gateway-role \
  --policy-name agentcore-gateway-policy \
  --policy-document '{
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Action": [
        "lambda:InvokeFunction",
        "bedrock-agentcore:InvokeAgentRuntime",
        "s3:GetObject"
      ],
      "Resource": "*"
    }]
  }'
```

Create the MCP gateway:

```bash
lstk aws bedrock-agentcore-control create-gateway \
  --name docs-gateway \
  --role-arn arn:aws:iam::000000000000:role/agentcore-gateway-role \
  --protocol-type MCP \
  --authorizer-type NONE
```

```bash title="Output"
{
    "gatewayId": "docs-gateway-7uevtnoz6o",
    "gatewayUrl": "http://docs-gateway-7uevtnoz6o.gateway.bedrock-agentcore.us-east-1.localhost.localstack.cloud:4566/mcp",
    "status": "CREATING",
    "protocolType": "MCP",
    "authorizerType": "NONE",
    "workloadIdentityDetails": {}
}
```

Deploy a Lambda function and register it as a gateway target with an inline tool schema:

```bash
lstk aws bedrock-agentcore-control create-gateway-target \
  --gateway-identifier docs-gateway-7uevtnoz6o \
  --name lambda-tools \
  --credential-provider-configurations '[{"credentialProviderType":"GATEWAY_IAM_ROLE"}]' \
  --target-configuration '{
    "mcp": {
      "lambda": {
        "lambdaArn": "arn:aws:lambda:us-east-1:000000000000:function:agentcore-tool",
        "toolSchema": {
          "inlinePayload": [{
            "name": "echo_tool",
            "description": "Echo a message",
            "inputSchema": {
              "type": "object",
              "properties": {
                "message": {"type": "string"}
              },
              "required": ["message"]
            }
          }]
        }
      }
    }
  }'
```

### Call MCP tools

LocalStack supports MCP protocol versions `2025-03-26` and `2025-06-18` with `initialize`, `notifications/initialized`, `ping`, `tools/list`, and `tools/call` over HTTP POST.
Tool names follow the AWS convention `<target-name>___<tool-name>`:

```bash
GATEWAY_URL="http://docs-gateway-7uevtnoz6o.gateway.bedrock-agentcore.us-east-1.localhost.localstack.cloud:4566/mcp"

curl -sS -X POST "$GATEWAY_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-06-18",
      "capabilities": {},
      "clientInfo": {"name": "docs", "version": "1.0"}
    }
  }'
```

```bash
curl -sS -X POST "$GATEWAY_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list",
    "params": {}
  }'
```

```bash title="Output"
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [{
      "name": "lambda-tools___echo_tool",
      "description": "Echo a message",
      "inputSchema": {
        "type": "object",
        "properties": {"message": {"type": "string"}},
        "required": ["message"]
      }
    }]
  }
}
```

```bash
curl -sS -X POST "$GATEWAY_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "lambda-tools___echo_tool",
      "arguments": {"message": "hi from docs"}
    }
  }'
```

```bash title="Output"
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [{
      "type": "text",
      "text": "{\"message\":\"tool ok\",\"event\":{\"message\":\"hi from docs\"}}"
    }],
    "isError": false
  }
}
```

:::note
Inbound authorizer settings (`NONE`, `CUSTOM_JWT`, `AWS_IAM`, and related options) are accepted and stored, but authentication is not enforced locally.
:::

### Runtime targets

To forward HTTP traffic to an AgentCore Runtime, create a gateway **without** `protocolType=MCP`, then add an `http.agentcoreRuntime` target:

```bash
lstk aws bedrock-agentcore-control create-gateway \
  --name docs-rt-gateway \
  --role-arn arn:aws:iam::000000000000:role/agentcore-gateway-role \
  --authorizer-type NONE
```

```bash
lstk aws bedrock-agentcore-control create-gateway-target \
  --gateway-identifier docs-rt-gateway-9r9ng54lfw \
  --name runtime-target \
  --credential-provider-configurations '[{"credentialProviderType":"GATEWAY_IAM_ROLE"}]' \
  --target-configuration '{
    "http": {
      "agentcoreRuntime": {
        "arn": "arn:aws:bedrock-agentcore:us-east-1:000000000000:runtime/docs_echo_agent-yofl177opu"
      }
    }
  }'
```

Invoke the target at `/<target-name>/invocations` on the gateway URL:

```bash
curl -sS -X POST \
  "http://docs-rt-gateway-9r9ng54lfw.gateway.bedrock-agentcore.us-east-1.localhost.localstack.cloud:4566/runtime-target/invocations" \
  -H 'Content-Type: application/json' \
  -H "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id: $(uuidgen)" \
  -d '{"prompt":"via gateway runtime target"}'
```

```bash title="Output"
{"prompt":"via gateway runtime target"}
```

:::note
Runtime HTTP targets cannot be attached to an MCP protocol gateway.
Create a separate gateway without `protocolType=MCP` for Runtime forwarding.
:::

## Memory

AgentCore Memory stores short-term conversational events and long-term records that agents can retrieve later.

### Create a memory with a semantic strategy

```bash
lstk aws bedrock-agentcore-control create-memory \
  --name docs_memory \
  --event-expiry-duration 30 \
  --memory-strategies '[{
    "semanticMemoryStrategy": {
      "name": "facts",
      "namespaces": ["/users/{actorId}/"]
    }
  }]'
```

```bash title="Output"
{
    "memory": {
        "id": "docs_memory-sh81m3i13i",
        "name": "docs_memory",
        "status": "CREATING",
        "strategies": [{
            "strategyId": "facts-zlmu678lkt",
            "name": "facts",
            "type": "SEMANTIC",
            "namespaces": ["/users/{actorId}/"],
            "status": "CREATING"
        }]
    }
}
```

Wait until the memory status is `ACTIVE` before writing events or records:

```bash
lstk aws bedrock-agentcore-control get-memory \
  --memory-id docs_memory-sh81m3i13i
```

### Short-term memory events

Create conversational events scoped by memory, actor, and session:

```bash
lstk aws bedrock-agentcore create-event \
  --memory-id docs_memory-sh81m3i13i \
  --actor-id user-1 \
  --session-id session-1 \
  --event-timestamp 2026-11-23T07:54:03Z \
  --payload '[{
    "conversational": {
      "role": "USER",
      "content": {
        "text": "My favorite color is blue and I live in Berlin."
      }
    }
  }]'
```

List events, actors, and sessions:

```bash
lstk aws bedrock-agentcore list-events \
  --memory-id docs_memory-sh81m3i13i \
  --actor-id user-1 \
  --session-id session-1

lstk aws bedrock-agentcore list-actors \
  --memory-id docs_memory-sh81m3i13i

lstk aws bedrock-agentcore list-sessions \
  --memory-id docs_memory-sh81m3i13i \
  --actor-id user-1
```

### Long-term memory records

Create records explicitly with [`BatchCreateMemoryRecords`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_BatchCreateMemoryRecords.html):

```bash
lstk aws bedrock-agentcore batch-create-memory-records \
  --memory-id docs_memory-sh81m3i13i \
  --records '[
    {
      "requestIdentifier": "r1",
      "namespaces": ["/users/user-1/"],
      "content": {"text": "User lives in Berlin"},
      "memoryStrategyId": "facts-zlmu678lkt",
      "timestamp": "2026-11-23T07:54:25Z"
    },
    {
      "requestIdentifier": "r2",
      "namespaces": ["/users/user-1/"],
      "content": {"text": "Favorite color is blue"},
      "memoryStrategyId": "facts-zlmu678lkt",
      "timestamp": "2026-11-23T07:54:25Z"
    }
  ]'
```

```bash title="Output"
{
    "successfulRecords": [
        {
            "memoryRecordId": "mem-9536533b-3d54-47e2-9605-42d161f3afff",
            "status": "SUCCEEDED",
            "requestIdentifier": "r1"
        },
        {
            "memoryRecordId": "mem-4bb71be4-ed06-4fa1-a742-34eb6b4a0523",
            "status": "SUCCEEDED",
            "requestIdentifier": "r2"
        }
    ],
    "failedRecords": []
}
```

### Retrieve memory records

[`RetrieveMemoryRecords`](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_RetrieveMemoryRecords.html) ranks stored records by similarity:

```bash
lstk aws bedrock-agentcore retrieve-memory-records \
  --memory-id docs_memory-sh81m3i13i \
  --namespace /users/user-1/ \
  --search-criteria '{
    "searchQuery": "Where does the user live?",
    "topK": 3
  }'
```

```bash title="Output"
{
    "memoryRecordSummaries": [
        {
            "memoryRecordId": "mem-9536533b-3d54-47e2-9605-42d161f3afff",
            "content": {"text": "User lives in Berlin"},
            "score": -0.032879830010264316,
            "namespaces": ["/users/user-1/"],
            ...
        },
        {
            "memoryRecordId": "mem-4bb71be4-ed06-4fa1-a742-34eb6b4a0523",
            "content": {"text": "Favorite color is blue"},
            "score": -0.043669950874229244,
            "namespaces": ["/users/user-1/"],
            ...
        }
    ]
}
```

:::tip
Accurate semantic ranking uses LocalStack's Bedrock embedding integration.
Set `BEDROCK_DEFAULT_EMBEDDING_MODEL` to an embedding-capable model ID and configure a real inference backend (for example `BEDROCK_INFERENCE_MODE=proxy` with `BEDROCK_INFERENCE_ENDPOINT`).
With the default mock inference mode, retrieval still returns records, but similarity scores are not meaningful.
:::

### Semantic memory extraction

When a memory includes a `SEMANTIC` strategy, LocalStack can asynchronously extract long-term records from events that contain `USER` messages or JSON payloads.
Events submitted with `extractionMode=SKIP` bypass extraction.

:::note
Only the `SEMANTIC` strategy performs automatic extraction today.
Summarization, user-preference, episodic, and custom strategy extraction are not implemented.
Cross-event consolidation, contradiction resolution, and deduplication are also not implemented.
:::

## Limitations

- Runtime sessions run as Docker containers rather than Firecracker microVMs.
- `platformVersion` is stored and returned, but execution always uses V1 cold-start semantics. V2 snapshot restore is not emulated.
- Network/VPC, authorizer, filesystem, request-header allowlists, hooks, capacity providers, and related Runtime configuration fields are accepted and stored, but their runtime behavior is not fully emulated.
- Gateway inbound authentication is not enforced. Outbound credential providers beyond the gateway IAM role path, interceptors, policy engines, KMS settings, semantic tool search, MCP prompts/resources, session management, and MCP response streaming are not emulated.
- Lambda targets support inline tool schemas. S3-hosted schemas and most other [gateway target types](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-supported-targets.html) are not implemented for tool discovery or execution.
- Runtime HTTP targets require a non-MCP gateway. They cannot be attached to `protocolType=MCP` gateways.
- Memory event and record expiry settings are validated and stored, but expiry is not enforced.
- Memory encryption-key, memory-execution-role, and stream-delivery configurations are stored without behavioral emulation.
- Automatic extraction is limited to the `SEMANTIC` strategy.
- Pagination and client-token idempotency are not implemented across AgentCore control-plane APIs.
- CloudFormation resource providers for AgentCore exist in LocalStack for a subset of resources; prefer the control-plane APIs or Terraform for full coverage while providers mature.

## API Coverage


### bedrock-agentcore API coverage

Source service: `bedrock-agentcore`. 12 of 67 tracked operations are implemented.

Service documentation: /aws/services/bedrock-agentcore/

| Operation | Status |
| --- | --- |
| BatchCreateMemoryRecords | Not implemented |
| BatchDeleteMemoryRecords | Implemented |
| BatchUpdateMemoryRecords | Implemented |
| CompleteResourceTokenAuth | Not implemented |
| CreateABTest | Not implemented |
| CreateEvent | Implemented |
| CreatePaymentInstrument | Not implemented |
| CreatePaymentSession | Not implemented |
| DeleteABTest | Not implemented |
| DeleteBatchEvaluation | Not implemented |
| DeleteCapacityProviderSession | Not implemented |
| DeleteEvent | Implemented |
| DeleteMemoryRecord | Not implemented |
| DeletePaymentInstrument | Not implemented |
| DeletePaymentSession | Not implemented |
| DeleteRecommendation | Not implemented |
| Evaluate | Not implemented |
| GetABTest | Not implemented |
| GetAgentCard | Not implemented |
| GetBatchEvaluation | Not implemented |
| GetBrowserSession | Not implemented |
| GetCodeInterpreterSession | Not implemented |
| GetEvent | Implemented |
| GetMemoryRecord | Implemented |
| GetPaymentInstrument | Not implemented |
| GetPaymentInstrumentBalance | Not implemented |
| GetPaymentSession | Not implemented |
| GetRecommendation | Not implemented |
| GetResourceApiKey | Not implemented |
| GetResourceOauth2Token | Not implemented |
| GetResourcePaymentToken | Not implemented |
| GetWorkloadAccessToken | Not implemented |
| GetWorkloadAccessTokenForJWT | Not implemented |
| GetWorkloadAccessTokenForUserId | Not implemented |
| IngestData | Not implemented |
| InvokeAgentRuntime | Implemented |
| InvokeAgentRuntimeCommand | Not implemented |
| InvokeBrowser | Not implemented |
| InvokeCodeInterpreter | Not implemented |
| InvokeHarness | Not implemented |
| ListABTests | Not implemented |
| ListActors | Implemented |
| ListBatchEvaluations | Not implemented |
| ListBrowserSessions | Not implemented |
| ListCodeInterpreterSessions | Not implemented |
| ListEvents | Implemented |
| ListMemoryExtractionJobs | Not implemented |
| ListMemoryRecords | Implemented |
| ListPaymentInstruments | Not implemented |
| ListPaymentSessions | Not implemented |
| ListRecommendations | Not implemented |
| ListSessions | Implemented |
| ProcessPayment | Not implemented |
| RetrieveMemoryRecords | Implemented |
| SaveBrowserSessionProfile | Not implemented |
| SearchRegistryRecords | Not implemented |
| StartBatchEvaluation | Not implemented |
| StartBrowserSession | Not implemented |
| StartCodeInterpreterSession | Not implemented |
| StartMemoryExtractionJob | Not implemented |
| StartRecommendation | Not implemented |
| StopBatchEvaluation | Not implemented |
| StopBrowserSession | Not implemented |
| StopCodeInterpreterSession | Not implemented |
| StopRuntimeSession | Not implemented |
| UpdateABTest | Not implemented |
| UpdateBrowserStream | Not implemented |

## API Coverage (Bedrock AgentCore Control)


### bedrock-agentcore-control API coverage

Source service: `bedrock-agentcore-control`. 22 of 171 tracked operations are implemented.

Service documentation: /aws/services/bedrock-agentcore/

| Operation | Status |
| --- | --- |
| AddDatasetExamples | Not implemented |
| BatchPutGatewayRateLimits | Not implemented |
| CreateAgentRuntime | Implemented |
| CreateAgentRuntimeEndpoint | Not implemented |
| CreateApiKeyCredentialProvider | Not implemented |
| CreateBrowser | Not implemented |
| CreateBrowserProfile | Not implemented |
| CreateCapacityProvider | Not implemented |
| CreateCodeInterpreter | Not implemented |
| CreateConfigurationBundle | Not implemented |
| CreateConsentPortal | Not implemented |
| CreateDataset | Not implemented |
| CreateDatasetVersion | Not implemented |
| CreateEvaluator | Not implemented |
| CreateGateway | Implemented |
| CreateGatewayRateLimit | Not implemented |
| CreateGatewayRule | Not implemented |
| CreateGatewayTarget | Implemented |
| CreateHarness | Not implemented |
| CreateHarnessEndpoint | Not implemented |
| CreateMemory | Implemented |
| CreateOauth2CredentialProvider | Not implemented |
| CreateOnlineEvaluationConfig | Not implemented |
| CreatePaymentConnector | Not implemented |
| CreatePaymentCredentialProvider | Not implemented |
| CreatePaymentManager | Not implemented |
| CreatePolicy | Not implemented |
| CreatePolicyEngine | Not implemented |
| CreateRegistry | Not implemented |
| CreateRegistryRecord | Not implemented |
| CreateWorkloadIdentity | Not implemented |
| DeleteAgentRuntime | Implemented |
| DeleteAgentRuntimeEndpoint | Not implemented |
| DeleteApiKeyCredentialProvider | Not implemented |
| DeleteBrowser | Not implemented |
| DeleteBrowserProfile | Not implemented |
| DeleteCapacityProvider | Not implemented |
| DeleteCodeInterpreter | Not implemented |
| DeleteConfigurationBundle | Not implemented |
| DeleteConsentPortal | Not implemented |
| DeleteDataset | Not implemented |
| DeleteDatasetExamples | Not implemented |
| DeleteEvaluator | Not implemented |
| DeleteGateway | Implemented |
| DeleteGatewayRateLimit | Not implemented |
| DeleteGatewayRule | Not implemented |
| DeleteGatewayTarget | Implemented |
| DeleteHarness | Not implemented |
| DeleteHarnessEndpoint | Not implemented |
| DeleteMemory | Implemented |
| DeleteOauth2CredentialProvider | Not implemented |
| DeleteOnlineEvaluationConfig | Not implemented |
| DeletePaymentConnector | Not implemented |
| DeletePaymentCredentialProvider | Not implemented |
| DeletePaymentManager | Not implemented |
| DeletePolicy | Not implemented |
| DeletePolicyEngine | Not implemented |
| DeleteRegistry | Not implemented |
| DeleteRegistryRecord | Not implemented |
| DeleteResourcePolicy | Not implemented |
| DeleteWorkloadIdentity | Not implemented |
| GetAgentRuntime | Implemented |
| GetAgentRuntimeEndpoint | Not implemented |
| GetApiKeyCredentialProvider | Not implemented |
| GetBrowser | Not implemented |
| GetBrowserProfile | Not implemented |
| GetCapacityProvider | Not implemented |
| GetCodeInterpreter | Not implemented |
| GetConfigurationBundle | Not implemented |
| GetConfigurationBundleVersion | Not implemented |
| GetConsentPortal | Not implemented |
| GetDataset | Not implemented |
| GetEvaluator | Not implemented |
| GetGateway | Implemented |
| GetGatewayRateLimit | Not implemented |
| GetGatewayRule | Not implemented |
| GetGatewayTarget | Implemented |
| GetHarness | Not implemented |
| GetHarnessEndpoint | Not implemented |
| GetMemory | Implemented |
| GetOauth2CredentialProvider | Not implemented |
| GetOnlineEvaluationConfig | Not implemented |
| GetPaymentConnector | Not implemented |
| GetPaymentCredentialProvider | Not implemented |
| GetPaymentManager | Not implemented |
| GetPolicy | Not implemented |
| GetPolicyEngine | Not implemented |
| GetPolicyEngineSummary | Not implemented |
| GetPolicyGeneration | Not implemented |
| GetPolicyGenerationSummary | Not implemented |
| GetPolicySummary | Not implemented |
| GetRegistry | Not implemented |
| GetRegistryRecord | Not implemented |
| GetResourcePolicy | Not implemented |
| GetTokenVault | Not implemented |
| GetWorkloadIdentity | Not implemented |
| ListAgentRuntimeEndpoints | Not implemented |
| ListAgentRuntimeVersions | Not implemented |
| ListAgentRuntimeVersionsByCapacityProvider | Not implemented |
| ListAgentRuntimes | Implemented |
| ListApiKeyCredentialProviders | Not implemented |
| ListBrowserProfiles | Not implemented |
| ListBrowsers | Not implemented |
| ListCapacityProviders | Not implemented |
| ListCodeInterpreters | Not implemented |
| ListConfigurationBundleVersions | Not implemented |
| ListConfigurationBundles | Not implemented |
| ListConsentPortals | Not implemented |
| ListDatasetExamples | Not implemented |
| ListDatasetVersions | Not implemented |
| ListDatasets | Not implemented |
| ListEvaluators | Not implemented |
| ListGatewayRateLimits | Not implemented |
| ListGatewayRules | Not implemented |
| ListGatewayTargets | Implemented |
| ListGateways | Implemented |
| ListHarnessEndpoints | Not implemented |
| ListHarnessVersions | Not implemented |
| ListHarnesses | Not implemented |
| ListMemories | Implemented |
| ListOauth2CredentialProviders | Not implemented |
| ListOnlineEvaluationConfigs | Not implemented |
| ListPaymentConnectors | Not implemented |
| ListPaymentCredentialProviders | Not implemented |
| ListPaymentManagers | Not implemented |
| ListPolicies | Not implemented |
| ListPolicyEngineSummaries | Not implemented |
| ListPolicyEngines | Not implemented |
| ListPolicyGenerationAssets | Not implemented |
| ListPolicyGenerationSummaries | Not implemented |
| ListPolicyGenerations | Not implemented |
| ListPolicySummaries | Not implemented |
| ListRegistries | Not implemented |
| ListRegistryRecords | Not implemented |
| ListTagsForResource | Implemented |
| ListWorkloadIdentities | Not implemented |
| PutResourcePolicy | Not implemented |
| RotatePaymentConnectorCredentials | Not implemented |
| SetTokenVaultCMK | Not implemented |
| StartPolicyGeneration | Not implemented |
| SubmitRegistryRecordForApproval | Not implemented |
| SynchronizeGatewayTargets | Not implemented |
| TagResource | Implemented |
| UntagResource | Implemented |
| UpdateAgentRuntime | Not implemented |
| UpdateAgentRuntimeEndpoint | Not implemented |
| UpdateApiKeyCredentialProvider | Not implemented |
| UpdateCapacityProvider | Not implemented |
| UpdateConfigurationBundle | Not implemented |
| UpdateConsentPortal | Not implemented |
| UpdateDataset | Not implemented |
| UpdateDatasetExamples | Not implemented |
| UpdateEvaluator | Not implemented |
| UpdateGateway | Implemented |
| UpdateGatewayRateLimit | Not implemented |
| UpdateGatewayRule | Not implemented |
| UpdateGatewayTarget | Implemented |
| UpdateHarness | Not implemented |
| UpdateHarnessEndpoint | Not implemented |
| UpdateMemory | Implemented |
| UpdateOauth2CredentialProvider | Not implemented |
| UpdateOnlineEvaluationConfig | Not implemented |
| UpdatePaymentConnector | Not implemented |
| UpdatePaymentCredentialProvider | Not implemented |
| UpdatePaymentManager | Not implemented |
| UpdatePolicy | Not implemented |
| UpdatePolicyEngine | Not implemented |
| UpdateRegistry | Not implemented |
| UpdateRegistryRecord | Not implemented |
| UpdateRegistryRecordStatus | Not implemented |
| UpdateWorkloadIdentity | Not implemented |
