← Open Source
shaneholloman

mcp-knowledge-graph

MCP server enabling persistent memory for Claude through a local knowledge graph - fork focused on local development.

AI EngineeringGive agent knowledgeJavaScript
Open on GitHub
Momentum
+-1stars in 24 hours-0.1%
885
Stars
103
Forks
+-5
This week
1
Contributors
Created 2024-12-09 · Updated 2026-10-16 · #19033 today
Top developers
shaneholloman

shaneholloman/mcp-knowledge-graph is ranked 19,033 with 885 stars.

Same-category comparison

shaneholloman/mcp-knowledge-graph is ranked 19,033 among these 8 peers; fivetaku/fablize is ranked 19,028.

Same-category comparison
NameRankMetrics
livekit/agents-js19,013
Language:
TypeScript
Stars:
942
Forks:
398
Description:
Build realtime multimodal AI agents with Node.js.
grft-dev/graftcode19,017
Language:
PowerShell
Stars:
927
Forks:
11
Description:
Connect any code. Call as dependency. The official repository for Graftcode: the integration-free development layer that lets you call methods across languages and runtimes on remote services as if they were local. Eliminate integration layer code entirely.
1038lab/ComfyUI-QwenVL19,020
Language:
Python
Stars:
916
Forks:
147
Description:
ComfyUI-QwenVL custom node: Integrates the Qwen-VL series, including Qwen2.5-VL, Qwen3-VL, Qwen3.5-VL, Qwen3.6-VL (MoE), and Qwen3.8-VL, with GGUF support for advanced multimodal AI in text generation, image understanding, and video analysis.
fivetaku/fablize19,028
Language:
Python
Stars:
895
Forks:
125
Git-on-my-level/codex-autorunner19,039
Language:
Python
Stars:
875
Forks:
73
shadcnio/react-shadcn-components19,041
Stars:
869
Forks:
43
Description:
Production-ready React components following shadcn/ui principles. TypeScript-first, Tailwind-styled, Radix-powered. Beautiful defaults with complete customization freedom. The frontend UI toolkit for vibecoders who ship fast and own their code.
xdevplatform/xmcp19,044
Language:
Python
Stars:
862
Forks:
125
Description:
MCP server for the X API.
sangrokjung/claude-forge19,049
Language:
Shell
Stars:
856
Forks:
183
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageJavaScript
CategoryAI Engineering
SubcategoryGive agent knowledge
KeywordsMCP, Memory management
Stars885
Forks103
Contributors1
Created date2024-12-09
Updated date2026-10-16
Stars in 1 day-1
Stars in 7 days-5
Rank19,033
Previous rank12,801
Rank change-6,232
7-day stars rank18,836
Previous 7-day stars rank18,688
7-day stars rank change-148
Total stars rank12,262
Previous total stars rank12,229
Total stars rank change-33
CountryNew Zealand
README summary

MCP Knowledge Graph **Persistent memory for AI models through a local knowledge graph. ** Store and retrieve information across conversations using entities, relations, and observations. Works with Claude Code/Desktop and any MCP-compatible AI platform. AIM stands for **AI Memory** - the core concept of this system. The three AIM elements provide clear organization and safety: ** directories**: Keep AI memory files organized and easily identifiable ** tool prefixes**: Group related memory functions together in multi-tool setups ** safety markers**: Each memory file

starts with to prevent accidental overwrites of unrelated JSONL files This consistent AIM naming makes it obvious which directories, tools, and files belong to the AI memory system. **Project with ** - Uses (project-local) 2. aim** - Uses configured global directory 3. **Contexts** - Adds suffix: , **Safety System:** Every memory file starts with System refuses to write to files without this marker Prevents accidental overwrite of unrelated JSONL files Master Database Concept **The master database is your primary memory store** - used by default

when no specific database is requested. It's always named in listings and stored as . **Default Behavior**: All memory operations use the master database unless you specify a different one **Always Available**: Exists in both project-local and global locations **Primary Storage**: Your main knowledge graph that persists across all conversations **Named Databases**: Optional additional databases ( , , ) for organizing specific topics Key Features **Master Database**: Primary memory store used by default for all operations **Multiple Databases**: Optional named databases for organizing memories

by topic **Project Detection**: Automatic project-local memory using directories **Location Override**: Force operations to use project or global storage **Safe Operations**: Built-in protection against overwriting unrelated files **Database Discovery**: List all available databases in both locations Quick Start Global Memory (Recommended) Add to your or . Two common approaches: **Option 1: Default directory (simple)** **Option 2: Dropbox/cloud sync (portable)** For accessing memories across multiple machines, use a synced folder. This is how the author of this MCP server

