← Back to directory
M

mcp-knowledge-graph

Community
Persistent memory for AI models through a local knowledge graph.
GitHub source repository ↗
★ 885 Stars Category · Database Very popular Source revision 9f6268c4b5df
56FMRS · C
Reliability
7/20
Security and permissions
11/20
Maintenance
8/20
Documentation
16/20
Setup experience
14/20

This server offers a flexible and safe design for AI memory management, supporting project-local and global storage with multi-database features. Installation is straightforward, though compatibility with Claude API needs verification.

Read the FMRS scoring method →

mcp-knowledge-graph is an MCP server that enables AI models (like Claude) to store and retrieve information across conversations. It uses entities, relations, and observations to build a knowledge graph, and supports multiple databases (master and named) as well as project-local or global storage. The server emphasizes safety with file markers (_aim) to prevent accidental overwrites of unrelated files. It is designed for local development, suitable for users who want their AI assistant to remember long-term information.

Tools

aim_memory_store
Stores new memories (people, projects, concepts) into the knowledge graph.
aim_memory_add_facts
Adds facts to existing memories.
aim_memory_link
Links two memories together.
aim_memory_search
Searches memories by keyword.
aim_memory_get
Retrieves specific memories by exact name.
aim_memory_read_all
Reads all memories in a database.
aim_memory_list_stores
Lists all available databases.
aim_memory_forget
Forgets memories.
aim_memory_remove_facts
Removes specific facts from a memory.
aim_memory_unlink
Removes links between memories.

Setup

Prerequisites: Node.js 22+. Setup: Add the MCP server configuration to your Claude client configuration file, specifying a local path (e.g., --memory-path), then start the client to automatically install and run.

claude_desktop_config.json
{
  "mcpServers": {
    "Aim-Memory-Bank": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ],
      "autoapprove": [
        "aim_memory_search",
        "aim_memory_get",
        "aim_memory_read_all",
        "aim_memory_list_stores"
      ]
    }
  }
}

Fit and risk

Best for

  • Claude users who need persistent memory across conversations
  • Developers who want local persistent memory in their projects
  • Users concerned about data privacy and prefer local storage over cloud

Not for

  • Scenarios requiring distributed or high-concurrency storage
  • Advanced security needs like built-in encryption or access control
  • Users who wish to store memory files in the cloud managed by a service provider

Required permissions

  • Read and write to the local file system (within specified --memory-path or project .aim directory)
  • Run npx commands to start the server

Risks and side effects

  • Local files might be accidentally deleted or overwritten (the system has _aim marker protection, but risk remains)
  • Sensitive information stored locally could be exposed if not encrypted
  • Dependency on Node.js version and npm package management may cause conflicts

Troubleshooting

  1. If you encounter 'File does not contain required _aim safety marker' error, ensure the file starts with the correct marker or delete the file and let the system recreate it.
  2. If memories appear in unexpected locations, check if you are in a project directory with a .aim folder, and use aim_memory_list_stores to see the current storage location.
  3. If too many similar databases, manually delete unwanted .jsonl files and encourage the AI to use consistent naming.

Use cases

Personal memory management: Let AI assistants remember your preferences, birthdays, project info, etc.
Project-local memory: Create a .aim folder in your project directory to automatically use project-level memory.
Cross-device sync: Use a cloud-synced directory like Dropbox to store memory files for multi-device access.

Supported clients

Claude DesktopFull support
Claude CodeFull support