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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.