Skip to main content
This glossary provides definitions for all key terms, components, and concepts in the Memvid ecosystem. Whether you’re just getting started or diving deep into the architecture, this reference will help you understand how everything fits together.

Architecture Components

Memvid Core

The heart of Memvid, written in Rust. memvid-core is the foundational library that implements all core functionality:
  • File format handling - Reading/writing .mv2 files
  • Indexing engines - Lexical (Tantivy), vector (HNSW), and hybrid search
  • WAL management - Write-ahead logging for crash safety
  • Enrichment pipeline - Background processing for embeddings and extraction
  • Memory management - Frame storage, versioning, and lifecycle
The core is compiled to native binaries and exposed through language bindings (Node.js, Python) for cross-platform use.

CLI (Command Line Interface)

The memvid CLI tool provides direct access to all Memvid operations from your terminal:
The CLI is ideal for scripting, automation, and quick interactions without writing code.

SDKs (Software Development Kits)

Language-specific libraries that wrap the Memvid core for seamless integration:

Node.js SDK

@memvid/sdk - Native N-API bindings for Node.js applications

Python SDK

memvid-sdk - PyO3 bindings for Python applications
Both SDKs provide identical APIs:
  • create() / use() - Create or open memory files
  • put() / put_many() - Insert documents
  • find() - Search with various modes
  • ask() - AI-powered Q&A
  • timeline() - Browse insertion history

File Format

MV2 (Memory File)

The .mv2 file extension represents a Memvid memory file. It’s a single, self-contained binary file that stores:
  • All your documents and data (frames)
  • Search indices (lexical, vector, temporal)
  • Metadata and checksums
  • Write-ahead log for crash recovery
Key characteristics:
  • Portable - Copy, move, or share as a single file
  • Serverless - No database server required
  • Crash-safe - WAL ensures data integrity
  • Deterministic - Reproducible builds for verification

MV2E (Encrypted Memory File)

The .mv2e extension indicates an encrypted memory file (Capsule). Uses:
  • Argon2 for password-based key derivation
  • AES-GCM for authenticated encryption
Requires a password to open; transparent once unlocked.

Core Concepts

Frame

The atomic unit of data in Memvid. Every piece of content you store becomes a frame. Properties: Lifecycle:
  1. Insert - Frame created with frame_id, status = Active
  2. Update - Original marked Superseded, new frame created
  3. Delete - Status changed to Deleted (soft delete)
Frames are immutable once committed - updates create new frames.

Memory

A “memory” in Memvid refers to the runtime instance managing an .mv2 file. When you open a memory file, you get a Memory object that handles:
  • Reading and writing frames
  • Managing indices
  • Coordinating search
  • Handling commits and checkpoints

Commit

The process of persisting pending changes to the .mv2 file:
  1. WAL entries written to disk
  2. Indices updated
  3. Footer rewritten with new checksums
  4. File synced to storage
Commits happen automatically on close, or can be triggered manually for durability guarantees.

Checkpoint

A checkpoint purges committed WAL entries and updates the header:
  • Frees WAL space for new writes
  • Marks transactions as permanently durable
  • Triggered automatically when WAL reaches 75% capacity

Search & Retrieval

Traditional keyword-based search using the BM25 ranking algorithm:
  • How it works: Builds an inverted index of terms, scores documents by term frequency and inverse document frequency
  • Best for: Exact matches, specific keywords, technical terms
  • Engine: Tantivy (Rust full-text search library)
Meaning-based search using embeddings:
  • How it works: Converts text to vector embeddings, finds similar vectors using cosine similarity
  • Best for: Conceptual queries, finding related content, natural language questions
  • Index: HNSW (Hierarchical Navigable Small World) graph
Combines lexical and semantic search for best results:
  • Runs both search types in parallel
  • Normalizes scores from each
  • Merges using RRF (Reciprocal Rank Fusion)
  • Returns unified ranked results

Sketch Pre-filtering

Ultra-fast candidate filtering before expensive ranking:
  • SimHash: 64-bit locality-sensitive hash for quick similarity checks
  • Term Filter: Compact bitset for query term overlap
  • Top Terms: Hashed IDs of highest-weight terms
Reduces search candidates by 10-100x, enabling sub-millisecond filtering on million-frame memories.

Indexing

Lex Index

The lexical search index built on Tantivy:
  • Tokenizes text into terms
  • Builds inverted index (term → document list)
  • Supports field-specific queries (title, content, tags)
  • Deterministic chunking for reproducibility

Vec Index

The vector/embedding search index:
  • Stores document embeddings
  • Uses HNSW graph for approximate nearest neighbor search
  • Supports multiple embedding models (BGE, Nomic, OpenAI)
  • Optional product quantization for compression

Time Index

Temporal index for frame ordering:
  • Tracks insertion timestamps
  • Enables range queries (since/until)
  • Powers timeline() navigation
  • Supports forward and reverse traversal

Sketch Track

Per-frame micro-indices for fast filtering:

Enrichment

Enrichment Pipeline

Background processing that enhances frames after insertion: Phases:
  1. Searchable (instant) - Skim text extracted, basic indexing
  2. Enriched (background) - Full text, embeddings, memory cards, entities
The two-phase approach means search works immediately while richer features process in the background.

Memory Cards

Structured units of extracted knowledge: Memory cards enable semantic querying beyond raw text search.

Entity Extraction (NER)

Named Entity Recognition identifies and links entities:
  • Types: Person, Organization, Location, Date, Money, URL, etc.
  • Model: DistilBERT-NER (ONNX)
  • Output: Entities with confidence scores and frame references

Logic Mesh

Entity-relationship graph connecting extracted entities:
  • Bidirectional graph structure
  • Nodes: Entities with types and mentions
  • Edges: Relationships with confidence
  • Enables: “follow” queries for fact traversal

Persistence

WAL (Write-Ahead Log)

Embedded circular buffer ensuring crash safety:
  • Purpose: Records mutations before they’re applied
  • Checksum: BLAKE3 hash for integrity verification
  • Recovery: Replays uncommitted entries after crash
  • Size: Configurable (64 KB to 64 MB)
Fixed 4 KB structure at file offset 0:
  • Magic bytes (MV2\0)
  • Spec and format versions
  • WAL offset and size
  • Footer offset pointer
Variable-length CBOR-serialized metadata at end of file:
  • Table of Contents (TOC)
  • Manifest pointers
  • Segment catalog
  • Checksums for validation

TOC (Table of Contents)

Master index structure in the footer:
  • Lists all frames with metadata
  • References to index manifests (lex, vec, time)
  • Segment catalog for published indices

Capacity & Licensing

Ticket

Signed proof of capacity grant:
  • Issuer: Authority that granted the capacity
  • Sequence: Monotonic identifier
  • Capacity: Bytes allowed
  • Signature: ED25519 digital signature
Tickets are validated cryptographically and cannot be forged.

Capacity Tiers

Storage limits based on plan:

Embedding Models

Local Models

Run entirely on your machine:

Cloud Models

API-based embedding providers:

CLIP Models

For visual/image embeddings:

Operations

put / put_many

Insert documents into memory:

find

Search the memory:

ask

AI-powered question answering:
Returns synthesized answer with source citations.

timeline

Browse frames by insertion order:

seal

Close and commit the memory file:
Commits pending changes and releases file lock.

Feature Flags

Cargo features that enable optional functionality:

Common Workflows

Ingestion → Search → Ask

Enrichment Pipeline


See Also

Five-Minute Guide

Get started with Memvid in minutes

Architecture Overview

Deep dive into how Memvid works

CLI Reference

Complete CLI command reference

SDK Comparison

Compare features across SDKs