memvid-core can open .mv2 files and mutate them directly, mirroring CLI behavior.
Memvid::create(path)– creates a new.mv2and takes an exclusive lockMemvid::open(path)– opens an existing.mv2with an exclusive lock (and performs recovery if needed)Memvid::open_read_only(path)– opens a consistent snapshot with a shared lockput_bytes*/put_with_embedding*– append frames (optionally with pre-computed embeddings)commit()– makes changes durable and visible to readers
FileLock internally: writers (create/open) take an exclusive lock, while readers (open_read_only) share a lock for concurrent queries. Mutation APIs call Memvid::ensure_writable() and will fail if the handle is read-only.
Best practice: Call commit() after batches. Read-only snapshots only see committed state; uncommitted changes remain in the embedded WAL until a commit or the next writer open/recovery.