Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsApr 7, 2026·2 min de lecture

Memory MCP — Persistent AI Agent Knowledge Graph

MCP server that gives AI agents persistent memory using a local knowledge graph. Stores entities, relationships, and observations across sessions for Claude Code.

MCP Hub
MCP Hub · Community
Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
Mcp Config
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Memory MCP — Persistent AI Agent Knowledge Graph
Commande de staging sûr
npx -y tokrepo@latest install 554c4dc2-663c-489a-b57f-814948e9f714 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

TL;DR
Memory MCP stores entities, relationships, and observations in a local knowledge graph so AI agents remember across sessions.
§01

What it is

Memory MCP is a Model Context Protocol server that provides AI agents with persistent memory via a local knowledge graph. The agent can create entities (people, projects, concepts), add observations about them, and define relationships between them. This structured memory persists across sessions.

It is part of the official MCP server collection and targets developers who want their AI agents to build and maintain a knowledge base over time rather than starting fresh each conversation.

§02

How it saves time or tokens

Without persistent memory, every AI conversation starts from zero. You re-explain your project structure, preferences, and context. Memory MCP lets the agent store and retrieve this information, reducing repeated context-setting.

The estimated token cost for this workflow is approximately 4,000 tokens. The knowledge graph format is more structured than raw text memory, making retrieval more precise.

§03

How to use

  1. Add to your MCP configuration:
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}
  1. Restart Claude Code or your MCP-compatible agent.
  1. The agent now has tools to create entities, add observations, and query the knowledge graph:
You: Remember that our project uses PostgreSQL 16 with pgvector
Agent: I will store this in my knowledge graph...
[Creates entity: 'Project Database' with observation: 'Uses PostgreSQL 16 with pgvector']
§04

Example

// Example knowledge graph operations the agent performs:

// Create an entity
{"tool": "create_entities", "entities": [
  {"name": "TokRepo", "entityType": "project",
   "observations": ["Nuxt 3 + Go-Zero stack", "Port 3001 frontend"]}
]}

// Create a relationship
{"tool": "create_relations", "relations": [
  {"from": "TokRepo", "to": "PostgreSQL", "relationType": "uses"}
]}

// Search memory
{"tool": "search_nodes", "query": "database"}
// Returns: TokRepo -> uses -> PostgreSQL
§05

Related on TokRepo

§06

Common pitfalls

  • The knowledge graph is stored as a local JSON file. If you delete the file, all memory is lost. Back it up if the data matters.
  • Memory MCP stores everything the agent decides to remember. Over time the graph can grow large. Periodically review and prune irrelevant entities.
  • The agent must be explicitly asked to remember or check memory. It does not automatically store or retrieve information unless prompted.

Questions fréquentes

Where is the knowledge graph stored?+

By default, Memory MCP stores the knowledge graph as a JSON file in the local filesystem. The exact location depends on your MCP configuration. You can specify a custom path via environment variables.

Can multiple agents share the same memory?+

Yes. If two MCP clients point to the same memory file, they share the knowledge graph. However, there is no built-in conflict resolution for concurrent writes.

What is the difference between Memory MCP and a vector database?+

Memory MCP stores structured entities and relationships in a knowledge graph. Vector databases store embeddings for semantic search. Memory MCP is better for facts and relationships; vector databases are better for fuzzy similarity search.

Does the agent automatically remember things?+

The agent uses the memory tools when it determines information should be stored or retrieved. You can prompt it to remember specific facts, or configure system prompts that instruct the agent to actively use its memory.

Can I view or edit the knowledge graph manually?+

Yes. The knowledge graph is stored as a JSON file that you can open and edit with any text editor. The format uses entities, observations, and relations arrays.

Sources citées (3)
🙏

Source et remerciements

Created by Anthropic. Licensed under MIT.

modelcontextprotocol/servers — Part of the official MCP servers collection

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires