Amazon Bedrock AgentCore Long-Term Memory connector
Use the Amazon Bedrock AgentCore Long-Term Memory connector to retrieve persistent knowledge, such as facts, preferences, and summaries, from AWS Bedrock AgentCore Long-Term Memory in your BPMN process.
About this connector
The Amazon Bedrock AgentCore Long-Term Memory connector is an outbound connector that reads memory records from an AgentCore Memory resource. It can search for records with a natural language query, or list all records in a namespace.
Prerequisites
To use the Amazon Bedrock AgentCore Long-Term Memory connector, you need the following:
- An AWS account with an access key and secret key, a configured default credentials chain (hybrid/Self-Managed only), or a saved AWS credential.
- An AgentCore Memory resource created in your AWS account.
- IAM permissions to execute the
RetrieveMemoryRecordsandListMemoryRecordsactions.
Learn more about Amazon Bedrock AgentCore Long-Term Memory in the official documentation.
Use secrets to store credentials and avoid exposing sensitive information from the process. See managing secrets.
Use this connector
New to using an outbound connector? Learn how to add and use this type of connector, apply element templates, use connector secrets, handle results and errors, and more.
Configuration
Authentication
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
| AWS credential | Configuration | No | Select a saved AWS credential with an optional default region, or enter the authentication details and a region in the fields below. Learn more about credentials. | |
| Authentication | Dropdown | Yes, if no AWS credential is set | The AWS authentication strategy:
| |
| Access key | String | Yes, if Authentication is Credentials | The access key of an IAM user with permissions to read memory records. | |
| Secret key | String | Yes, if Authentication is Credentials | The secret key of the IAM user with the access key above. |
Memory
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
| Memory ID | String | Yes | The identifier of the AgentCore Memory resource you want to query. | |
| Namespace | String | Yes | A namespace prefix to scope memory records. AWS requires it to organize and isolate memory records. | customer/12345 |
Region
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
| Region | String | Yes, if no AWS credential is set | The AWS region where your AgentCore Memory resource is deployed. | us-east-1 |
| Region | String | Yes, if the credential has no default region | Overrides the default region of the selected AWS credential. Shown when an AWS credential is selected. |
Operations
Select the operation in the Operation dropdown. Retrieve Memory Records is selected by default. The properties that apply depend on the operation.
Retrieve memory records
Perform a semantic search to find relevant memory records based on a natural language query.
Input parameters
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
| Search query | String | Yes | Semantic search query to find relevant memory records (up to 10,000 characters). | |
| Memory strategy ID | String | No | Limits the search to memories created by a specific extraction strategy. | |
| Max results | Number | No | Maximum number of results to return (1–100). Defaults to 10. | 10 |
| Pagination token | String | No | Pagination token from a previous response to fetch the next page. |
Output
The operation returns the response structure described below.
List memory records
List all memory records within the configured namespace.
Input parameters
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
| Memory strategy ID | String | No | Filter memory records by a specific extraction strategy. | |
| Max results | Number | No | Maximum number of results to return (1–100). Defaults to 20. | 20 |
| Pagination token | String | No | Pagination token from a previous response to fetch the next page. |
Output
The operation returns the response structure described below.
Response
Both operations use the following response structure:
| Field | Description |
|---|---|
records | A list of memory record entries. Each entry contains the fields described below. |
resultCount | The number of records returned. |
nextToken | A token for retrieving additional results in subsequent requests. null if no more results. |
Each record in the records list contains:
| Field | Description |
|---|---|
memoryRecordId | Unique identifier for the memory record. |
content | The text content of the memory record. |
memoryStrategyId | The extraction strategy that created this record. |
namespaces | List of namespaces associated with the record. |
createdAt | Timestamp when the record was created. |
score | Relevance score (only present for retrieve operations). |
metadata | Key-value metadata associated with the record. |
The connector returns only records that have text content, and resultCount counts only these records. In metadata, the connector includes only entries with string values.
To continue reading, pass the nextToken value of a response into the Pagination token field of the next call.
Use the Result variable to store the response in a process variable, or the Result expression to map specific fields into process variables. For example, to extract the content from all records:
= {
memories: records.content,
count: resultCount
}
Example response
The following is an example of the connector response:
{
"records": [
{
"memoryRecordId": "mem-abc123",
"content": "Customer prefers email communication over phone calls.",
"memoryStrategyId": "preference-extraction",
"namespaces": ["customer/12345"],
"createdAt": "2024-01-15T10:30:00Z",
"score": 0.95,
"metadata": {
"source": "support-ticket",
"confidence": "high"
}
},
{
"memoryRecordId": "mem-def456",
"content": "Customer is located in the Pacific timezone.",
"memoryStrategyId": "fact-extraction",
"namespaces": ["customer/12345"],
"createdAt": "2024-01-10T14:20:00Z",
"score": 0.87,
"metadata": {
"source": "profile-update"
}
}
],
"resultCount": 2,
"nextToken": null
}
Troubleshooting
To learn about general error handling in Camunda, see BPMN errors and failing jobs.
AGENTCORE_MEMORY_FAILED
The connector throws an error with the code AGENTCORE_MEMORY_FAILED when AgentCore Memory returns an error. The error message contains the details from AWS.