keeps his own memories: This creates memory files in your specified directory: - **Master Database** (default for all operations) - Work database - Personal database etc. Project-Local Memory In any project, create a directory: Now memory tools automatically use (project-local **master database**) instead of global storage when run from this project. How AI Uses Databases Once configured, AI models use the **master database by default** or can specify named databases with a parameter. New databases are created automatically - no setup required

: File Organization **Global Setup:** **Project Setup:** Available Tools - Store new memories (people, projects, concepts) - Add facts to existing memories - Link two memories together - Search memories by keyword - Retrieve specific memories by exact name - Read all memories in a database - List available databases - Forget memories - Remove specific facts from a memory - Remove links between memories Parameters (optional) - Specify named database ( , , etc. Defaults to **master database** (optional) - Force or storage location. Defaults to auto-detection Database Discovery Use to see all available

databases: **Key Points:** **"default"** = Master Database in both locations **Current location** shows whether you're using project or global storage **Master

Frequently asked questions

How many stars and forks are recorded?

shaneholloman/mcp-knowledge-graph has 885 stars and 103 forks.

What is the repository rank?

shaneholloman/mcp-knowledge-graph is ranked 19,033.

What language and category are recorded?

shaneholloman/mcp-knowledge-graph has 885 stars, uses JavaScript and belongs to AI Engineering.

Which repository is closest in rank?

shaneholloman/mcp-knowledge-graph is compared with fivetaku/fablize, ranked 19,028 with 895 stars.

README

MCP Knowledge Graph

Persistent memory for AI models through a local knowledge graph.

Store and retrieve information across conversations using entities, relations, and observations. Works with Claude Code/Desktop and any MCP-compatible AI platform.

Why ".aim" and "aim_" prefixes?

AIM stands for AI Memory - the core concept of this system. The three AIM elements provide clear organization and safety:

  • .aim directories: Keep AI memory files organized and easily identifiable
  • aim_ tool prefixes: Group related memory functions together in multi-tool setups
  • _aim safety markers: Each memory file starts with {"type":"_aim","source":"mcp-knowledge-graph"} to prevent accidental overwrites of unrelated JSONL files

This consistent AIM naming makes it obvious which directories, tools, and files belong to the AI memory system.

CRITICAL: Understanding .aim dir vs _aim file marker

Two different things with similar names:

  • .aim = Project-local directory name (MUST be named exactly .aim for project detection to work)
  • _aim = File safety marker (appears inside JSONL files: {"type":"_aim","source":"mcp-knowledge-graph"})

For project-local storage:

  • Directory MUST be named .aim in your project root
  • Example: my-project/.aim/memory.jsonl
  • The system specifically looks for this exact name

For global storage (--memory-path):

  • Can be ANY directory you want
  • Examples: ~/yourusername/.aim/, ~/memories/, ~/Dropbox/ai-memory/, ~/Documents/ai-data/
  • Complete flexibility - choose whatever location works for you

Storage Logic

File Location Priority:

  1. Project with .aim - Uses .aim/memory.jsonl (project-local)
  2. No project/no .aim - Uses configured global directory
  3. Contexts - Adds suffix: memory-work.jsonl, memory-personal.jsonl

Safety System:

  • Every memory file starts with {"type":"_aim","source":"mcp-knowledge-graph"}
  • System refuses to write to files without this marker
  • Prevents accidental overwrite of unrelated JSONL files

Master Database Concept

The master database is your primary memory store - used by default when no specific database is requested. It's always named default in listings and stored as memory.jsonl.

  • Default Behavior: All memory operations use the master database unless you specify a different one
  • Always Available: Exists in both project-local and global locations
  • Primary Storage: Your main knowledge graph that persists across all conversations
  • Named Databases: Optional additional databases (work, personal, health) for organizing specific topics

Key Features

  • Master Database: Primary memory store used by default for all operations
  • Multiple Databases: Optional named databases for organizing memories by topic
  • Project Detection: Automatic project-local memory using .aim directories
  • Location Override: Force operations to use project or global storage
  • Safe Operations: Built-in protection against overwriting unrelated files
  • Database Discovery: List all available databases in both locations

Quick Start

Global Memory (Recommended)

Add to your claude_desktop_config.json or .claude.json. Two common approaches:

Option 1: Default .aim directory (simple)

{
  "mcpServers": {
    "Aim-Memory-Bank": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/.aim"
      ]
    }
  }
}

