The memvid-mcp server provides persistent memory management for AI agents with hybrid search, knowledge graphs, and RAG capabilities through 40 tools wrapping the memvid Rust CLI.
Memory Lifecycle: Create, open, verify, and repair .mv2 memory files with SQLite-based storage. View statistics, encrypt/decrypt with AES-256-GCM, and diagnose corrupted indexes.
Content Operations: Ingest content from files, directories, or URLs with optional vector embeddings. Batch import with progress tracking, view/update/delete frames, correct frames with audit trails, and export to JSON/CSV/JSONL.
Search & Retrieval: Hybrid search combining lexical (Tantivy full-text) and vector (semantic) search, vector-only searches, temporal search to find when information was mentioned, timeline views, and RAG for question answering with context.
Knowledge Graph: Extract entities via NER, entity lookup, relationship traversal with configurable hop depth, memory cards for entity tracking, and fact extraction for structured knowledge.
Session Management: Record, replay, list, and manage agent interaction sessions for debugging and analysis. Handle process queues and memory binding operations.
Analysis & Diagnostics: Generate audit reports with citations and snippets, schema inference, debug segment information, view system status and configuration, and list embedding models.
Security: Path traversal protection, system path blocklisting, MCP roots validation, and file encryption for sensitive data.
Integrates with OpenAI's embedding and language models to enable semantic vector search and Retrieval-Augmented Generation (RAG) for agent memory.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memvid-mcpsearch for 'API endpoints' in my project-notes.mv2 file"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
memvid-mcp
MCP (Model Context Protocol) server for memvid - a memory layer for AI agents.
This server wraps the memvid Rust CLI, exposing 40 tools for persistent memory management with hybrid search (lexical + vector), temporal indexing, knowledge graphs, and RAG capabilities.
Use Cases
Agent Memory: Give AI agents persistent memory across sessions with semantic search and temporal awareness
Document Intelligence: Ingest documents, code, and web content with automatic entity extraction and fact tracking
Knowledge Base: Build searchable knowledge bases with hybrid lexical/vector search and knowledge graph relationships
Audit & Compliance: Track information sources with citation generation and audit reports
Session Replay: Record and replay agent sessions for debugging and analysis
Prerequisites
Node.js 18+
memvid CLI binary (see memvid for installation)
Optional: Embedder configuration for vector search (embedder.toml)
Optional: LLM configuration for RAG (llm.toml)
Installation
From Source
Verify Installation
Configuration
Environment Variables
Variable | Default | Description |
|
| Path to the memvid binary |
|
| Log level: |
|
| Set to |
MCP Client Setup
VS Code (Copilot)
Add to your VS Code MCP settings:
Claude Desktop
Add to claude_desktop_config.json:
Cursor
Add to MCP settings:
OpenCode
Add to opencode.json:
Security Considerations
Path Validation
The server implements multiple layers of path security:
Path Traversal Protection: Blocks
..patternsSystem Path Blocklist: Prevents access to sensitive directories (
/etc/,/proc/,\windows\, etc.)MCP Roots Validation: Respects client-provided roots boundaries (when supported by client)
Encryption
Memory files can be encrypted using AES-256-GCM:
Recommendations
Store memory files in dedicated directories
Use encrypted files (
.mv2e) for sensitive dataConfigure MCP roots in your client to restrict file access
Use separate memory files per project/context
Available Tools (40)
Lifecycle (5 tools)
Tool | Description | Annotations |
| Create a new .mv2 memory file | write |
| Open and display file metadata | read-only |
| Show detailed statistics (frame count, index sizes) | read-only |
| Verify file integrity with optional deep check | read-only |
| Diagnose and repair corrupted indexes | destructive |
Content Management (7 tools)
Tool | Description | Annotations |
| Add content from file/directory with optional embeddings | write |
| Batch add with progress tracking | write |
| View frame content by ID | read-only |
| Replace frame content | destructive |
| Delete a frame | destructive |
| Amend frame with audit trail | write |
| Fetch URL content and add to memory | network |
Search (5 tools)
Tool | Description | Annotations |
| Hybrid/lexical/vector search | read-only |
| Vector-only semantic search | read-only |
| RAG question answering | read-only |
| Chronological frame view | read-only |
| Temporal search (find when something was mentioned) | read-only |
Analysis (6 tools)
Tool | Description | Annotations |
| Generate audit report with citations | read-only |
| Debug internal index segments | read-only |
| Export to JSON/CSV/JSONL | write |
| List internal SQLite tables | read-only |
| Schema inference and summary | read-only |
| List available embedding models | read-only |
Knowledge Graph (6 tools)
Tool | Description | Annotations |
| NER entity extraction | write |
| Memory card operations | read-only |
| Show current memory state | read-only |
| Fact extraction and listing | read-only |
| Traverse entity relationships | read-only |
| Entity lookup | read-only |
Session Management (5 tools)
Tool | Description | Annotations |
| Start/stop/list/replay sessions | write |
| Memory binding operations | destructive |
| System status (version, model status) | read-only |
| SimHash sketch operations | write |
| Trigger background processing | write |
Encryption (2 tools)
Tool | Description | Annotations |
| Encrypt memory file (AES-256-GCM) | write |
| Decrypt memory file | write |
Utility (4 tools)
Tool | Description | Annotations |
| Process pending operations | write |
| Verify single frame integrity | read-only |
| Show current configuration | read-only |
| Print version information | read-only |
Example Workflows
Basic Memory Setup
Search and Retrieval
Knowledge Graph Operations
Audit and Export
Session Recording
Embedder Configuration
For vector search capabilities, create ~/.config/memvid/embedder.toml:
Or for A4F/OpenRouter compatible APIs:
Performance Characteristics
Operation | Typical Latency | Notes |
| < 100ms | Creates empty SQLite database |
| 100-500ms | Depends on file size |
| 500ms-2s | Includes API call for embedding |
| < 50ms | Tantivy full-text search |
| 100-500ms | Combines lexical + vector |
| 1-5s | Includes LLM API call |
Timeouts are configured per operation type:
Default: 120 seconds
Heavy operations (batch put): 300 seconds
RAG operations: 180 seconds
Development
Troubleshooting
Server won't start
Check Node.js version:
node --version(requires 18+)Verify build:
npm run buildCheck memvid binary:
memvid --version
"MEMVID_PATH not found"
Set the environment variable to the full path:
Vector search returns no results
Check embeddings were generated:
memvid_statsshowsvector_count > 0Verify embedder config:
memvid_configRe-ingest with embeddings:
memvid_put { ..., "embed": true }
Path validation errors
The server validates all paths against:
Path traversal patterns (
..)System directory blocklist
MCP roots (if client supports roots capability)
Ensure your paths are within allowed directories.
License
MIT