memvid / memvid
- четверг, 8 января 2026 г. в 00:00:02
Memory layer for AI Agents. Replace complex RAG pipelines with a serverless, single-file memory layer. Give your agents instant retrieval and long-term memory.
Memvid is a single-file memory layer for AI agents with instant retrieval and long-term memory.
Persistent, versioned, and portable memory, without databases.
Website · Try Sandbox · Docs · Discussions
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.
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:
The result is a single file that behaves like a rewindable memory timeline for AI systems.
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.
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.
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 |
[dependencies]
memvid-core = "2.0"| 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:
[dependencies]
memvid-core = { version = "2.0", features = ["lex", "vec", "temporal_track"] }use memvid_core::{Memvid, PutOptions, SearchRequest};
fn main() -> memvid_core::Result<()> {
// Create a new memory file
let mut mem = Memvid::create("knowledge.mv2")?;
// Add documents with metadata
let opts = PutOptions::builder()
.title("Meeting Notes")
.uri("mv2://meetings/2024-01-15")
.tag("project", "alpha")
.build();
mem.put_bytes_with_options(b"Q4 planning discussion...", opts)?;
mem.commit()?;
// Search
let response = mem.search(SearchRequest {
query: "planning".into(),
top_k: 10,
snippet_chars: 200,
..Default::default()
})?;
for hit in response.hits {
println!("{}: {}", hit.title.unwrap_or_default(), hit.text);
}
Ok(())
}Clone the repository:
git clone https://github.com/memvid/memvid.git
cd memvidBuild in debug mode:
cargo buildBuild in release mode (optimized):
cargo build --releaseBuild with specific features:
cargo build --release --features "lex,vec,temporal_track"Run all tests:
cargo testRun tests with output:
cargo test -- --nocaptureRun a specific test:
cargo test test_nameRun integration tests only:
cargo test --test lifecycle
cargo test --test search
cargo test --test mutationThe examples/ directory contains working examples:
Demonstrates create, put, search, and timeline operations:
cargo run --example basic_usageIngest and search PDF documents (uses the "Attention Is All You Need" paper):
cargo run --example pdf_ingestionImage search using CLIP embeddings (requires clip feature):
cargo run --example clip_visual_search --features clipAudio transcription (requires whisper feature):
cargo run --example test_whisper --features whisperEverything 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.
Have questions or feedback? Email: contact@memvid.com
Drop a ⭐ to show support
Apache License 2.0 — see the LICENSE file for details.