Best Knowledge & Memory MCP Servers for AI agents.
Agents forget everything between sessions. These servers fix that — with knowledge graphs, markdown vaults, and memory models borrowed from cognitive science.
Every LLM session starts from zero. Knowledge and memory MCP servers attack that statelessness directly: the agent writes facts, decisions, and context to a persistent store during work, then recalls them in the next session as if the conversation never ended.
What makes this category interesting is how differently the servers solve the same problem — knowledge graphs, plain markdown files, vector recall, and even memory-decay models lifted from cognitive psychology all coexist in the listings below.
Knowledge & Memory MCP servers on the Loomal Index
Codebase Memory
Codebase knowledge graph for AI agents — 159 languages, sub-ms queries, 99% fewer tokens.
basic-memory
Local-first knowledge management with bi-directional LLM sync via Markdown files.
tradememory-protocol
MCP memory for AI trading agents. Store trades, recall similar setups, track strategy performance.
mcp-neo4j-memory
MCP Neo4j Knowledge Graph Memory Server
ori-memory
Persistent memory infrastructure for AI agents. Identity, knowledge graph, and search.
YourMemory
Persistent memory for AI agents. Memories decay with time and strengthen on recall.
cognitive-ai-memory
Ebbinghaus-based persistent memory for Claude. Memories decay with time, strengthen on recall.
shodh-memory
Cognitive memory for AI agents — semantic search, Hebbian learning, knowledge graphs.
neural-memory
Persistent memory for AI agents — 55 MCP tools, spreading activation recall.
superlocalmemory
Local-first AI memory with knowledge graphs and hybrid search. 17+ AI tools via MCP. Free.
in-memoria
Persistent codebase intelligence that gives AI assistants memory across sessions
context-sync
Universal AI Memory - Sync context across Claude, VsCode, Cursor, Continue, Windsurf, Zed & more
Showing 12 of 169 live Knowledge & Memory servers — browse them all on the marketplace.
What memory MCP servers do
The contract is simple: store and recall, exposed as tools. Codebase Memory — the category's star leader — builds a knowledge graph over your code in 159 languages with sub-millisecond queries, claiming 99% fewer tokens than re-reading source. basic-memory takes the opposite philosophy: local-first knowledge management in plain Markdown files with bi-directional LLM sync, so your memory store is also a folder you can read, edit, and version yourself.
Graph-backed options sit in between — mcp-neo4j-memory persists agent knowledge as a Neo4j graph, and ori-memory combines identity, a knowledge graph, and search into one memory layer.
Decay, reinforcement, and other cognitive tricks
A distinctive sub-genre here models memory on how brains work. YourMemory and cognitive-ai-memory implement Ebbinghaus-style forgetting: memories decay with time and strengthen on recall, so what the agent retrieves is weighted toward what actually keeps mattering. shodh-memory layers Hebbian learning over semantic search and knowledge graphs, and neural-memory uses spreading-activation recall across 55 tools.
This isn't academic flourish — naive memory stores accumulate junk until recall returns noise. Decay and reinforcement are pruning strategies, and they're the main axis on which these servers compete.
What to look for when choosing
Decide where the data lives first: local-first servers like basic-memory and superlocalmemory keep everything on your disk, which matters if memories include proprietary code or client details. Then match the structure to the job — a knowledge graph (Codebase Memory, mcp-neo4j-memory) excels at relational queries, markdown vaults excel at human auditability, and specialized stores like tradememory-protocol exist for one domain (trading agents recalling similar setups). Finally check recall quality and token cost: a memory server that returns ten loosely-related blobs costs more than it saves.
How agents use memory in practice
The working pattern is write-during, recall-at-start. During a session the agent records decisions, preferences, and facts as they surface; at the start of the next session it queries memory before doing anything else. Tools like in-memoria apply this to codebase intelligence across sessions, and context-sync extends it sideways — syncing context across Claude, Cursor, Continue, Windsurf, and Zed so the memory follows you between clients rather than living in one.
Where paid memory fits
Local-first servers are open source and free to run, and for private memory that's usually the right call. Hosted memory — shared across a team's agents, or too large to keep on a laptop — is a natural per-call service: maintainers can claim their Loomal listing and price store and recall operations from $0.01 in USDC via x402, settled on Base. Loomal's 5% fee on settled transactions is currently waived.
Frequently asked questions
What are the best knowledge and memory MCP servers?
Codebase Memory leads for code-aware knowledge graphs, and basic-memory is the strongest local-first markdown option. If recall quality over time is your concern, the decay-based servers — YourMemory, cognitive-ai-memory, shodh-memory — are designed for exactly that.
Where does the memory actually get stored?
It depends on the server. basic-memory and superlocalmemory write to local files; mcp-neo4j-memory persists to a Neo4j database you control; hosted options keep it server-side. For sensitive work, prefer local-first servers where the store is a folder you can inspect and delete.
Why do some memory servers deliberately forget things?
Because unbounded memory degrades recall — every query has to fight through stale, irrelevant entries. Decay models drop what's never recalled and strengthen what is, keeping the store small and the retrieved context relevant. It's a feature, not data loss.
How do I list my memory MCP server on Loomal?
Publish it to the official MCP registry, wait for Loomal's index to pick it up, then claim the listing via GitHub verification. Hosted endpoints can attach x402 per-call pricing from the console; the minimum price is $0.01 per call.
Run a Knowledge & Memory MCP server?
Claim your listing, set a per-call USDC price, and let AI agents pay for every call over x402.
List it on Loomal