Storage

Storage Architecture

MemoV organizes its storage in a .mem/ directory parallel to the project's .git/ folder.

Directory Structure

.mem/
├── memov.git/          # Bare Git repository (shadow timeline)
│   ├── objects/        # Git blobs, trees, commits
│   ├── refs/memov/     # MemoV-specific refs
│   └── notes/          # Git notes with prompt/response metadata
├── branches.json       # Branch metadata and labels
├── jump.json          # Jump history tracking
├── .memignore         # Files to exclude from tracking
├── pending_writes.json # RAG mode: pending VectorDB writes
└── vectordb/          # Optional ChromaDB for semantic search

Core Storage Components

Bare Git Repository

MemoV uses a bare Git repository at .mem/memov.git/ as its "source of truth."

Advantages:

BenefitDescription
No working directory conflictsBare repository never interferes with project workspace
Explicit snapshot controlUsers choose when to snapshot
Separation of concernsClear boundary between storage and working files
Custom refsUses refs/memov/HEAD without Git conflicts

Metadata Files

FilePurposeUpdate Pattern
branches.jsonBranch metadata and exploration historyWrite after commit
jump.jsonExploration timeline of time-travel operationsAppend after jump
.memignorePathspec patterns for exclusionUser edited
pending_writes.jsonRAG mode pending VectorDB writesWrite after operation

Git Notes for Context

MemoV attaches AI interaction metadata using Git notes:

Note Structure:

{
  "user_prompt": "Add error handling to the API",
  "original_response": "I'll add try-catch blocks...",
  "agent_plan": ["1. Add try-catch in api.py", "2. Create custom exceptions"],
  "by_user": false
}

Storage Consistency Model

ComponentWrite PatternRead PatternConsistency
.mem/memov.git/Write-through via GitManagerRead-throughStrong (Git ACID)
branches.jsonWrite after commitLoad on demandEventual
jump.jsonAppend after jumpLoad on demandEventual
pending_writes.jsonWrite after operationLoad at initEventual
.memignoreUser editedLoad on demandEventual
vectordb/Batch write via syncQuery via ChromaDBEventual

VectorDB Storage (RAG Mode)

When RAG mode is enabled, MemoV maintains a ChromaDB instance for semantic search:

Collections:

  • prompts - User prompt embeddings
  • responses - AI response embeddings
  • code_changes - Code diff embeddings

Design Decisions

Why Subprocess over GitPython?

MemoV invokes Git CLI rather than using Python libraries:

  • Exact Git behavior guaranteed
  • Direct access to low-level plumbing commands
  • Full compatibility with bare repositories
  • No library version conflicts

Why Content-Addressable Storage?

Git's content-addressable model provides:

  • Automatic deduplication of identical files
  • Integrity verification via SHA hashes
  • Efficient storage of similar content
  • Proven reliability at scale

Storage Operations

Initialization

mem init

Creates:

  1. .mem/ directory
  2. Bare Git repository at .mem/memov.git/
  3. Default .memignore file
  4. Empty branches.json

Snapshot Flow