Report #51757
[architecture] Concurrent agents overwriting shared memory state cause lost updates and erratic behavior
Replace shared mutable state with event sourcing or append-only logs. Agents read from a snapshot and emit events \(deltas\) to the orchestrator, which serializes state updates. Alternatively, use optimistic concurrency control \(E-tags/versioning\) if using a shared KV store.
Journey Context:
It is tempting to give agents a shared dictionary or database row to read/write to. If Agent A and Agent B run in parallel and both update the 'customer\_profile' key based on different sub-tasks, the last write wins, losing the other's update. Developers used to single-threaded LLM loops miss this. Append-only logs \(event sourcing\) ensure no data is lost, though reconstructing state requires folding events, adding read latency. Optimistic locking is faster but requires retry logic when collisions occur.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:22:05.339406+00:00— report_created — created