What is Memvid?
Memvid is a portable AI memory system that packages your data, embeddings, search structure, and metadata into a single file.
Instead of running complex RAG pipelines or server-based vector databases, Memvid enables fast retrieval directly from the file.
The result is a model-agnostic, infrastructure-free memory layer that gives AI agents persistent, long-term memory they can carry anywhere.
Why Video Frames?
Memvid draws inspiration from video encoding, not to store video, but to organize AI memory as an append-only, ultra-efficient sequence of Smart Frames.
A Smart Frame is an immutable unit that stores content along with timestamps, checksums and basic metadata. Frames are grouped in a way that allows efficient compression, indexing, and parallel reads.
This frame-based design enables:
- Append-only writes without modifying or corrupting existing data
- Queries over past memory states
- Timeline-style inspection of how knowledge evolves
- Crash safety through committed, immutable frames
- Efficient compression using techniques adapted from video encoding
The result is a single file that behaves like a rewindable memory timeline for AI systems.
Core Concepts
-
Living Memory Engine Continuously append, branch, and evolve memory across sessions.
-
Capsule Context (
.mv2) Self-contained, shareable memory capsules with rules and expiry. -
Time-Travel Debugging Rewind, replay, or branch any memory state.
-
Smart Recall Sub-5ms local memory access with predictive caching.
-
Codec Intelligence Auto-selects and upgrades compression over time.
Use Cases
Memvid is a portable, serverless memory layer that gives AI agents persistent memory and fast recall. Because it's model-agnostic, multi-modal, and works fully offline, developers are using Memvid across a wide range of real-world applications.
- Long-Running AI Agents
- Enterprise Knowledge Bases
- Offline-First AI Systems
- Codebase Understanding
- Customer Support Agents
- Workflow Automation
- Sales and Marketing Copilots
- Personal Knowledge Assistants
- Medical, Legal, and Financial Agents
- Auditable and Debuggable AI Workflows
- Custom Applications
SDKs & CLI
Use Memvid in your preferred language:
| Package | Install | Links |
|---|---|---|
| CLI | npm install -g memvid-cli |
|
| Node.js SDK | npm install @memvid/sdk |
|
| Python SDK | pip install memvid-sdk |
|
| Rust | cargo add memvid-core |
Installation (Rust)
Requirements
- Rust 1.85.0+ — Install from rustup.rs
Add to Your Project
[]
= "2.0"
Feature Flags
| Feature | Description |
|---|---|
lex |
Full-text search with BM25 ranking (Tantivy) |
pdf_extract |
Pure Rust PDF text extraction |
vec |
Vector similarity search (HNSW + ONNX) |
clip |
CLIP visual embeddings for image search |
whisper |
Audio transcription with Whisper |
temporal_track |
Natural language date parsing ("last Tuesday") |
parallel_segments |
Multi-threaded ingestion |
encryption |
Password-based encryption capsules (.mv2e) |
Enable features as needed:
[]
= { = "2.0", = ["lex", "vec", "temporal_track"] }
Quick Start
use ;
Build
Clone the repository:
Build in debug mode:
Build in release mode (optimized):
Build with specific features:
Run Tests
Run all tests:
Run tests with output:
Run a specific test:
Run integration tests only:
Examples
The examples/ directory contains working examples:
Basic Usage
Demonstrates create, put, search, and timeline operations:
PDF Ingestion
Ingest and search PDF documents (uses the "Attention Is All You Need" paper):
CLIP Visual Search
Image search using CLIP embeddings (requires clip feature):
Whisper Transcription
Audio transcription (requires whisper feature):
File Format
Everything lives in a single .mv2 file:
┌────────────────────────────┐
│ Header (4KB) │ Magic, version, capacity
├────────────────────────────┤
│ Embedded WAL (1-64MB) │ Crash recovery
├────────────────────────────┤
│ Data Segments │ Compressed frames
├────────────────────────────┤
│ Lex Index │ Tantivy full-text
├────────────────────────────┤
│ Vec Index │ HNSW vectors
├────────────────────────────┤
│ Time Index │ Chronological ordering
├────────────────────────────┤
│ TOC (Footer) │ Segment offsets
└────────────────────────────┘
No .wal, .lock, .shm, or sidecar files. Ever.
See MV2_SPEC.md for the complete file format specification.
Support
Have questions or feedback? Email: contact@memvid.com
Drop a ⭐ to show support
License
Apache License 2.0 — see the LICENSE file for details.