Show HN: Sigma Guard – 그래프 메모리에 대한 결정론적 모순 검사
hackernews
|
|
📰 뉴스
#claude
#오픈소스
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
저는 그래프 기반 AI 메모리와 GraphRAG 스타일 시스템을 위한 작은 오픈 소스 검증 도구를 구축했습니다.<p>기본적인 문제: 그래프 데이터베이스는 스키마를 검증할 수 있지만 일반적으로 허용되는 두 사실이 서로 모순되는지 여부를 알지 못합니다. AI 메모리 레이어는 "Acme는 연간 청구를 선호합니다"와 "Acme는 연간 청구를 선호합니다"라는 두 가지를 모두 저장할 수 있습니다. 및 "Acme는 연간 청구를 거부하고 월별 청구를 요구합니다." 두 쓰기가 모두 유효할 수 있습니다. 모순은 나중에 상담원이 두 가지를 모두 검색하고 그 이유를 설명할 때만 나타납니다.</p><p>
본문
I built a small open-source verifier for graph-backed AI memory and GraphRAG-style systems.<p>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.</p><p>SIGMA Guard tries to catch that earlier.</p><p>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.</p><p>The repo includes:</p><p>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</p><p>Install:</p><p>pip install sigma-guard[mcp]</p><p>Run MCP server:</p><p>sigma-guard-mcp</p><p>Or run the local demo:</p><p>git clone <a href="https://github.com/Jasonleonardvolk/sigma-guard" rel="nofollow">https://github.com/Jasonleonardvolk/sigma-guard</a>
cd sigma-guard
pip install -e .
python examples/verify_llm_output.py</p><p>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.</p><p>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.</p><p>Limitations:</p><p>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.</p><p>Repo:</p><p><a href="https://github.com/Jasonleonardvolk/sigma-guard" rel="nofollow">https://github.com/Jasonleonardvolk/sigma-guard</a></p><p>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?</p>
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</p><p>Install:</p><p>pip install sigma-guard[mcp]</p><p>Run MCP server:</p><p>sigma-guard-mcp</p><p>Or run the local demo:</p><p>git clone <a href="https://github.com/Jasonleonardvolk/sigma-guard" rel="nofollow">https://github.com/Jasonleonardvolk/sigma-guard</a>
cd sigma-guard
pip install -e .
python examples/verify_llm_output.py</p><p>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.</p><p>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.</p><p>Limitations:</p><p>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.</p><p>Repo:</p><p><a href="https://github.com/Jasonleonardvolk/sigma-guard" rel="nofollow">https://github.com/Jasonleonardvolk/sigma-guard</a></p><p>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?</p>
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유