Memvid is an open-source, single-file memory layer for AI agents: one .mv2 file holds your documents, a BM25 full-text index, an HNSW vector index and a write-ahead log, with no server to run. The 2025 version this article introduced (text chunks as QR codes inside an MP4, searched with FAISS) has been rewritten from Python to Rust and the QR design is deprecated. This page gives the September 2026 status, the current install, what the old benchmarks do and do not tell you, and when a real vector database is the better call.
Updated September 2026: new status section (v2 rewrite, versions, install), a memvid vs vector database section, and an FAQ. The June 2025 walkthrough and its code are kept below and labelled as the v1 version; the 2025 benchmark table applies to v1 only.
Picking the right retrieval substrate (vector DB vs Memvid vs hybrid) is one slice of a larger context-engineering decision tree that we work through in Cohorte's Context Architecture course (E5).
What memvid is in 2026 (status, version, install)
Short version: the project is alive, it is not the project we wrote about, and the old name still points at it.
- Repository. github.com/memvid/memvid, Apache-2.0, about 16,400 stars, last push to
mainon July 14, 2026. The launch-era URLOlow304/memvidredirects there; the repo is not archived. - The rewrite. Release v2.0.131 (January 5, 2026) is described by the maintainers as a complete rewrite from Python to Rust. The README now says plainly that memvid v1 (QR-based memory) is deprecated and that anything referencing QR codes is outdated information. The docs have a dedicated v1 deprecation page saying QR codes were fully removed and that all memory should be
.mv2files. - Current versions. Latest GitHub release: v2.0.140 (May 27, 2026). Python package:
memvid-sdk2.0.160 on PyPI (May 27, 2026), Python 3.8+, native bindings bundled. There is also@memvid/sdkfor Node,memvid-cli, and thememvid-corecrate (Rust 1.85+ to build from source). The oldmemvidpackage on PyPI is frozen at 0.1.3 (June 5, 2025, MIT) and still installs, but it is the deprecated v1. - What a v2 file contains. Documents plus their metadata, a BM25 lexical index, an HNSW vector index, a temporal index and an embedded WAL, all inside one
.mv2file you can copy, sync or commit. Search modes are lexical, semantic and hybrid (the default). Ingestion covers text, PDFs, images via CLIP and audio via Whisper, per the README. - Embeddings and hardware. With
OPENAI_API_KEYset, the Python SDK embeds withtext-embedding-3-small(1536d); without it, it downloads a local bge-small model (384d) and runs on CPU. No GPU is required.ask()(retrieval plus LLM synthesis) needs an LLM API key.
Install and a minimal v2 session, from the current docs:
pip install memvid-sdkimport os
from memvid_sdk import create, use
path = "knowledge.mv2"
mem = use("basic", path) if os.path.exists(path) else create(path)
mem.put(title="Team", label="info", metadata={}, text="Alice works on retrieval.")
results = mem.find("who works on retrieval", k=5, mode="hybrid")
mem.seal() # commit to diskThe vendor README quotes its own benchmark figures (LoCoMo recall, sub-millisecond P50 latency, throughput multiples). We have not reproduced them and we do not repeat them as facts here; measure on your corpus.
Everything from section 1 to section 10 below is the original June 2025 walkthrough of memvid v1, kept as written. Its code targets pip install memvid 0.1.3 and still runs against that package, but that package is no longer developed.
1. Why We Even Bother
- Vector databases rock… until you’re paying for GPU-backed query nodes, RAM-hungry indexes, and a DevOps rota just to babysit them.
- Moving hundreds of gigabytes between prod and staging? Cue the sad trombone.
- In air-gapped or edge scenarios, “just spin up a managed vectordb” is not advice.
Enter Memvid. Instead of B-tree tables or ANN graphs living in Postgres extensions, it squeezes your chunks into video frames encoded as QR images. The MP4 is your database; a sidecar JSON is the index; FAISS does the similarity dance. Result: 10× storage savings and sub-second retrieval for 1-million-chunk corpora.
2. How the Magic Happens (A Peek Under the Lens)
Text -> chunk → embed → QR code image
Frames → stitched into MP4 (H.264 / H.265 / …)
Index → FAISS vectors + metadata JSON
Search → embed(query) → cosine in FAISS → frame seek → decode QR → return text| Stage | Tech behind the scenes |
|---|---|
| Embeddings | Sentence-Transformers by default – pluggable. |
| QR encoding | qrcode lib encodes binary payloads. |
| Video muxing | OpenCV + ffmpeg under the hood. |
| ANN Search | FAISS flat or IVF indexes. |
| Chat layer | Hooks into OpenAI, Claude, or local LLMs for RAG. |
Each frame is basically a data tile; fast seek + decompression beats walking SSTables. Because MP4s stream nicely, you can stick them in S3/Cloudflare R2 and only read the frames you need.
3. Key Features & Advantages
| Capability | Why it Matters |
|---|---|
| Video-as-DB | One file to rule them all—ship or version it like any media asset. |
| Sub-second semantic search | FAISS + local SSD = instant RAG context. |
| 10× smaller than classic vectordb footprints | Video codecs were born for compression; we just piggy-back. |
| Offline-first | No network? No problem. |
| PDF ingestion | add_pdf() drops a 500-page book straight in. [github.com] |
| Simple API | Three lines to encode, five to chat. [github.com] |
4. Quick-Start Cookbook (2025, memvid v1)
Open a shell—no GPU required.
4.1 Install
What changed since this was written: the package below is the deprecated v1. For the current library, install memvid-sdk and use create() / put() / find() / ask() as shown in the 2026 section above; MemvidEncoder, MemvidChat and the .mp4 + JSON pair do not exist in v2.
pip install memvid-sdk # 2026: memvid v2, single .mv2 filepython -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
pip install memvid PyPDF2 # PyPDF2 only if you need PDFs4.2 Encode a Few Chunks
from memvid import MemvidEncoder
chunks = [
"TCP was invented in 1974.",
"Rust guarantees memory safety without GC.",
"The Pythagorean theorem is surprisingly versatile."
]
encoder = MemvidEncoder()
encoder.add_chunks(chunks)
encoder.build_video("facts.mp4", "facts_idx.json") # ~3 lines, promised delivered4.3 Ask Questions
from memvid import MemvidChat
chat = MemvidChat("facts.mp4", "facts_idx.json")
print(chat.chat("Who came up with TCP?"))(Expect a snappy answer: Vint Cerf & Bob Kahn.)
4.4 Whole-Book Chat (PDF)
from memvid import MemvidEncoder, chat_with_memory
encoder = MemvidEncoder()
encoder.add_pdf("deep_learning_book.pdf")
encoder.build_video("dl_mem.mp4", "dl_idx.json")
chat_with_memory("dl_mem.mp4", "dl_idx.json") # opens CLI chat5. Deep Dive: Performance & Benchmarks (2025, v1 numbers)
These figures were measured on the v1 QR-in-MP4 design in June 2025. They say nothing about v2, whose storage engine and indexes are different. Treat them as history, not as a benchmark of the current library.
| Dataset size | Build time (CPU, 8-cores) | MP4 size | Query latency (top-5) |
|---|---|---|---|
| 100 K chunks | ≈ 2 min | 180 MB | 50 ms |
| 1 M chunks | ≈ 22 min | 1.6 GB | 320 ms |
Measured on a 2021 MacBook Pro; YMMV. The seek-decode wall clock stays under a second even at seven-figure scales because frame hops are O(1) and vector math runs in memory. Compare that with warm-cache pgvector (2–3 s) or a cold Supabase vector table (don’t ask).bestofai.com
6. When (Not) to Use Memvid
✅ Great for
- Read-heavy RAG apps, offline knowledge bases, edge devices.
- Shipping pre-baked corpora to clients without database installs.
- “Throw it in a bucket, share a link” workflows.
❌ Think twice if
- You need frequent in-place updates—MP4s are mostly append-only; bulk re-encode is the escape hatch.
- You require billions of embeddings with distributed shards (Vectara, Pinecone still win here).
- Strict ACID semantics or row-level deletes—a video file won’t do that dance.
7. Production Recipes
| Pattern | How to Pull It Off |
|---|---|
| Serverless RAG | Store .mp4 + .json in S3 ▸ Lambda pulls, runs FAISS search, returns snippets. Cold starts stay tiny because FAISS index is memory-mapped from the JSON. |
| CI/CD for knowledge | Treat MP4s as artifacts. Re-encode on docs merge, push to object storage, invalidate CDN. |
| Streaming search | Put the MP4 behind Cloudflare Stream; partial GET range requests fetch only needed frames—bandwidth smiles. |
| Multi-tenant SaaS | Namespace per customer = distinct video + index. No noisy-neighbor queries. |
8. Extending the Stack
from sentence_transformers import SentenceTransformer
custom_model = SentenceTransformer("intfloat/multilingual-e5-small")
encoder = MemvidEncoder(embedding_model=custom_model)
# proceed as usual...Need bigger bite? Spin n_workers=8 for parallel chunking, or switch to video_codec='h265' + crf=28 for 15–20 % extra savings.
9. Limitations & Open Questions
- Write Amplification – Small updates mean re-encoding; incremental frame patching is on the roadmap.
- Security – Anyone with the MP4 can QR-decode frames. Encrypt at rest or wrap in container-level access control.
- Concurrency – Multiple readers are fine; concurrent writers are… well, don’t.
- Index Size – JSON grows linearly; consider binary packing or SQLite sidecars for 10-million-chunk dreams.
10. Roadmap Highlights (as of June 2025)
Overtaken by events: instead of patching the QR design, the maintainers replaced it with the Rust rewrite described at the top of this page.
- Delta-encoding for incremental writes.
- GPU-aided batch encoding (cuQR?).
- WASM retriever for browser-side RAG.
- Native LangChain & LlamaIndex connectors (PRs welcome).
memvid vs a vector database: when each wins
The question behind the query "memvid vector database" is really "can I skip Qdrant, pgvector or Pinecone?" Sometimes. Here is how we draw the line, without numbers we cannot stand behind.
Memvid wins when
- The corpus belongs to one agent, one app or one user, and a single file on disk is the natural unit of deployment: desktop tools, CLIs, edge and air-gapped installs, per-tenant bundles.
- You want lexical and semantic search out of one library with no service to run, patch or monitor.
- Portability matters more than throughput: copy the file, commit it, ship it with the build.
- Writes are append-mostly from a single process and you can live with sealing to disk rather than transactional row updates.
A vector database wins when
- Several services or workers write concurrently, or reads and writes must not block each other.
- You need replication, point-in-time backups, role-based access and audit trails at the database layer rather than at the file-system layer.
- Filtered search over payload fields at scale is central (tenant, date range, document type) and you want the query planner to handle it.
- The corpus will not fit on one machine, or the retrieval tier needs to scale independently of the app. pgvector is the low-friction choice when the data is already in Postgres; a dedicated engine such as Qdrant when retrieval is its own service.
A useful test: if you would be nervous shipping the same data in a SQLite file, you should be nervous shipping it in a .mv2. Memvid v2 is an embedded engine with retrieval indexes built in, and that framing (SQLite for retrieval, not a distributed database) keeps expectations honest. Whatever the substrate, the chunking, metadata and ranking decisions upstream of it matter more than the storage format.
FAQ
Is memvid still maintained?
Yes, but not the version this article was written about. Memvid was rewritten from Python to Rust; the first v2 release (v2.0.131) landed on January 5, 2026. As of September 2026 the latest GitHub release is v2.0.140 (May 27, 2026), the Python package memvid-sdk is at 2.0.160 (May 27, 2026), and the last push to main was July 14, 2026. The v1 QR-in-MP4 package (memvid 0.1.3 on PyPI, June 2025) is deprecated by the maintainers.
Is memvid a real vector database?
Not in the server sense. Memvid v2 is an embedded, single-file library: one .mv2 file holds the documents, an HNSW vector index, a BM25 full-text index and a write-ahead log. There is no server process, no replication and no multi-writer story. Think SQLite for retrieval, not Qdrant or Pinecone.
How does memvid store embeddings?
In v2, embeddings and their HNSW index live inside the .mv2 file next to the text and the lexical index. In v1 (2025), text chunks were encoded as QR codes in the frames of an MP4 and embeddings lived in a FAISS index with a sidecar JSON file; that design has been removed entirely.
Does memvid need a GPU?
No. Without an OPENAI_API_KEY the Python SDK embeds locally with a bge-small model (384 dimensions) on CPU; with the key set it calls text-embedding-3-small (1536 dimensions). The ask() method needs an LLM API key because it sends retrieved context to a model.
When should I use Qdrant or pgvector instead of memvid?
When several services write concurrently, when you need replication, backups and access control at the database layer, when filtering and payload queries matter at scale, or when the corpus outgrows a single file on a single machine. pgvector is the natural pick when the data already lives in Postgres; Qdrant when retrieval is its own service with its own scaling needs.
Where is the memvid GitHub repo?
github.com/memvid/memvid, Apache-2.0, about 16,400 stars in September 2026. The old Olow304/memvid URL from the 2025 launch redirects there. Python: pip install memvid-sdk. Node: npm install @memvid/sdk. Rust: cargo add memvid-core.
11. Final Thoughts (2025)
Memvid turns the humble MP4 into a sneaky-fast, crazy-portable knowledge capsule. For devs who’d rather ship a file than babysit a cluster—and for AI VPs eyeing infra cost charts with existential dread—it’s an intriguing alternative. Give it a spin; worst case, you’ll have the geekiest “home movies” on the block.
Further Reading & Resources
- GitHub: https://github.com/Olow304/memvid
- PyPI:
pip install memvid - memvid v2 (current): github.com/memvid/memvid, docs.memvid.com, memvid-sdk on PyPI
- Release notes & PDF support tips (v1) – see v0.1.3 changelog - github.com
Happy encoding! 🎥
Tega AdeyemiJune 6, 2025

