hypgraph 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. hypgraph-0.1.0/.gitignore +16 -0
  2. hypgraph-0.1.0/AGENTS.md +82 -0
  3. hypgraph-0.1.0/CITATION.cff +24 -0
  4. hypgraph-0.1.0/LICENSE +201 -0
  5. hypgraph-0.1.0/PKG-INFO +140 -0
  6. hypgraph-0.1.0/README.md +110 -0
  7. hypgraph-0.1.0/docs/PLAN.md +110 -0
  8. hypgraph-0.1.0/docs/spec.md +171 -0
  9. hypgraph-0.1.0/pyproject.toml +56 -0
  10. hypgraph-0.1.0/src/hypgraph/__init__.py +28 -0
  11. hypgraph-0.1.0/src/hypgraph/__main__.py +3 -0
  12. hypgraph-0.1.0/src/hypgraph/bundle.py +216 -0
  13. hypgraph-0.1.0/src/hypgraph/checks.py +140 -0
  14. hypgraph-0.1.0/src/hypgraph/cli.py +445 -0
  15. hypgraph-0.1.0/src/hypgraph/demos/__init__.py +3 -0
  16. hypgraph-0.1.0/src/hypgraph/demos/broad_street.py +283 -0
  17. hypgraph-0.1.0/src/hypgraph/derive.py +390 -0
  18. hypgraph-0.1.0/src/hypgraph/graph.py +1002 -0
  19. hypgraph-0.1.0/src/hypgraph/mcp.py +461 -0
  20. hypgraph-0.1.0/src/hypgraph/plan.py +328 -0
  21. hypgraph-0.1.0/src/hypgraph/policy.py +51 -0
  22. hypgraph-0.1.0/src/hypgraph/schema.py +141 -0
  23. hypgraph-0.1.0/src/hypgraph/server.py +202 -0
  24. hypgraph-0.1.0/src/hypgraph/skill/SKILL.md +94 -0
  25. hypgraph-0.1.0/src/hypgraph/store.py +139 -0
  26. hypgraph-0.1.0/src/hypgraph/ui/__init__.py +7 -0
  27. hypgraph-0.1.0/src/hypgraph/ui/atlas.css +219 -0
  28. hypgraph-0.1.0/src/hypgraph/ui/atlas.js +1052 -0
  29. hypgraph-0.1.0/src/hypgraph/ui/hypgraph.svg +10 -0
  30. hypgraph-0.1.0/src/hypgraph/ui/index.html +30 -0
  31. hypgraph-0.1.0/src/hypgraph/ui/vendor/LICENSES.md +10 -0
  32. hypgraph-0.1.0/src/hypgraph/ui/vendor/cose-base.js +3214 -0
  33. hypgraph-0.1.0/src/hypgraph/ui/vendor/cytoscape-fcose.js +1549 -0
  34. hypgraph-0.1.0/src/hypgraph/ui/vendor/cytoscape.min.js +32 -0
  35. hypgraph-0.1.0/src/hypgraph/ui/vendor/layout-base.js +5230 -0
  36. hypgraph-0.1.0/tests/test_engine.py +423 -0
  37. hypgraph-0.1.0/tests/test_incremental.py +106 -0
  38. hypgraph-0.1.0/tests/test_surfaces.py +270 -0
