Skip to main content

File Security

How are .mv2 files protected?

Integrity relies on cascading checksums:
  • Header checksum: Validates file header
  • TOC checksum: Validates table of contents
  • Per-segment checksums: Validates each data segment
  • Time index checksum: Validates timeline data
Confidentiality depends on OS file permissions. Memvid intentionally avoids bundling key management to keep the core simple.

Are checksums validated automatically?

Yes. When opening a file, Memvid validates:
  1. Header checksum
  2. TOC integrity
  3. WAL consistency
Deep verification (via memvid verify --deep) additionally checks all segment checksums.

What happens if a file is corrupted?

Memvid provides tools to detect and repair corruption:
The embedded WAL protects against data loss from crashes or power failures.

Crash Safety

What ensures data survives crashes?

The embedded Write-Ahead Log (WAL):
  1. All mutations are written to WAL first
  2. WAL is synced to disk (fsync)
  3. Changes are then applied to main data
  4. On recovery, uncommitted WAL entries are replayed

How long does recovery take?

Recovery is fast:
  • Typical recovery: < 100ms
  • Large WAL replay (4MB): < 250ms

Are there any single points of failure?

No. The .mv2 file is self-contained:
  • No external databases
  • No network dependencies
  • No sidecar files that could be lost

Access Control

How does file locking work?

Memvid uses OS-level file locks:
  • Writers: Exclusive lock (one at a time)
  • Readers: Shared lock (multiple concurrent)

Can multiple users access the same file?

Yes, but only one can write at a time:

Data Privacy

Is my data sent anywhere?

Local operations (search, timeline, stats) never send data anywhere. Ask operations with external LLMs (openai, claude, gemini) send context to those providers. To prevent this:
  1. Use the local model (tinyllama):
  1. Use context-only mode:
  1. Enable PII masking:

What does PII masking protect?

The --mask-pii flag masks sensitive information before sending to external LLMs:

Using PII Masking

CLI:
Python SDK:
Node.js SDK:
PII masking is applied to the context sent to external LLMs, not to data stored in the memory file. The original data remains intact.

Verification

How do I verify file integrity?

What does deep verification check?


Best Practices

File Storage

  1. Use appropriate permissions: Restrict file access to authorized users
  2. Regular backups: Copy .mv2 files to backup storage
  3. Verify after transfer: Run memvid verify --deep after copying files

Production Use

  1. Read-only mode: Use for query-only workloads
  2. Monitor capacity: Check utilization before large ingestions
  3. Periodic verification: Run memvid verify --deep weekly

Sensitive Data

  1. PII masking: Always enable for external LLM calls
  2. Local models: Use tinyllama for sensitive queries
  3. Context-only mode: Get relevant docs without LLM synthesis