by IzumiSy
Provides a knowledge‑graph memory server backed by DuckDB, enabling fast, scalable storage, fuzzy search, and relational queries over entities, observations, and relations.
MCP DuckDB Memory Server is a fork of the official Model Context Protocol (MCP) Knowledge Graph Memory Server that replaces the JSON file backend with an embedded DuckDB database. It stores entities, observations, and relations in relational tables, allowing efficient analytical queries and fuzzy text matching.
npx -y @smithery/cli install @IzumiSy/mcp-duckdb-memory-server --client claude
claude_desktop_config.json):
{
"mcpServers": {
"graph-memory": {
"command": "npx",
"args": ["-y", "@izumisy/mcp-duckdb-memory-server"],
"env": { "MEMORY_FILE_PATH": "/path/to/your/memory.data" }
}
}
}
docker build -t mcp-duckdb-graph-memory .
docker run -dit mcp-duckdb-graph-memory
MEMORY_FILE_PATH.npx command.Q: Do I need to install DuckDB separately? A: No. DuckDB is embedded and bundled with the npm package.
Q: How do I change the location of the memory file?
A: Set the MEMORY_FILE_PATH environment variable in the server configuration.
Q: Can I run the server without Docker?
A: Yes. Installing the npm package and invoking it via npx is sufficient.
Q: How does fuzzy search work? A: The server first fetches candidate rows with SQL, then applies Fuse.js on the returned strings to rank exact and partial matches.
Q: Is the data persisted across restarts? A: Yes. As long as the same DuckDB file is used, all entities, observations, and relations are retained.
A forked version of the official Knowledge Graph Memory Server.
To install DuckDB Knowledge Graph Memory Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @IzumiSy/mcp-duckdb-memory-server --client claude
Otherwise, add @IzumiSy/mcp-duckdb-memory-server in your claude_desktop_config.json manually (MEMORY_FILE_PATH is optional)
{
"mcpServers": {
"graph-memory": {
"command": "npx",
"args": [
"-y",
"@izumisy/mcp-duckdb-memory-server"
],
"env": {
"MEMORY_FILE_PATH": "/path/to/your/memory.data"
}
}
}
}
The data stored on that path is a DuckDB database file.
Build
docker build -t mcp-duckdb-graph-memory .
Run
docker run -dit mcp-duckdb-graph-memory
Use the example instruction below
Follow these steps for each interaction:
1. User Identification:
- You should assume that you are interacting with default_user
- If you have not identified default_user, proactively try to do so.
2. Memory Retrieval:
- Always begin your chat by saying only "Remembering..." and search relevant information from your knowledge graph
- Create a search query from user words, and search things from "memory". If nothing matches, try to break down words in the query at first ("A B" to "A" and "B" for example).
- Always refer to your knowledge graph as your "memory"
3. Memory
- While conversing with the user, be attentive to any new information that falls into these categories:
a) Basic Identity (age, gender, location, job title, education level, etc.)
b) Behaviors (interests, habits, etc.)
c) Preferences (communication style, preferred language, etc.)
d) Goals (goals, targets, aspirations, etc.)
e) Relationships (personal and professional relationships up to 3 degrees of separation)
4. Memory Update:
- If any new information was gathered during the interaction, update your memory as follows:
a) Create entities for recurring organizations, people, and significant events
b) Connect them to the current entities using relations
b) Store facts about them as observations
This project enhances the original MCP Knowledge Graph Memory Server by replacing its backend with DuckDB.
The original MCP Knowledge Graph Memory Server used a JSON file as its data store and performed in-memory searches. While this approach works well for small datasets, it presents several challenges:
DuckDB was chosen to address these challenges:
This implementation uses DuckDB as the backend storage system, focusing on two key aspects:
The knowledge graph is stored in a relational database structure as shown below:
This schema design allows for efficient storage and retrieval of knowledge graph components while maintaining the relationships between entities, observations, and relations.
The implementation combines SQL queries with Fuse.js for flexible entity searching:
pnpm install
pnpm test
This project is licensed under the MIT License - see the LICENSE file for details.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
by topoteretes
Provides dynamic memory for AI agents through modular ECL (Extract, Cognify, Load) pipelines, enabling seamless integration with graph and vector stores using minimal code.
by basicmachines-co
Enables persistent, local‑first knowledge management by allowing LLMs to read and write Markdown files during natural conversations, building a traversable knowledge graph that stays under the user’s control.
by smithery-ai
Provides read and search capabilities for Markdown notes in an Obsidian vault for Claude Desktop and other MCP clients.
by chatmcp
Summarize chat messages by querying a local chat database and returning concise overviews.
by dmayboroda
Provides on‑premises conversational retrieval‑augmented generation (RAG) with configurable Docker containers, supporting fully local execution, ChatGPT‑based custom GPTs, and Anthropic Claude integration.
by qdrant
Provides a Model Context Protocol server that stores and retrieves semantic memories using Qdrant vector search, acting as a semantic memory layer.
by doobidoo
Provides a universal memory service with semantic search, intelligent memory triggers, OAuth‑enabled team collaboration, and multi‑client support for Claude Desktop, Claude Code, VS Code, Cursor and over a dozen AI applications.
by GreatScottyMac
Provides a project‑specific memory bank that stores decisions, progress, architecture, and custom data, exposing a structured knowledge graph via MCP for AI assistants and IDE tools.
{
"mcpServers": {
"graph-memory": {
"command": "npx",
"args": [
"-y",
"@izumisy/mcp-duckdb-memory-server"
],
"env": {
"MEMORY_FILE_PATH": "/path/to/your/memory.data"
}
}
}
}claude mcp add graph-memory npx -y @izumisy/mcp-duckdb-memory-server