#218·memvid

Feature Request: Concurrent Writers Support for Multi-Agent Scenarios

Author: mikronn2Created Apr 5, 2026Updated Jul 17, 2026

Problem

Memvid's single-file architecture is perfect for AI agent memory, but the current limitation of single writer only creates challenges for multi-agent systems where multiple sessions need to write to the same memory file.

Use Case: Brain Project for AI Agents

We're building a persistent memory system for AI agents (OpenClaw) where:

  1. Main agent session (Cass) writes memories, reflections, insights
  2. Subagent sessions (spawned for tasks) also generate memories
  3. Background processes (dreaming, consolidation) write periodically
  4. All sessions need to read from the same memory file

Currently, we'd need to implement a central writer service or write queue system, which adds complexity and defeats Memvid's "zero infrastructure" value proposition.

Proposed Solution

Add support for concurrent writers to a single file. This could be implemented via:

Option A: File-Based Locking

  • file when writer is active
  • Wait/retry logic for concurrent access
  • Atomic lock acquisition/release

Option B: Advisory Locking (flock/fcntl)

  • OS-level file locking
  • Cross-platform (Linux, macOS, Windows)
  • Already battle-tested in SQLite and other embedded databases

Option C: WAL Merge Process

  • Multiple WAL files (one per writer session)
  • Background merge process combines them
  • Similar to how SQLite handles concurrent writes

Option D: Writer Process (Built-in)

  • Optional lightweight daemon that manages writes
  • runs as background process
  • Sessions send writes via IPC (Unix socket / named pipe)
  • Memvid SDK handles connection automatically

Why This Matters

Multi-agent systems are becoming the norm:

  • LangGraph agents with multiple workers
  • AutoGen multi-agent conversations
  • OpenClaw main + subagent architecture
  • CrewAI team-based workflows

All of these would benefit from a shared memory layer that multiple agents can write to simultaneously.

Current Workaround

We're considering a PostgreSQL + Memvid hybrid:

  • PostgreSQL handles concurrent writes
  • Memvid snapshots generated periodically for time-travel

But this loses the elegance of Memvid's single-file approach and introduces complexity we'd rather avoid.

Request

Please consider adding concurrent writer support in a future version. Even a simple file-locking mechanism would suffice for many use cases. The "single process, single writer" constraint is the only thing preventing us from adopting Memvid as our primary memory substrate.

Thank you for creating such an elegant solution for AI memory!