Option 2: Dropbox/cloud sync (portable)

For accessing memories across multiple machines, use a synced folder. This is how the author of this MCP server keeps his own memories:

{
  "mcpServers": {
    "Aim-Memory-Bank": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-knowledge-graph",
        "--memory-path",
        "/Users/yourusername/Dropbox/ai-memory"
      ]
    }
  }
}

This creates memory files in your specified directory:

  • memory.jsonl - Master Database (default for all operations)
  • memory-work.jsonl - Work database
  • memory-personal.jsonl - Personal database
  • etc.

Project-Local Memory

In any project, create a .aim directory:

mkdir .aim

Now memory tools automatically use .aim/memory.jsonl (project-local master database) instead of global storage when run from this project.

How AI Uses Databases

Once configured, AI models use the master database by default or can specify named databases with a context parameter. New databases are created automatically - no setup required:

// Master Database (default - no context needed)
aim_memory_store({
  entities: [{
    name: "John_Doe",
    entityType: "person",
    observations: ["Met at conference"]
  }]
})

// Work database
aim_memory_store({
  context: "work",
  entities: [{
    name: "Q4_Project",
    entityType: "project",
    observations: ["Due December 2024"]
  }]
})

// Personal database
aim_memory_store({
  context: "personal",
  entities: [{
    name: "Mom",
    entityType: "person",
    observations: ["Birthday March 15th"]
  }]
})

// Master database in specific location
aim_memory_store({
  location: "global",
  entities: [{
    name: "Important_Info",
    entityType: "reference",
    observations: ["Stored in global master database"]
  }]
})

File Organization

Global Setup:

/Users/yourusername/.aim/
├── memory.jsonl           # Master Database (default)
├── memory-work.jsonl      # Work database
├── memory-personal.jsonl  # Personal database
└── memory-health.jsonl    # Health database

Project Setup:

my-project/
├── .aim/
│   ├── memory.jsonl       # Project Master Database (default)
│   └── memory-work.jsonl  # Project Work database
└── src/

Available Tools

  • aim_memory_store - Store new memories (people, projects, concepts)
  • aim_memory_add_facts - Add facts to existing memories
  • aim_memory_link - Link two memories together
  • aim_memory_search - Search memories by keyword
  • aim_memory_get - Retrieve specific memories by exact name
  • aim_memory_read_all - Read all memories in a database
  • aim_memory_list_stores - List available databases
  • aim_memory_forget - Forget memories
  • aim_memory_remove_facts - Remove specific facts from a memory
  • aim_memory_unlink - Remove links between memories

Parameters

  • context (optional) - Specify named database (work, personal, etc.). Defaults to master database
  • location (optional) - Force project or global storage location. Defaults to auto-detection

Database Discovery

Use aim_memory_list_stores to see all available databases:

{
  "project_databases": [
    "default",      // Master Database (project-local)
    "project-work"  // Named database
  ],
  "global_databases": [
    "default",      // Master Database (global)
    "work",
    "personal",
    "health"
  ],
  "current_location": "project (.aim directory detected)"
}

Key Points:

  • "default" = Master Database in both locations
  • Current location shows whether you're using project or global storage
  • Master database exists everywhere - it's your primary memory store
  • Named databases are optional additions for specific topics

Configuration Examples

Important: Always specify --memory-path to control where your memory files are stored.

Auto-approve read operations (recommended):

{
  "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"
      ]
    }
  }
}

Troubleshooting

"File does not contain required _aim safety marker" error:

  • The file may not belong to this system
  • Manual JSONL files need {"type":"_aim","source":"mcp-knowledge-graph"} as first line
  • If you created the file manually, add the _aim marker or delete and let the system recreate it

Memories going to unexpected locations:

  • Check if you're in a project directory with .aim folder (uses project-local storage)
  • Otherwise uses the configured global --memory-path directory
  • Use aim_memory_list_stores to see all available databases and current location
  • Use ls .aim/ or ls /Users/yourusername/.aim/ to see your memory files

Too many similar databases:

  • AI models try to use consistent names, but may create variations
  • Manually delete unwanted database files if needed
  • Encourage AI to use simple, consistent database names
  • Remember: Master database is always available as the default - named databases are optional

Requirements

  • Node.js 22+
  • MCP-compatible AI platform

License

MIT

Nearby in the ranking
Similar items