Two AI agents (two sessions, or an agent and a script) read the same file and both write it back. The later write silently clobbers the first: no error, the work is just gone. agent-coherence is a drop-in guard that catches the stale read before the overwrite lands, so the stale writer is denied and re-reads first. It ships as an MCP server, a LangGraph store drop-in, and a Python library. Single-host today (2+ agents on one machine); cross-host is opt-in, demo-grade. Open source, TLA+-checked.
No reviews yetBe the first to leave a review for agent-coherence
Maker
📌
AI agents are increasingly used to read, process, and write back to shared state — project files, memory stores, configuration, knowledge bases. When multiple agents do this across sessions or concurrently, a silent failure mode emerges: an agent reads state at time T, does work, then writes back at T+N — unaware that another agent or session already modified that state in between. The result is a silent lost update: the second write overwrites the first, with no error, no warning, and no indication anything went wrong.
agent-coherence is a data-plane coordination layer that eliminates this class of failures. It tracks read generations and enforces a freshness guarantee: before any agent can commit a write to shared state, the system validates that the agent's read is still current. If the state has changed since the agent last read it, the write is denied and the agent is required to re-acquire — re-reading the latest state before proceeding. This prevents stale overwrites both across sequential sessions (temporal coherence) and within concurrent runs on the same host (optimistic concurrency control via compare-and-swap writes).
The solution is delivered as an open-source Python library with a pluggable adapter model, a first-party Claude Code plugin for enforcing coherence on project rule files, and an MCP server interface for tool-native agent integration. It targets development teams building production AI agent workflows where correctness of shared state is business-critical.
Report
ran a quick test with two langgraph agents editing the same json file and it actually caught the stale write before the clobber, which is the exact thing i kept hitting. nice that it’s tiny to drop in.
Report
Maker
@kazanr41891 Love hearing this — that's exactly the failure mode I built this for. Curious which path caught it for you: was it the pessimistic side (stale-view writer denied, has to reacquire()) or did it go through write_cas because the two agents were racing rather than strictly sequential? Either way, glad it turned a silent clobber into something loud instead of a debugging session. Are you running it through CCSStore as a langgraph.store drop-in, or CoherentVolume directly against the file on disk?
ran a quick test with two langgraph agents editing the same json file and it actually caught the stale write before the clobber, which is the exact thing i kept hitting. nice that it’s tiny to drop in.