MCP Memory SQLite
Provides persistent memory and knowledge graph capabilities for AI assistants using local SQLite storage. Enables creating, searching, and managing entities, relationships, and observations with vector search support across conversations.
README
mcp-memory-sqlite
A personal knowledge graph and memory system for AI assistants using SQLite and vector search. Perfect for giving Claude (or any MCP-compatible AI) persistent memory across conversations!
Why Use This?
Give your AI assistant a memory! This tool lets Claude (or other AI assistants) remember entities, concepts, and their relationships across conversations. Perfect for:
- 📚 Personal Knowledge Management - Build your own knowledge graph
- 🤖 AI Assistant Memory - Help Claude remember important information about your projects, preferences, and context
- 🔗 Relationship Tracking - Connect ideas, people, projects, and concepts
- 🔍 Smart Search - Find information using text search or semantic similarity
Features
- 100% Local & Private: All your data stays on your machine
- Easy Setup: Works out-of-the-box with Claude Desktop
- Flexible Search: Case-insensitive text search that handles different naming conventions
- Vector Search: Semantic similarity using OpenAI-compatible embeddings (1536 dimensions)
- Smart Deduplication: Automatically prevents duplicate relationships
- Simple API: Intuitive tools for creating, searching, and managing your knowledge graph
Quick Start
For Claude Desktop users (recommended):
Add this to your Claude Desktop config:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "mcp-memory-sqlite"]
}
}
}
That's it! Claude can now remember things across conversations.
Installation
If you want to use it in your own project:
npm install mcp-memory-sqlite
# or
pnpm add mcp-memory-sqlite
Configuration
Optional: Customize the database location with an environment variable:
SQLITE_DB_PATH: Where to store your data (default:./sqlite-memory.db)
MCP Tools
create_entities
Create or update entities with observations and optional embeddings.
Parameters:
entities: Array of entity objectsname(string): Unique entity identifierentityType(string): Type/category of the entityobservations(string[]): Array of observation stringsembedding(number[], optional): 1536-dimensional vector for semantic search
Example:
{
"entities": [
{
"name": "Claude",
"entityType": "AI Assistant",
"observations": [
"Created by Anthropic",
"Focuses on being helpful, harmless, and honest"
],
"embedding": [0.1, 0.2, ...] // 1536 dimensions
}
]
}
search_nodes
Search for entities and their relations using text or vector similarity.
Parameters:
query: String for text search OR array of numbers for vector similarity search
Text Search Example:
{
"query": "AI Assistant"
}
Text Search Features:
- Case-insensitive: Searches ignore case differences
- Flexible matching: Automatically handles variations in spacing,
underscores, and hyphens
- "JavaScript framework" will match "javascript_framework"
- "web-development" will match "web_development" or "web development"
- Searches across: Entity names, entity types, and all observations
Vector Search Example:
{
"query": [0.1, 0.2, 0.3, ...] // 1536 dimensions
}
read_graph
Get recent entities and their relations (returns last 10 entities by default).
Parameters: None
create_relations
Create relationships between entities. Duplicate relations (same source, target, and type) are automatically ignored.
Parameters:
relations: Array of relation objectssource(string): Source entity nametarget(string): Target entity nametype(string): Relationship type
Example:
{
"relations": [
{
"source": "Claude",
"target": "Anthropic",
"type": "created_by"
}
]
}
Note: If you attempt to create the same relation multiple times, only the first one will be stored. This prevents duplicate relationships in your knowledge graph.
delete_entity
Delete an entity and all associated data (observations and relations).
Parameters:
name(string): Entity name to delete
delete_relation
Delete a specific relation between entities.
Parameters:
source(string): Source entity nametarget(string): Target entity nametype(string): Relationship type
Usage with Claude Desktop
Add to your Claude Desktop configuration:
Minimal configuration (uses default ./sqlite-memory.db):
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "mcp-memory-sqlite"]
}
}
}
With custom database path:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "mcp-memory-sqlite"],
"env": {
"SQLITE_DB_PATH": "/path/to/your/memory.db"
}
}
}
}
Database Schema
The tool uses SQLite with the sqlite-vec extension for vector operations:
Regular Tables
- entities: Stores entity metadata (name, type, creation time)
- observations: Stores observations linked to entities
- relations: Stores relationships between entities
Virtual Table
- entities_vec: Virtual table using vec0 for 1536-dimensional vector embeddings
Vector Embeddings
The tool expects 1536-dimensional float vectors, compatible with:
- OpenAI text-embedding-ada-002
- OpenAI text-embedding-3-small
- Other models producing 1536-dimensional embeddings
To generate embeddings, you can use:
- OpenAI Embeddings API
- Local embedding models like sentence-transformers
- Other embedding services that produce 1536-dim vectors
Development
# Install dependencies
pnpm install
# Build
pnpm run build
# Run in development mode
pnpm run dev
# Run tests
pnpm test
How It Works
Under the hood, this uses:
- SQLite for fast, reliable local storage
- sqlite-vec for vector similarity search
- better-sqlite3 for Node.js integration
Your data is stored in a single .db file on your computer - no
cloud, no external services, completely private.
License
MIT
Credits
Built with:
- better-sqlite3 - Fast SQLite driver
- sqlite-vec - Vector search extension
- tmcp - MCP server framework
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。