The basic problem: graph databases can validate schema, but they usually do not know whether two accepted facts contradict each other. An AI memory layer can store both "Acme prefers annual billing" and "Acme rejected annual billing and requires monthly billing." Both writes may be valid. The contradiction only shows up later when an agent retrieves both and reasons over them.
SIGMA Guard tries to catch that earlier.
It represents claims as a graph with local consistency rules and checks whether the proposed structure can be made globally consistent. The underlying mechanism uses cellular sheaf cohomology. The practical interface is simpler: given claims, a graph, or a proposed write, it returns SAFE or UNSAFE with the contradiction details and a receipt hash.
The repo includes:
verify_claims - check a set of subject/property/value claims check_write - test a proposed graph write before commit verify_graph - verify a full graph MCP server support for Claude Desktop / agent workflows a local demo, no API key required
Install:
pip install sigma-guard[mcp]
Run MCP server:
sigma-guard-mcp
Or run the local demo:
git clone https://github.com/Jasonleonardvolk/sigma-guard cd sigma-guard pip install -e . python examples/verify_llm_output.py
I also ran a scale experiment because the obvious objection is that sheaf-style graph verification will not fit in memory. On a laptop, the current cellular implementation completed a 5M-vertex / 39,999,936-edge streaming run. The key trick was avoiding duplicated restriction matrices: 80M endpoint maps were represented by 1,024 canonical maps in a shared store. The streaming update path averaged 0.119 ms/edit with p99 1.534 ms in that run.
Separate from the streaming benchmark, I also ran a "poisoned edge" demo on the same 5M graph. One local restriction map was replaced with a cyclic permutation. Exact local verification recomputed one affected cell out of 25,473. H0 dropped from 8 to 1, meaning 7 local consistency modes were destroyed. That exact check took 11.5s because it used dense SVD on the affected cell; the point of that demo was localization and exactness, not production latency.
Limitations:
This is not a replacement for a graph database. It does not make LLM output true. The current exact poisoned-edge demo is slower than the streaming update path. Some demos use structured claims rather than arbitrary natural language. The interesting question is whether this belongs as a pre-commit / pre-output verifier for agent memory, not as a standalone database.
Repo:
https://github.com/Jasonleonardvolk/sigma-guard
I would be interested in feedback from people working on graph databases, GraphRAG, or agent memory. Does a deterministic "verify before memory write / before agent output" layer make sense in your stack?