Overview
Memvid is a portable memory system for AI agents that packages your data, embeddings, search structure, and metadata into a single file. Instead of standing up a server-based vector database or wiring together a complex RAG pipeline, you read and search directly from that one file.
The design draws on ideas from video encoding. Memory is stored as an append-only sequence of immutable Smart Frames that each hold content along with a timestamp, checksum, and basic metadata. Because writes only ever append, existing data is never overwritten, which makes the file crash-safe and lets you inspect or replay how knowledge changed over time.
Memvid is model-agnostic and works fully offline, so the same memory file can travel with an agent across sessions and machines. The core engine is written in Rust, and there are official CLI, Node.js, and Python packages for using it from other languages.
What it does
- Stores data, embeddings, search index, and metadata in one portable file, with no separate database or server to run
- Append-only Smart Frames keep every write immutable and checksummed, giving crash safety and a rewindable timeline of memory
- Full-text BM25 search (via the `lex` feature) and vector similarity search with HNSW and local ONNX embeddings (via the `vec` feature)
- Optional feature flags for CLIP image search, Whisper audio transcription, PDF text extraction, natural-language date parsing, and encrypted capsules
- Time-travel debugging to rewind, replay, or branch any past memory state
- Available as a Rust crate plus official CLI, Node.js, and Python SDKs
Getting started
Memvid's core engine is a Rust crate (memvid-core), and there are matching packages for the CLI, Node.js, and Python. The quickest way to try it is to add the crate to a Rust project, or install one of the SDKs for your language.
Install for your language
Pick the package that matches your stack. The CLI and Node.js SDK install via npm, the Python SDK via pip, and the Rust core via cargo.
npm install -g memvid-cli
npm install @memvid/sdk
pip install memvid-sdk
cargo add memvid-coreAdd the Rust crate with the features you need
If you are working in Rust, add memvid-core to your Cargo.toml. Memvid uses feature flags, so enable the ones you need such as full-text search, vector search, or natural-language date parsing.
[dependencies]
memvid-core = { version = "2.0", features = ["lex", "vec", "temporal_track"] }Create a memory file, add data, and search
Create a new .mv2 memory file, put documents into it with optional title, URI, and tags, commit the change, then run a search and read back the hits.
use memvid_core::{Memvid, PutOptions, SearchRequest};
fn main() -> memvid_core::Result<()> {
let mut mem = Memvid::create("knowledge.mv2")?;
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()?;
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(())
}Build from source (optional)
To build the project yourself, clone the repository and compile it. Use the release profile for an optimized build, and pass the features you want.
git clone https://github.com/memvid/memvid.git
cd memvid
cargo build --release --features "lex,vec,temporal_track"Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Giving long-running AI agents persistent, long-term memory they can carry across sessions and machines
- Building offline-first AI systems that need fast local recall without a hosted vector database
- Packaging an enterprise knowledge base or personal knowledge assistant into a single portable, shareable file
- Auditing and debugging AI workflows by rewinding, replaying, or branching past memory states
How Memvid compares
Memvid alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Mem0 | ★ 59.6k | A memory layer that you add to existing LLM agents to extract, store, and recall user facts and preferences across sessions using vector, graph, and key-value backends. |
| Graphiti | ★ 28.1k | A library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time. |
| Supermemory | ★ 27.8k | A memory and context engine that ingests information across tools and sessions and can run fully locally, acting as a second brain for AI applications. |
| Cognee | ★ 24.1k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Letta | ★ 23.6k | A framework (formerly MemGPT) for building stateful agents with long-term memory that persists across sessions and conversations. |
| Memvid | ★ 15.7k | Single-file, serverless memory layer that gives AI agents persistent long-term recall |
| Memori | ★ 15.5k | An SQL-native memory engine that gives any LLM persistent, structured memory stored in standard PostgreSQL or MySQL databases instead of a vector store. |
| MemU | ★ 13.9k | A memory layer for AI agents that organizes structured storage and intent capture to reduce the tokens needed to keep context across conversations. |