Pivot from "Mem0 integration" to "Pluggable MemoryBackend Protocol"
The original framing of this issue was "integrate Mem0 as memory backend." Based on the v0.5 design pass documented in specs/08-memory-architecture.md, the better path is:
- Define a
MemoryBackend Protocol that any backend can implement
- Ship two backends: SQLite (default, current) + memory-hall (recommended for production)
- Leave room for community-contributed Mem0 / Letta / Graphiti backends later
Why memory-hall instead of Mem0 as the primary recommendation
Per specs/08-memory-architecture.md:
- memory-hall has first-class namespaces + agent_ids → matches VirtualMe's multi-role write pattern (extractor / reflector / evaluator / agent)
- memory-hall has built-in
upstream_ids + provenance_tier → matches VirtualMe's triangulation model
- memory-hall has CJK-native tokenization → meaningful share of VirtualMe users speak Mandarin / Cantonese / Japanese / Korean
- memory-hall is Apache 2.0, self-hostable, deliberately small (same design ethic as VirtualMe)
Mem0 is excellent for chat-agent accumulating memory, but it's not optimized for "structured persona artifact extraction with explicit provenance." Mem0 backend can be a community contribution later.
v0.5 implementation plan
src/virtualme/storage/
├─ interface.py # MemoryBackend Protocol
├─ sqlite_backend.py # Wraps existing db.py (no behavior change)
└─ memhall_backend.py # HTTP client with HMAC auth
Operator selects via env:
VIRTUALME_BACKEND=sqlite # default
# or
VIRTUALME_BACKEND=memory-hall
VIRTUALME_MEMHALL_ENDPOINT=http://localhost:9100
VIRTUALME_MEMHALL_TOKEN_FILE=~/.config/memhall/token
Acceptance criteria
Out of scope (separate issue)
Estimated effort
2-3 days for the Protocol + memhall backend. L3/L4 logic is a separate larger workstream.
Pivot from "Mem0 integration" to "Pluggable MemoryBackend Protocol"
The original framing of this issue was "integrate Mem0 as memory backend." Based on the v0.5 design pass documented in
specs/08-memory-architecture.md, the better path is:MemoryBackendProtocol that any backend can implementWhy memory-hall instead of Mem0 as the primary recommendation
Per
specs/08-memory-architecture.md:upstream_ids+provenance_tier→ matches VirtualMe's triangulation modelMem0 is excellent for chat-agent accumulating memory, but it's not optimized for "structured persona artifact extraction with explicit provenance." Mem0 backend can be a community contribution later.
v0.5 implementation plan
Operator selects via env:
Acceptance criteria
MemoryBackendProtocol defined perspecs/08-memory-architecture.md§"Integration interface"sqlite_backend.pyextracted from existingdb.py— zero behavior change for default usersmemhall_backend.pyimplemented with HMAC auth + retries + exponential backoffVIRTUALME_BACKENDenv var wiredprocess_turnflow runs identically against both backendsOut of scope (separate issue)
Estimated effort
2-3 days for the Protocol + memhall backend. L3/L4 logic is a separate larger workstream.