@@ -0,0 +1,16 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .mypy_cache/
7
+ build/
8
+ dist/
9
+ .venv/
10
+ venv/
11
+ *.hypgraph
12
+ *.hypgraph-journal
13
+ research.hypgraph*
14
+ .DS_Store
15
+ Thumbs.db
16
+ .claude/
@@ -0,0 +1,82 @@
1
+ # HypGraph for agents
2
+
3
+ You are an AI agent and you've been pointed at HypGraph. This page is for you; https://hypgraph.com/llms.txt is the
4
+ same in short.
5
+
6
+ **What it is.** A research record you write into and can't flatter. You add questions, hypotheses, experiments, runs,
7
+ results, claims, sources, reviews and decisions. You can't set how well anything is known: review state, risk,
8
+ independent support and evidence strength are worked out from the record each time it's read. Every write is a
9
+ hash-chained event.
10
+
11
+ **Why you'd want it.** It stops the mistakes agents make most: stating numbers no result contains, writing "always"
12
+ about one run, calling a weak search an exclusion, citing a claim whose premise was withdrawn, and treating three
13
+ copies of one result as three lines of evidence. When the record refuses a write, the message says exactly what to
14
+ fix.
15
+
16
+ ## Connect
17
+
18
+ **As a skill** (Claude Code and other Agent Skills hosts), install the skill with:
19
+
20
+ ```bash
21
+ pip install hypgraph
22
+ hypgraph skill --install # writes .claude/skills/hypgraph/SKILL.md (--user: under your home directory)
23
+ ```
24
+
25
+ The skill's source is `src/hypgraph/skill/SKILL.md`, also at https://hypgraph.com/SKILL.md.
26
+
27
+ **As an MCP server:**
28
+
29
+ ```bash
30
+ pip install "hypgraph[mcp]"
31
+ claude mcp add hypgraph -- hypgraph --db study.hypgraph --as <your-name> mcp
32
+ ```
33
+
34
+ Any MCP client works. Command `hypgraph`, args `["--db", "study.hypgraph", "--as", "<your-name>", "mcp"]`.
35
+ For HTTP: `hypgraph --db study.hypgraph --as <your-name> mcp --transport http --port 8766`.
36
+
37
+ You write as one author, fixed when the server starts. The names `lab`, `operator`, `importer` and `system` are
38
+ reserved.
39
+
40
+ ## The method
41
+
42
+ 1. **`overview()` first.** Read what's known before re-deriving anything.
43
+ 2. **Hypotheses with predictions.** `add("hypothesis", {"statement": …, "predictions": […]})`. Rivals get
44
+ `alternative_to`.
45
+ 3. **Experiments that can fail.** `add("experiment", {...}, links=[{"rel": "tests", "to": "H1", "data": {"expected":
46
+ "…"}}, …])`. Write what each hypothesis expects *before* you run anything. An experiment whose expected outcomes
47
+ differ between hypotheses ranks higher in `next_experiments()`. One with a `power_check` ranks higher still.
48
+ 4. **Runs and results.** `register_run(name, code_paths=[…], input_paths=[…], output_paths=[…], result_summary=…,
49
+ result_values={"rate": {"value": 0.31}, "hits": {"k": 4, "n": 50}})`. The server hashes the files.
50
+ 5. **Claims carry their numbers.**
51
+ ```json
52
+ {"statement": "The planted key was recovered in 4 of 50 trials.",
53
+ "scope": "50 synthetic ciphers of 200 letters, quadgram scoring, 10 restarts each.",
54
+ "kind": "finding",
55
+ "measurements": [{"name": "recovered", "result": "RS3", "key": "hits", "k": 4, "n": 50}]}
56
+ ```
57
+ with `links=[{"rel": "supports", "from": "RS3", "why": "RS3 is the measurement this claim states."}]`.
58
+ - every number in the statement must match a bound measurement, the scope, or an investigation constant;
59
+ - "never", "all", "always" or "proves" need a measurement with k = 0 or k = n;
60
+ - `kind: "exclusion"` needs a result with `power: "demonstrated"` (a search that found a planted answer).
61
+ Otherwise use `"inconclusive"`.
62
+ 6. **Reviews.** Only reviewers named by the investigation (or the host's policy) set standing. Nobody reviews their
63
+ own work. A revision makes earlier reviews stale.
64
+ 7. **Start summaries from `report()`.** It's generated from the record, so it can't restate a withdrawn claim. Write
65
+ your interpretation underneath it.
66
+
67
+ ## Reading standing
68
+
69
+ Every node carries `state.sentence`, for example:
70
+
71
+ > active claim · checked (fisher:pass, v2) · 2 independent lines of support · replicated on new data · no external replication
72
+
73
+ `AT RISK — rests on CL4` means a premise fell. `REVISIT — its basis changed: CL1 v1→v2` means a decision rested on an
74
+ older version. `UNSUPPORTED` means every support has fallen. Before citing a node marked contested or at risk, check
75
+ it.
76
+
77
+ ## Without MCP
78
+
79
+ - Python: `from hypgraph import Graph` (see README.md).
80
+ - CLI: `hypgraph --json …` gives machine-readable output.
81
+ - HTTP: `hypgraph serve --writable`, then `POST /api/graph/write {"op": "create", "author": …}`.
82
+ - Format: `hypgraph schema --json`, or https://hypgraph.com/schema/hypgraph-1.json.
@@ -0,0 +1,24 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use HypGraph in your research or teaching, please cite it."
3
+ title: "HypGraph: a research record that can't flatter itself"
4
+ abstract: >-
5
+ An append-only, hash-chained record of questions, hypotheses, experiments, runs, results, claims, sources,
6
+ reviews and decisions, whose standing (review, risk, independent support, evidence strength) is derived on read
7
+ and never asserted. Claims are checked on write: numbers bound to results, absolutes backed by k of n, exclusions
8
+ backed by a powered search.
9
+ type: software
10
+ authors:
11
+ - family-names: Houghtaling
12
+ given-names: Nicolas
13
+ license: Apache-2.0
14
+ version: 0.1.0
15
+ date-released: "2026-10-24"
16
+ url: "https://hypgraph.com"
17
+ repository-code: "https://github.com/voodoomods/hypgraph"
18
+ keywords:
19
+ - research provenance
20
+ - reproducibility
21
+ - hypothesis testing
22
+ - open science
23
+ - AI agents
24
+ - Model Context Protocol
hypgraph-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.5
2
+ Name: hypgraph
3
+ Version: 0.1.0
4
+ Summary: The evidence layer for AI research agents: a hash-chained research record that checks every claim as it is written and derives how well each is known.
5
+ Project-URL: Homepage, https://hypgraph.com
6
+ Project-URL: Documentation, https://hypgraph.com/engineers/
7
+ Project-URL: Changelog, https://github.com/voodoomods/hypgraph/blob/main/CHANGELOG.md
8
+ Project-URL: Source, https://github.com/voodoomods/hypgraph
9
+ Author: Nicolas Houghtaling
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: agent-skills,ai-agents,evaluation,hypothesis,mcp,provenance,reproducibility,research
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Provides-Extra: all
23
+ Requires-Dist: fastmcp>=2.12; extra == 'all'
24
+ Requires-Dist: pytest>=8; extra == 'all'
25
+ Provides-Extra: mcp
26
+ Requires-Dist: fastmcp>=2.12; extra == 'mcp'
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=8; extra == 'test'
29
+ Description-Content-Type: text/markdown
30
+
31
+ <p align="center"><img src="https://hypgraph.com/assets/hypgraph.svg" width="72" alt=""></p>
32
+
33
+ <h1 align="center">HypGraph</h1>
34
+ <p align="center"><b>Don't believe the hype. Test the hyp.</b><br>
35
+ The evidence layer for AI research agents.<br>
36
+ <a href="https://hypgraph.com">hypgraph.com</a> · <a href="https://hypgraph.com/agents/">for agents</a> ·
37
+ <a href="https://hypgraph.com/engineers/">for engineers</a> · <a href="https://hypgraph.com/spec/">record format</a></p>
38
+
39
+ ---
40
+
41
+ Agents doing research write fluent summaries. Some of the numbers in them match no result. "Always" gets written
42
+ about one run, a search too weak to find anything becomes "ruled out", and three copies of one result get counted as
43
+ three lines of evidence. HypGraph is the record they write into instead. It checks every claim as it's written, so
44
+ those claims can't get in:
45
+
46
+ ```text
47
+ $ hypgraph add claim statement="The fine-tune is 5 points better than the baseline." scope="2,000 held-out items, greedy decoding, one seed." --link "supports:from:RS1:the eval run"
48
+ refused: claim refused:
49
+ - numbers in the statement that no bound measurement, the scope or the investigation's constants account for: 5 — bind them to result fields (measurements) or move design constants into the scope
50
+ ```
51
+
52
+ (The result said 1,624 against 1,568 correct out of 2,000. That's 2.8 points.)
53
+
54
+ Every refusal says what to fix, so an agent can act on it. Nothing in the record is ever *set* as known. How well
55
+ each claim is known is **derived on every read**:
56
+
57
+ - **reviewed, and which version?** Only named reviewers count, and never on their own work. A revised claim goes back
58
+ to unchecked.
59
+ - **does it rest on something that fell?** Withdraw a premise and everything built on it is flagged **AT RISK**. A
60
+ decision whose evidence changed is flagged **REVISIT**.
61
+ - **how many independent lines?** Results that share a run, a data file or a source count **once**.
62
+ - **how strong is the best one?** From an agent's report, through a run your job runner recorded and a separate
63
+ implementation, up to a replication on new data.
64
+
65
+ Every write is an event in a **SHA-256 hash chain**. A record can be handed to a reviewer, a regulator or another
66
+ team, and they can verify it without trusting you.
67
+
68
+ ## Connect your agent
69
+
70
+ ```bash
71
+ pip install "hypgraph[mcp]"
72
+ claude mcp add hypgraph -- hypgraph --db study.hypgraph --as claude mcp # any MCP client works
73
+ hypgraph skill --install # + the Agent Skill (.claude/skills/hypgraph/SKILL.md)
74
+ ```
75
+
76
+ The server writes as one author, fixed when it starts. The agent can't pass another name or write as your job runner,
77
+ and its verdicts count only if you name it as a reviewer. Tools: `overview`, `find`, `show`, `start_investigation`,
78
+ `add`, `link`, `revise`, `withdraw`, `retract_link`, `review`, `next_experiments`, `work_queue`, `claim_work`,
79
+ `register_run`, `report`, `verify`, `schema`. The method is in [AGENTS.md](https://github.com/voodoomods/hypgraph/blob/main/AGENTS.md); the short version is
80
+ [llms.txt](https://hypgraph.com/llms.txt).
81
+
82
+ ## Wire it into your system
83
+
84
+ The core is one Python package with no dependencies. You decide who is trusted to do what:
85
+
86
+ ```python
87
+ from hypgraph import Graph, Policy
88
+
89
+ g = Graph("research.hypgraph",
90
+ policy=Policy(reviewers={"critic", "stats"}, # whose verdicts count
91
+ instrument="runner"), # the only author that files lab-recorded runs
92
+ spend=my_ledger.spend) # optional: prices the work behind each investigation
93
+
94
+ with g.writing_for(task_id): # every event carries the task, for cost tracing
95
+ g.create(author=agent_name, type="claim", inv=inv, fields={...}, links=[...])
96
+ ```
97
+
98
+ - **Multi-agent:** give each agent its own author name. Make your critic agents reviewers. Have your job runner
99
+ write as the instrument, so its runs count as recorded, not reported.
100
+ - **Your web framework:** `hypgraph.server.dispatch(graph, method, path, query, body)` is the JSON API, and
101
+ `hypgraph.ui.static_dir()` is the Atlas explorer to mount next to it.
102
+ - **CI:** `hypgraph export -o record.bundle.json && hypgraph verify record.bundle.json`. The bundle is a single file
103
+ your reviewers or auditors can check with SHA-256, in any language or in the browser.
104
+
105
+ The full guide is at [hypgraph.com/engineers](https://hypgraph.com/engineers/).
106
+
107
+ ## Try it
108
+
109
+ ```bash
110
+ pip install hypgraph
111
+ hypgraph demo # a complete worked investigation (Broad Street, 1854) built into ./research.hypgraph
112
+ hypgraph serve # explore it in the Atlas: http://127.0.0.1:8765
113
+ hypgraph report # the facts, generated from the record
114
+ ```
115
+
116
+ Or try to get a claim past the real engine in your browser: [hypgraph.com/play](https://hypgraph.com/play/).
117
+
118
+ ## Where it came from
119
+
120
+ HypGraph is the research graph of PegasusDMZ, where a team of AI agents runs long investigations under governed
121
+ egress, pulled out so anyone can use it. Each rule exists because the agents made the mistake behind it:
122
+ - a validation that was blind to the answer;
123
+ - a null model that broke the system's own rules;
124
+ - a summary whose numbers matched no result;
125
+ - "never" written about something that happened once in a thousand.
126
+
127
+ PegasusDMZ is the reference deployment, and its Atlas is built from this package. Against PegasusDMZ's live record
128
+ (1,357 events, 790 nodes), the library derives the same standing for every node as the engine it replaced.
129
+
130
+ ## Performance
131
+
132
+ The engine is pure Python and stays fast at the sizes research records reach. At 10,000 nodes, deriving every node's
133
+ standing takes 0.09 s, reading one node 0.3 ms, and a write about 10 ms, mostly SQLite committing to disk. A write
134
+ costs what it touches: cached standing is kept for every node the write can't affect, and a randomized suite checks
135
+ that against a full rebuild.
136
+
137
+ ## License
138
+
139
+ Code: [Apache-2.0](https://github.com/voodoomods/hypgraph/blob/main/LICENSE). The record format ([docs/spec.md](https://github.com/voodoomods/hypgraph/blob/main/docs/spec.md)) and the docs: CC BY 4.0. Cite it with
140
+ [CITATION.cff](https://github.com/voodoomods/hypgraph/blob/main/CITATION.cff).
@@ -0,0 +1,110 @@
1
+ <p align="center"><img src="https://hypgraph.com/assets/hypgraph.svg" width="72" alt=""></p>
2
+
3
+ <h1 align="center">HypGraph</h1>
4
+ <p align="center"><b>Don't believe the hype. Test the hyp.</b><br>
5
+ The evidence layer for AI research agents.<br>
6
+ <a href="https://hypgraph.com">hypgraph.com</a> · <a href="https://hypgraph.com/agents/">for agents</a> ·
7
+ <a href="https://hypgraph.com/engineers/">for engineers</a> · <a href="https://hypgraph.com/spec/">record format</a></p>
8
+
9
+ ---
10
+
11
+ Agents doing research write fluent summaries. Some of the numbers in them match no result. "Always" gets written
12
+ about one run, a search too weak to find anything becomes "ruled out", and three copies of one result get counted as
13
+ three lines of evidence. HypGraph is the record they write into instead. It checks every claim as it's written, so
14
+ those claims can't get in:
15
+
16
+ ```text
17
+ $ hypgraph add claim statement="The fine-tune is 5 points better than the baseline." scope="2,000 held-out items, greedy decoding, one seed." --link "supports:from:RS1:the eval run"
18
+ refused: claim refused:
19
+ - numbers in the statement that no bound measurement, the scope or the investigation's constants account for: 5 — bind them to result fields (measurements) or move design constants into the scope
20
+ ```
21
+
22
+ (The result said 1,624 against 1,568 correct out of 2,000. That's 2.8 points.)
23
+
24
+ Every refusal says what to fix, so an agent can act on it. Nothing in the record is ever *set* as known. How well
25
+ each claim is known is **derived on every read**:
26
+
27
+ - **reviewed, and which version?** Only named reviewers count, and never on their own work. A revised claim goes back
28
+ to unchecked.
29
+ - **does it rest on something that fell?** Withdraw a premise and everything built on it is flagged **AT RISK**. A
30
+ decision whose evidence changed is flagged **REVISIT**.
31
+ - **how many independent lines?** Results that share a run, a data file or a source count **once**.
32
+ - **how strong is the best one?** From an agent's report, through a run your job runner recorded and a separate
33
+ implementation, up to a replication on new data.
34
+
35
+ Every write is an event in a **SHA-256 hash chain**. A record can be handed to a reviewer, a regulator or another
36
+ team, and they can verify it without trusting you.
37
+
38
+ ## Connect your agent
39
+
40
+ ```bash
41
+ pip install "hypgraph[mcp]"
42
+ claude mcp add hypgraph -- hypgraph --db study.hypgraph --as claude mcp # any MCP client works
43
+ hypgraph skill --install # + the Agent Skill (.claude/skills/hypgraph/SKILL.md)
44
+ ```
45
+
46
+ The server writes as one author, fixed when it starts. The agent can't pass another name or write as your job runner,
47
+ and its verdicts count only if you name it as a reviewer. Tools: `overview`, `find`, `show`, `start_investigation`,
48
+ `add`, `link`, `revise`, `withdraw`, `retract_link`, `review`, `next_experiments`, `work_queue`, `claim_work`,
49
+ `register_run`, `report`, `verify`, `schema`. The method is in [AGENTS.md](https://github.com/voodoomods/hypgraph/blob/main/AGENTS.md); the short version is
50
+ [llms.txt](https://hypgraph.com/llms.txt).
51
+
52
+ ## Wire it into your system
53
+
54
+ The core is one Python package with no dependencies. You decide who is trusted to do what:
55
+
56
+ ```python
57
+ from hypgraph import Graph, Policy
58
+
59
+ g = Graph("research.hypgraph",
60
+ policy=Policy(reviewers={"critic", "stats"}, # whose verdicts count
61
+ instrument="runner"), # the only author that files lab-recorded runs
62
+ spend=my_ledger.spend) # optional: prices the work behind each investigation
63
+
64
+ with g.writing_for(task_id): # every event carries the task, for cost tracing
65
+ g.create(author=agent_name, type="claim", inv=inv, fields={...}, links=[...])
66
+ ```
67
+
68
+ - **Multi-agent:** give each agent its own author name. Make your critic agents reviewers. Have your job runner
69
+ write as the instrument, so its runs count as recorded, not reported.
70
+ - **Your web framework:** `hypgraph.server.dispatch(graph, method, path, query, body)` is the JSON API, and
71
+ `hypgraph.ui.static_dir()` is the Atlas explorer to mount next to it.
72
+ - **CI:** `hypgraph export -o record.bundle.json && hypgraph verify record.bundle.json`. The bundle is a single file
73
+ your reviewers or auditors can check with SHA-256, in any language or in the browser.
74
+
75
+ The full guide is at [hypgraph.com/engineers](https://hypgraph.com/engineers/).
76
+
77
+ ## Try it
78
+
79
+ ```bash
80
+ pip install hypgraph
81
+ hypgraph demo # a complete worked investigation (Broad Street, 1854) built into ./research.hypgraph
82
+ hypgraph serve # explore it in the Atlas: http://127.0.0.1:8765
83
+ hypgraph report # the facts, generated from the record
84
+ ```
85
+
86
+ Or try to get a claim past the real engine in your browser: [hypgraph.com/play](https://hypgraph.com/play/).
87
+
88
+ ## Where it came from
89
+
90
+ HypGraph is the research graph of PegasusDMZ, where a team of AI agents runs long investigations under governed
91
+ egress, pulled out so anyone can use it. Each rule exists because the agents made the mistake behind it:
92
+ - a validation that was blind to the answer;
93
+ - a null model that broke the system's own rules;
94
+ - a summary whose numbers matched no result;
95
+ - "never" written about something that happened once in a thousand.
96
+
97
+ PegasusDMZ is the reference deployment, and its Atlas is built from this package. Against PegasusDMZ's live record
98
+ (1,357 events, 790 nodes), the library derives the same standing for every node as the engine it replaced.
99
+
100
+ ## Performance
101
+
102
+ The engine is pure Python and stays fast at the sizes research records reach. At 10,000 nodes, deriving every node's
103
+ standing takes 0.09 s, reading one node 0.3 ms, and a write about 10 ms, mostly SQLite committing to disk. A write
104
+ costs what it touches: cached standing is kept for every node the write can't affect, and a randomized suite checks
105
+ that against a full rebuild.
106
+
107
+ ## License
108
+
109
+ Code: [Apache-2.0](https://github.com/voodoomods/hypgraph/blob/main/LICENSE). The record format ([docs/spec.md](https://github.com/voodoomods/hypgraph/blob/main/docs/spec.md)) and the docs: CC BY 4.0. Cite it with
110
+ [CITATION.cff](https://github.com/voodoomods/hypgraph/blob/main/CITATION.cff).