agentcore-memory-mcp
Integrates with Amazon Bedrock AgentCore Memory to provide long-term memory for AI agents, including exact-text storage, conversation-based fact/preference/summary extraction, semantic search, listing, updating, and deleting memory records.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentcore-memory-mcp remember that I prefer dark mode in all my apps"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentcore-memory-mcp
An MCP server that gives AI agents long-term memory stored in Amazon Bedrock AgentCore Memory. Every agent or machine that points at the same memory shares what it knows.
It supports two ways to save memory:
Exact text (
memory_store): your words are stored unchanged, with optional tags.Extracted memory (
memory_store_session): you send a conversation, and AgentCore turns it into facts, user preferences and a session summary in the background.
Tools
Tool | What it does |
| Saves text exactly as written. Tags go in |
| Sends a chat for background extraction. Takes about a minute to appear. |
| Semantic search, best match first. |
| Lists memories, newest first. |
| Deletes by id or by filter. At least one filter is required. |
| Changes the text and/or tags. |
content_hash is the AgentCore record id. memory_type is facts, prefs,
summaries or manual (the exact-text records). Every tool replies with JSON, and
bad input comes back as {"error": "..."} and not as an exception.
Related MCP server: clude-memory
Setup
You need Python 3.12 or newer and AWS credentials that can use AgentCore Memory.
Install:
pip install -e .Create the memory once.
infra/memory.jsondefines three strategies (facts, summaries, preferences) and their namespaces:aws bedrock-agentcore-control create-memory --cli-input-json file://infra/memory.jsonWait until
aws bedrock-agentcore-control get-memory --memory-id <id>showsACTIVE. Note the memory id and the id of thefactsstrategy from its output.Configure the server with environment variables:
Variable
Required
Meaning
AGENTCORE_MEMORY_IDyes
Id from step 2
AGENTCORE_FACTS_STRATEGY_IDyes
Id of the
factsstrategyAGENTCORE_ACTOR_IDyes
Who the memories belong to: letters, digits,
_,-AWS_REGIONorAGENTCORE_REGIONyes
Region of the memory
AGENTCORE_NAMESPACE_ROOTno
Default
/memory. Must matchinfra/memory.json.Register it with your MCP client. See
examples/mcp_config.json.
How it stores things
An AgentCore record has no tag field and allows only one namespace. Tags on exact-text records are kept in a
[tags: a, b]footer in the stored text, and removed when read.Exact-text records live under
<root>/facts/<actor>/manual, so searchingfactsfinds them too.Reads are eventually consistent for a few seconds after a write.
memory_listand bulk delete read every record. They raise an error past 20,000 records and do not silently truncate. Usememory_typeor tags to narrow.
Permissions
The server needs these actions on the memory resource: CreateEvent,
RetrieveMemoryRecords, ListMemoryRecords, GetMemoryRecord,
BatchCreateMemoryRecords, BatchUpdateMemoryRecords and DeleteMemoryRecord
(prefix each with bedrock-agentcore:). Check the names against the AWS service
authorization reference before you write a policy. Grant only these on the one memory.
Do not store secrets or regulated data in the memory unless your own policies allow it. The actor id is part of every namespace path, so use a different actor id for each person who shares a memory.
Costs
AgentCore Memory is a paid AWS service, and extraction uses a model. Check current pricing, and set an AWS Budget before you load data.
Development
pip install -e ".[dev]"
pytest -q # offline, uses a fake AWS API
mypy --strict src
black --check src tests examplesexamples/live_smoke.py runs the whole tool set against a real memory. It writes one
record and deletes it.
Limits
No export, import or deduplication tools.
One memory and one actor per server process.
Semantic search quality and extraction behavior come from AgentCore, not this code.
License
MIT. See LICENSE.
Available Tools
6 toolsmemory_deleteA
Delete one memory by content_hash, or all that match tags and dates.
At least one filter is required. With dry_run true, nothing is deleted and the matches are listed.
Inputs: tags, after, before, dry_run, +2 more. Returns: result
memory_listB
List memories, newest first. memory_type is facts, prefs, summaries or manual.
Inputs: page, tags, page_size, memory_type. Returns: result
memory_searchB
Semantic search over memories, best match first.
after and before are ISO 8601 dates. memory_type is facts, prefs, summaries or manual; empty searches all of them.
Inputs: query (required), tags, after, limit, +2 more. Returns: result
memory_storeA
Store text exactly as written. Put tags in metadata, as {"tags": ["a", "b"]}.
Use memory_store_session instead when you want facts extracted from a chat.
Inputs: content (required), metadata, conversation_id. Returns: result
memory_store_sessionB
Send a conversation to be turned into facts, preferences and a summary.
turns is a list of {"role": "user" or "assistant", "content": "..."}. Extraction runs in the background and takes about a minute. Tags and metadata are ignored: extracted memories cannot carry them.
Inputs: turns (required), session_id (required), tags, metadata. Returns: result
memory_updateC
Change a memory. updates may hold content (new text) and tags (new tag list).
Tags may also be given as {"metadata": {"tags": [...]}}. Passing tags replaces the existing ones.
Inputs: updates (required), content_hash (required), preserve_timestamps. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool maps to a distinct operation (store raw, store from session, search, list, delete, update), and the descriptions explicitly disambiguate the closest pair (memory_store vs memory_store_session). The only residual confusion is memory_list vs memory_search for retrieval and how memory_update identifies its target.
All names follow the same memory_<verb> snake_case convention with a consistent shared prefix. memory_store_session is a natural extension rather than a deviation.
Six tools is well-scoped for a memory service: write paths, read paths, mutation, and deletion. No obviously redundant or missing surface-level tool.
The lifecycle is essentially covered: store, ingest session, search, list, update, delete (with dry_run). Minor gaps: memory_update does not state how the target memory is identified, and there is no dedicated get-by-hash tool, though search/list partially compensate.
Related MCP Connectors
Persistent memory for AI agents: add, search, update, and delete long-term memories.
Persistent cloud memory for AI agents. Store and search key-value memories across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Zero-knowledge encrypted AI memory you own. Search, read and edit it from any agent; calls are free.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable long-term memory across sessions, enabling storage, full-text retrieval, updates, GDPR-compliant deletion, session summaries, and cross-referencing with per-namespace isolation.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to store, recall, update, delete, and analyze persistent memories with semantic search, decay, and anomaly retrieval across hosted, self-hosted, or fully local storage modes.80 npm23MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to store, search, list, and forget long-term memories in a fixed namespace backed by S3-compatible storage, with optional read-only mode and provenance-tagged recall results.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP hosts and AI agents to store, recall, and forget private local long-term memories using hybrid semantic/full-text search, workspace isolation, recency and importance ranking, and automatic PII/secret redaction.MIT