Memvid Portable Agent Memory
A portable single-file memory layer that gives AI agents persistent storage, fast retrieval, and rewindable history.
- Source repo
- memvid/memvid
- Stars
- ★ 17k
- Last updated
- 3mo ago
- License
- Apache-2.0
- Primary language
- Rust
- FA score
- 46/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Developers building long-running assistants that must retain user facts and conversation context across sessions while keeping memory portable.
- Not a fit if
- Teams wanting vector search that works out of the box without manually downloading ONNX and tokenizer files
- Teams that cannot use a Rust 1.85.0+ toolchain
- Source review
- 46/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
Memvid is a Rust-based memory system that packages content, embeddings, search structures, and metadata into one .mv2 file. It stores memory as append-only Smart Frames containing immutable content, timestamps, checksums, and basic metadata, with an embedded WAL for crash recovery. Optional features cover Tantivy BM25 search, HNSW vector search, local ONNX text embeddings, CLIP image retrieval, Whisper transcription, PDF extraction, temporal parsing, and encrypted capsules. Developers can integrate it through a Rust crate, Node.js SDK, Python SDK, or CLI; its core is model-agnostic and can operate fully offline. It is a practical fit for teams seeking a local, portable alternative to server-hosted vector databases and multi-component RAG infrastructure, provided they can manage the feature flags, model files, and compute required by their chosen retrieval modes.
An application creates a .mv2 file with Memvid::create, writes content and metadata such as titles, URIs, and tags through put_bytes_with_options, and persists the update with commit. The file stores compressed frames, an embedded WAL, a table of contents, and optional lexical, vector, and chronological indexes; existing frames remain immutable while new memory is appended. A client submits a SearchRequest to mem.search and receives hits containing titles, text, and snippets. The lex feature supplies Tantivy BM25 search, while vec adds HNSW search with local ONNX text embeddings and api_embed can call OpenAI's embedding API. The clip, whisper, and pdf_extract features add image retrieval, audio transcription, and PDF text extraction respectively. Its timeline model also supports querying earlier memory states and rewinding, replaying, or branching memory.
- Developers building long-running assistants that must retain user facts and conversation context across sessions while keeping memory portable.
- Teams deploying searchable knowledge bases on edge devices or isolated systems where a remote database is unavailable.
- Engineering groups indexing source code and technical documents for lexical or semantic codebase exploration.
- Customer-support, sales, or workflow-automation teams that need to accumulate operational context and retrieve relevant history quickly.
- Medical, legal, or financial workflow designers who need immutable records and historical-state inspection for auditable memory behavior.
- Applications ingesting PDFs, images, or audio that can provision the corresponding extraction, CLIP, or Whisper features and models.
How do you install or deploy this agent?
The Rust core requires Rust 1.85.0 or newer. Add the base crate to Cargo.toml:
[dependencies]
memvid-core = "2.0"Enable full-text search, vector retrieval, and temporal parsing when required:
[dependencies]
memvid-core = { version = "2.0", features = ["lex", "vec", "temporal_track"] }To build the repository itself:
git clone https://github.com/memvid/memvid.git
cd memvid
cargo build --releaseOther documented distribution options are:
npm install -g memvid-cli
npm install @memvid/sdk
pip install memvid-sdk
cargo add memvid-coreBefore using the default local BGE-small model with vec, download its ONNX model and tokenizer:
mkdir -p ~/.cache/memvid/text-models
curl -L 'https://huggingface.co/BAAI/bge-small-en-v1.5/resolve/main/onnx/model.onnx' \
-o ~/.cache/memvid/text-models/bge-small-en-v1.5.onnx
curl -L 'https://huggingface.co/BAAI/bge-small-en-v1.5/resolve/main/tokenizer.json' \
-o ~/.cache/memvid/text-models/bge-small-en-v1.5_tokenizer.jsonCredentials are needed only for the optional OpenAI embedding path:
export OPENAI_API_KEY="sk-..."How do you use this agent?
This Rust example creates a memory file, writes and commits one metadata-bearing document, then searches it:
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(())
}When using local embeddings, bind the index to its model to prevent accidental model mixing:
mem.set_vec_model("bge-small-en-v1.5")?;The repository's documented examples can be launched directly:
cargo run --example basic_usage
cargo run --example pdf_ingestion
cargo run --example clip_visual_search --features clip
cargo run --example test_whisper --features whisper -- /path/to/audio.mp3Run the test suite with:
cargo testWhat are this agent's strengths and limitations?
- Content, metadata, the WAL, and multiple indexes live in one
.mv2file, with no.wal,.lock,.shm, or other sidecar files to coordinate. - The core is model-agnostic and exposes Rust, Node.js, Python, and CLI entry points; local ONNX embeddings support offline operation.
- Append-only immutable Smart Frames provide crash-safety properties, historical-state queries, and memory rewind or branching.
- Retrieval modes are composable across Tantivy/BM25 text search, HNSW vectors, temporal indexing, and optional PDF, image, and audio processing.
- Persistent vector-model binding detects incompatible query and index models with a
ModelMismatcherror.
- The core requires Rust 1.85.0 or newer, and teams must maintain whichever SDK or CLI integration they choose.
- Local vector search does not bundle its text models; operators must download ONNX and tokenizer files manually, with documented model sizes ranging from about 120 MB to 1.3 GB.
- Advanced functions require feature selection and extra resources such as CLIP, Whisper, Tantivy, HNSW, or the OpenAI API, increasing deployment complexity.
- The OpenAI embedding option requires network access and an
OPENAI_API_KEY, giving up the fully offline property. - The source reports latency and LoCoMo accuracy results but does not establish capacity-planning limits for a reader's specific hardware, dataset, or workload.
How does this agent compare with similar options?
Compared with a server-hosted vector database plus a multi-service RAG pipeline, Memvid colocates data, embeddings, indexes, and metadata in one local .mv2 file, reducing persistent services and sidecar files. That favors portable, offline, and history-aware applications; teams needing centrally managed multi-user database operations, independently scaled services, or a ready-made hosted platform would need to supply and evaluate that surrounding architecture themselves.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Memvid Portable Agent Memory This agent | 46 · Major gaps | Library / SDKFree + model costs | ★ 17k | 3mo ago | Rust | OpenAI API |
| MetaClaw | 50 · Major gaps | CLIFree + model costs | ★ 3.5k | 4mo ago | Python | Codex · Claude Code · OpenAI API · Claude API |
| Chroma - Open-Source Data Infrastructure for AI | 45 · Major gaps | Library / SDKFreemium | ★ 30k | 1d ago | Rust | — |
| SimpleMem: Efficient Lifelong Memory for LLM Agents | 43 · Major gaps | Library / SDKFree + model costs | ★ 3.8k | 2mo ago | Python | ChatGPT · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows: README and SECURITY.md describe security features (Blake3 checksums, Ed25519 signatures, AES-256-GCM encryption, WAL crash recovery), but no permission model or least privilege principle is documented. No user confirmation mechanism found. Data flow transparency is limited; only single-file storage and index structure are mentioned, without detailed data handling or transmission. Sensitive data handling: encryption is optional, but default behavior and key management are not specified. Dependency security: dependencies are listed in Cargo.toml, but no vulnerability scanning or audit evidence. External effects: network features exist (api_embed, whisper model downloads), but no data exfiltration or user consent explanation. Rollback: time-travel debugging and append-only writes are mentioned, but no explicit rollback mechanism. Source attribution: no contributor or maintainer information. Deductions: lack of permission model, user confirmation, detailed data flow, key management, dependency audit, external effects explanation, and explicit rollback mechanism.
Evidence shows: README and Cargo.toml describe a consistent architecture (single-file, append-only, crash-safe), but no error handling or failure message examples. Dependency availability: multiple optional dependencies are listed, but availability or version compatibility is not fully explained. Failure messages: no error types or user-visible error information. Deductions: lack of error handling documentation and failure message examples.
Evidence shows: README lists multiple use cases (long-running agents, enterprise knowledge bases, offline systems, etc.) and provides multiple SDKs (Rust, Node, Python, CLI). Capability boundaries: optional features are clearly defined via feature flags (e.g., lex, vec, whisper), but limitations of each feature are not specified. Trigger precision: no trigger conditions or precise API behavior. Environment fit: multi-platform support (CI matrix includes Ubuntu, macOS, Windows), but specific environment requirements are not detailed. Deductions: lack of trigger precision and feature limitation details.
Evidence shows: README provides clear information architecture (title, badges, navigation, sections), detailed installation notes (Rust version, dependencies, feature flags). Naming stability: version number is explicit (2.0.140), but no naming conventions. Examples and FAQ: multiple examples provided, but no FAQ. Known limitations: only v1 deprecation mentioned, no other limitations. License: Apache-2.0 explicit. Versioning changelog: no CHANGELOG provided. Maintenance responsibility: no maintainers or contribution guidelines. Deductions: lack of FAQ, known limitations, changelog, and maintenance responsibility.
Evidence shows: README provides usage examples and API documentation, output usability is good. Marginal value: claims to be more efficient than RAG, but no comparative data. Cost-benefit: claims low latency and high throughput, but no benchmark details. Deductions: lack of benchmark data and cost analysis.
Evidence shows: README claims benchmarks are reproducible, but no specific data or methodology. Cross-source corroboration: no external validation. Fact-inference separation: no clear distinction between facts and inferences. Deductions: lack of verifiable benchmark data and external validation.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- No permission model or least privilege principle is provided, which may lead to over-privileged operations.
- Encryption is optional and not enabled by default; sensitive data may be stored unencrypted.
- Network features (e.g., OpenAI API, model downloads) exist, but no data exfiltration or user consent mechanism is explained.
- No dependency vulnerability scanning or audit evidence is provided; dependency security is unknown.
- No explicit rollback mechanism is provided, despite claims of time-travel debugging.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
Bug fixes #230 — WAL checksum mismatch after region growth Sustained put + commit workloads that grew the embedded WAL could corrupt it, surfacing as Embedded WAL is corrupted at offset N: wal record checksum mismatch (and, in some reports, runaway sparse-file growth past EOF). grow_wal_region / ensure_wal_capacity shifted the data region right by delta and updated data_end/footer_offset, but left cached_payload_end stale. rebuild_indexes then seeked to that pre-growth offset — now inside the grown WAL region — and overwrote live WAL record payloads. `cached_payloa …View on GitHub ↗ -
Release notes excerpt
v2.0.139 Release Date: March 13, 2026 Overview This release completes the fix for MV005 (Time index track is invalid: frame id out of range) by extending graceful stale frame_id handling to all search paths — find(), ask(), Tantivy, lex fallback, vec search, and temporal metadata lookups. --- 🐛 Bug Fixes MV005 crash in find() and ask() search paths — Issue #196 (continued) - v2.0.138 fixed the timeline.rs path only; stale frame_ids in Tantivy evaluation, snippet assembly, lex fallback, and temporal metadata lookups still caused hard crashes …View on GitHub ↗ -
Release notes excerpt
v2.0.138 Release Date: March 3, 2026 Overview This release fixes two SDK issues: lex_enabled/vec_enabled state not persisting after re-opening .mv2 files, and ask() crashing with "frame id out of range" on files with inconsistent time indexes. --- 🐛 Bug Fixes lex_enabled/vec_enabled reset to None on re-open — Issue #194 - Added lex_enabled and vec_enabled fields to the core Stats struct so SDKs can read runtime search engine state …View on GitHub ↗
FAQ
Does Memvid require internet access or OpenAI?
api_embed integration with OpenAI.What persistent files does it create?
.mv2 file. The documented format does not create .wal, .lock, .shm, or other sidecars.How does it prevent mismatched embedding models?
mem.set_vec_model("bge-small-en-v1.5") to persistently bind the index to a model name. Later attempts to use a different model fail with ModelMismatch.What protects data during an interrupted write?
Which non-text inputs can it process?
pdf_extract extracts PDF text, clip supports image-search embeddings, and whisper transcribes audio.