hypermind 0.11.0__py3-none-any.whl

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 (181) hide show
  1. hmctl/__init__.py +7 -0
  2. hmctl/cli.py +947 -0
  3. hypermind/__init__.py +208 -0
  4. hypermind/_deprecations.py +108 -0
  5. hypermind/agent.py +2896 -0
  6. hypermind/agent_card.py +127 -0
  7. hypermind/api/__init__.py +32 -0
  8. hypermind/api/app.py +686 -0
  9. hypermind/capability.py +923 -0
  10. hypermind/consult.py +493 -0
  11. hypermind/consult_bias.py +112 -0
  12. hypermind/contract_net.py +219 -0
  13. hypermind/crypto/__init__.py +21 -0
  14. hypermind/crypto/cose_encrypt.py +126 -0
  15. hypermind/crypto/dkg.py +246 -0
  16. hypermind/crypto/domain.py +59 -0
  17. hypermind/crypto/frost.py +771 -0
  18. hypermind/crypto/hashing.py +38 -0
  19. hypermind/crypto/hlc.py +163 -0
  20. hypermind/crypto/hpke.py +277 -0
  21. hypermind/crypto/kms.py +196 -0
  22. hypermind/crypto/kms_backends/__init__.py +56 -0
  23. hypermind/crypto/kms_backends/aws.py +128 -0
  24. hypermind/crypto/kms_backends/azure.py +114 -0
  25. hypermind/crypto/kms_backends/gcp.py +97 -0
  26. hypermind/crypto/kms_backends/vault.py +120 -0
  27. hypermind/crypto/namespace_root.py +204 -0
  28. hypermind/crypto/pq.py +152 -0
  29. hypermind/crypto/room_epoch.py +97 -0
  30. hypermind/crypto/signing.py +245 -0
  31. hypermind/deliberation.py +355 -0
  32. hypermind/did_web.py +256 -0
  33. hypermind/dispute.py +858 -0
  34. hypermind/errors.py +218 -0
  35. hypermind/eval/__init__.py +49 -0
  36. hypermind/eval/calibration.py +307 -0
  37. hypermind/eval/comparison.py +251 -0
  38. hypermind/eval/replay.py +202 -0
  39. hypermind/eval/swarm_iq.py +718 -0
  40. hypermind/knowledge/__init__.py +17 -0
  41. hypermind/knowledge/citation_graph.py +141 -0
  42. hypermind/knowledge/correlated_agreement.py +167 -0
  43. hypermind/knowledge/embedding_registry.py +115 -0
  44. hypermind/knowledge/kernel_store.py +197 -0
  45. hypermind/knowledge/rekor.py +173 -0
  46. hypermind/knowledge/reputation.py +364 -0
  47. hypermind/knowledge/swarm_memory.py +523 -0
  48. hypermind/knowledge/transparency.py +409 -0
  49. hypermind/mcp/__init__.py +60 -0
  50. hypermind/mcp/bridge.py +151 -0
  51. hypermind/mcp/client.py +142 -0
  52. hypermind/mcp/provenance.py +214 -0
  53. hypermind/mcp/relata_tools.py +152 -0
  54. hypermind/mcp/server.py +248 -0
  55. hypermind/mcp/transport.py +206 -0
  56. hypermind/mind/__init__.py +150 -0
  57. hypermind/mind/active.py +234 -0
  58. hypermind/mind/belief.py +369 -0
  59. hypermind/mind/deliberator.py +625 -0
  60. hypermind/mind/diversity.py +144 -0
  61. hypermind/mind/evolve.py +184 -0
  62. hypermind/mind/federation.py +154 -0
  63. hypermind/mind/goals.py +117 -0
  64. hypermind/mind/integration.py +190 -0
  65. hypermind/mind/mediator.py +74 -0
  66. hypermind/mind/memory_store.py +129 -0
  67. hypermind/mind/policy.py +307 -0
  68. hypermind/mind/records.py +260 -0
  69. hypermind/mind/roles.py +190 -0
  70. hypermind/mind/sybil_guard.py +41 -0
  71. hypermind/mind/world_model.py +166 -0
  72. hypermind/namespace.py +515 -0
  73. hypermind/namespace_policy.py +254 -0
  74. hypermind/observability/__init__.py +25 -0
  75. hypermind/observability/asgi.py +214 -0
  76. hypermind/observability/cost.py +277 -0
  77. hypermind/observability/otel_export.py +200 -0
  78. hypermind/observability/recorder.py +344 -0
  79. hypermind/observability/swarm_trace.py +438 -0
  80. hypermind/pin_policy.py +116 -0
  81. hypermind/py.typed +0 -0
  82. hypermind/responders/__init__.py +87 -0
  83. hypermind/responders/anthropic.py +159 -0
  84. hypermind/responders/base.py +162 -0
  85. hypermind/responders/openai.py +199 -0
  86. hypermind/responders/router.py +254 -0
  87. hypermind/responders/structured.py +287 -0
  88. hypermind/responders/tools.py +444 -0
  89. hypermind/revocation.py +270 -0
  90. hypermind/rule_ids.py +135 -0
  91. hypermind/schemas/encrypted_statement.cddl +28 -0
  92. hypermind/schemas/namespace_accept.cddl +20 -0
  93. hypermind/schemas/namespace_create.cddl +25 -0
  94. hypermind/schemas/namespace_founding_attest.cddl +30 -0
  95. hypermind/schemas/namespace_invite.cddl +22 -0
  96. hypermind/schemas/wire-v0.1.cddl +73 -0
  97. hypermind/simlab/__init__.py +15 -0
  98. hypermind/simlab/_persona_registry.py +93 -0
  99. hypermind/simlab/_scenario_impl.py +2778 -0
  100. hypermind/simlab/app.py +2538 -0
  101. hypermind/simlab/backends/__init__.py +27 -0
  102. hypermind/simlab/backends/anchor.py +88 -0
  103. hypermind/simlab/backends/local.py +32 -0
  104. hypermind/simlab/backends/server.py +79 -0
  105. hypermind/simlab/cli_command.py +108 -0
  106. hypermind/simlab/config.py +106 -0
  107. hypermind/simlab/deployment.py +26 -0
  108. hypermind/simlab/knowledge.py +716 -0
  109. hypermind/simlab/learning.py +295 -0
  110. hypermind/simlab/modes/__init__.py +115 -0
  111. hypermind/simlab/modes/_eval_real_llm.py +373 -0
  112. hypermind/simlab/modes/aar.py +611 -0
  113. hypermind/simlab/modes/backtest.py +610 -0
  114. hypermind/simlab/modes/binary_forecast.py +69 -0
  115. hypermind/simlab/modes/conformance.py +1869 -0
  116. hypermind/simlab/modes/evaluation.py +2271 -0
  117. hypermind/simlab/modes/governance.py +648 -0
  118. hypermind/simlab/modes/redteam.py +534 -0
  119. hypermind/simlab/modes/tabletop.py +797 -0
  120. hypermind/simlab/modes/tournament.py +448 -0
  121. hypermind/simlab/modes/whatif.py +523 -0
  122. hypermind/simlab/namespace.py +125 -0
  123. hypermind/simlab/personas.py +477 -0
  124. hypermind/simlab/prompt_generator.py +172 -0
  125. hypermind/simlab/question_sets/geopolitics_q20.json +122 -0
  126. hypermind/simlab/question_sets/governance_q5.json +67 -0
  127. hypermind/simlab/question_sets/msft_outlook_q10.json +62 -0
  128. hypermind/simlab/question_sets/whatif_q3.json +38 -0
  129. hypermind/simlab/registry.py +325 -0
  130. hypermind/simlab/runner.py +239 -0
  131. hypermind/simlab/scenario.py +147 -0
  132. hypermind/simlab/swarms.py +180 -0
  133. hypermind/simlab/tool_handlers/__init__.py +4 -0
  134. hypermind/simlab/tool_handlers/alpha_vantage.py +39 -0
  135. hypermind/simlab/tool_handlers/brave.py +46 -0
  136. hypermind/simlab/tool_handlers/newsapi.py +50 -0
  137. hypermind/simlab/tool_handlers/openweather.py +46 -0
  138. hypermind/simlab/tool_handlers/pinecone.py +52 -0
  139. hypermind/simlab/tool_handlers/qdrant.py +57 -0
  140. hypermind/simlab/tool_handlers/query_knowledge_base.py +21 -0
  141. hypermind/simlab/tool_handlers/relata_recall.py +61 -0
  142. hypermind/simlab/tool_handlers/retrieve_document.py +21 -0
  143. hypermind/simlab/tool_handlers/serper.py +46 -0
  144. hypermind/simlab/tool_handlers/tavily.py +53 -0
  145. hypermind/simlab/tool_handlers/weaviate.py +65 -0
  146. hypermind/simlab/tool_handlers/wikipedia.py +64 -0
  147. hypermind/simlab/tool_handlers/wolfram.py +48 -0
  148. hypermind/simlab/tool_handlers/yahoo_finance.py +49 -0
  149. hypermind/simlab/tool_registry.py +568 -0
  150. hypermind/simlab/topic_adapter.py +338 -0
  151. hypermind/simlab/topic_questions.py +259 -0
  152. hypermind/storage/__init__.py +69 -0
  153. hypermind/storage/backend.py +71 -0
  154. hypermind/storage/relata.py +245 -0
  155. hypermind/storage/sqlite.py +258 -0
  156. hypermind/sync.py +191 -0
  157. hypermind/tal.py +175 -0
  158. hypermind/tasks.py +334 -0
  159. hypermind/testing.py +16 -0
  160. hypermind/tools/__init__.py +32 -0
  161. hypermind/tools/registry.py +61 -0
  162. hypermind/transport/__init__.py +22 -0
  163. hypermind/transport/anti_entropy.py +708 -0
  164. hypermind/transport/bus.py +206 -0
  165. hypermind/transport/knows_delta.py +204 -0
  166. hypermind/transport/libp2p.py +298 -0
  167. hypermind/transport/placement.py +58 -0
  168. hypermind/transport/tcp.py +797 -0
  169. hypermind/transport/tls_profile.py +417 -0
  170. hypermind/types.py +59 -0
  171. hypermind/uncertainty.py +222 -0
  172. hypermind/wire.py +897 -0
  173. hypermind/workflow/__init__.py +72 -0
  174. hypermind/workflow/engine.py +655 -0
  175. hypermind/workflow/plan.py +182 -0
  176. hypermind/workflow/repair.py +203 -0
  177. hypermind-0.11.0.dist-info/METADATA +524 -0
  178. hypermind-0.11.0.dist-info/RECORD +181 -0
  179. hypermind-0.11.0.dist-info/WHEEL +4 -0
  180. hypermind-0.11.0.dist-info/entry_points.txt +2 -0
  181. hypermind-0.11.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,524 @@
1
+ Metadata-Version: 2.4
2
+ Name: hypermind
3
+ Version: 0.11.0
4
+ Summary: Federated agent intelligence — reference SDK for the HyperMind SCITT contested-claims profile
5
+ Project-URL: Homepage, https://github.com/ZySec-AI/hypermind
6
+ Project-URL: Documentation, https://github.com/ZySec-AI/hypermind/tree/main/docs
7
+ Project-URL: Issues, https://github.com/ZySec-AI/hypermind/issues
8
+ Project-URL: Specification, https://github.com/ZySec-AI/hypermind/tree/main/docs/spec
9
+ Author: HyperMind contributors
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: agents,cose,dispute,federated,intelligence,p2p,scitt
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Security :: Cryptography
21
+ Classifier: Topic :: System :: Distributed Computing
22
+ Requires-Python: <3.14,>=3.11
23
+ Requires-Dist: anyio>=4.3
24
+ Requires-Dist: blake3>=0.4
25
+ Requires-Dist: cbor2>=6.0.1
26
+ Requires-Dist: click>=8.1
27
+ Requires-Dist: cryptography>=44.0.1
28
+ Requires-Dist: pydantic>=2.6
29
+ Requires-Dist: pymerkle>=6.1
30
+ Requires-Dist: pynacl>=1.6.2
31
+ Requires-Dist: quantcrypt>=1.0
32
+ Requires-Dist: rich>=13.7
33
+ Requires-Dist: structlog>=24.1
34
+ Provides-Extra: anthropic
35
+ Requires-Dist: anthropic>=0.40; extra == 'anthropic'
36
+ Provides-Extra: api
37
+ Requires-Dist: uvicorn>=0.30; extra == 'api'
38
+ Provides-Extra: crypto-pq-test
39
+ Requires-Dist: oqs>=0.10; (platform_system != 'Windows') and extra == 'crypto-pq-test'
40
+ Requires-Dist: quantcrypt>=1.0; extra == 'crypto-pq-test'
41
+ Provides-Extra: dev
42
+ Requires-Dist: cyclonedx-bom>=7.0; extra == 'dev'
43
+ Requires-Dist: mkdocs-material>=9.0; extra == 'dev'
44
+ Requires-Dist: mkdocs>=1.5; extra == 'dev'
45
+ Requires-Dist: mkdocstrings[python]>=0.24; extra == 'dev'
46
+ Requires-Dist: mypy>=1.10; extra == 'dev'
47
+ Requires-Dist: pip-audit>=2.7; extra == 'dev'
48
+ Requires-Dist: pip-tools>=7.4; extra == 'dev'
49
+ Requires-Dist: ruff>=0.4; extra == 'dev'
50
+ Provides-Extra: fuzz
51
+ Requires-Dist: atheris>=2.3; extra == 'fuzz'
52
+ Provides-Extra: kms-all
53
+ Requires-Dist: azure-identity>=1.16; extra == 'kms-all'
54
+ Requires-Dist: azure-keyvault-keys>=4.8; extra == 'kms-all'
55
+ Requires-Dist: boto3>=1.34; extra == 'kms-all'
56
+ Requires-Dist: google-cloud-kms>=2.20; extra == 'kms-all'
57
+ Requires-Dist: hvac>=2.0; extra == 'kms-all'
58
+ Provides-Extra: kms-aws
59
+ Requires-Dist: boto3>=1.34; extra == 'kms-aws'
60
+ Provides-Extra: kms-azure
61
+ Requires-Dist: azure-identity>=1.16; extra == 'kms-azure'
62
+ Requires-Dist: azure-keyvault-keys>=4.8; extra == 'kms-azure'
63
+ Provides-Extra: kms-gcp
64
+ Requires-Dist: google-cloud-kms>=2.20; extra == 'kms-gcp'
65
+ Provides-Extra: kms-vault
66
+ Requires-Dist: hvac>=2.0; extra == 'kms-vault'
67
+ Provides-Extra: libp2p
68
+ Requires-Dist: hypermind-libp2p>=0.10.1; extra == 'libp2p'
69
+ Provides-Extra: mcp
70
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
71
+ Provides-Extra: migrate
72
+ Requires-Dist: libcst>=1.1; extra == 'migrate'
73
+ Provides-Extra: openai
74
+ Requires-Dist: openai<2,>=1.50; extra == 'openai'
75
+ Provides-Extra: otel
76
+ Requires-Dist: opentelemetry-api>=1.22; extra == 'otel'
77
+ Requires-Dist: opentelemetry-sdk>=1.22; extra == 'otel'
78
+ Requires-Dist: prometheus-client>=0.20; extra == 'otel'
79
+ Provides-Extra: relata
80
+ Requires-Dist: relata-sdk>=0.2; extra == 'relata'
81
+ Provides-Extra: test
82
+ Requires-Dist: httpx>=0.27; extra == 'test'
83
+ Requires-Dist: hypothesis>=6.100; extra == 'test'
84
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
85
+ Requires-Dist: pytest-cov>=4.1; extra == 'test'
86
+ Requires-Dist: pytest>=7.4; extra == 'test'
87
+ Description-Content-Type: text/markdown
88
+
89
+ <div align="center">
90
+
91
+ # `HyperMind`
92
+
93
+ ### **The protocol for swarm intelligence between AI agents.**
94
+
95
+ Agents share what they learn. Dispute what they doubt. Build trust over time.
96
+ **Across companies. Without a central server. With cryptographic proof.**
97
+
98
+ *Think Git for agent knowledge — federated, signed, evolving.*
99
+
100
+ <img src="docs/assets/hero-swarm.svg" alt="HyperMind swarm — agents in three labs sharing signed claims, filing bonded disputes, and producing a sealed consult receipt" width="100%"/>
101
+
102
+ [![PyPI](https://img.shields.io/pypi/v/hypermind?color=4c8cff&label=pip%20install%20hypermind)](https://pypi.org/project/hypermind/)
103
+ [![Python](https://img.shields.io/pypi/pyversions/hypermind?color=4c8cff)](https://pypi.org/project/hypermind/)
104
+ [![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE)
105
+ [![Tests](https://img.shields.io/badge/tests-1753%20passing-brightgreen)](#testing--quality)
106
+ [![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen)](#testing--quality)
107
+ [![Status](https://img.shields.io/badge/status-v0.10-blue)](#project-status)
108
+
109
+ **[Run the demo](#run-the-demo-one-command)** ·
110
+ **[60-second SDK tour](#60-second-demo)** ·
111
+ **[What it is](#what-it-is-30-seconds)** ·
112
+ **[Cascaded security](#cascaded-security--five-layers-failure-isolated)** ·
113
+ **[Use cases](#two-use-cases-that-make-it-click)** ·
114
+ **[Spec](docs/spec/)** ·
115
+ **[Examples](examples/)** ·
116
+ **[Discussions](https://github.com/ZySec-AI/hypermind/discussions)**
117
+
118
+ </div>
119
+
120
+ ---
121
+
122
+ ## Run the demo (one command)
123
+
124
+ The fastest way to see HyperMind is the **SimLab web UI**. It rebuilds the Vue bundle and starts the local server in one go:
125
+
126
+ ```bash
127
+ git clone https://github.com/ZySec-AI/hypermind && cd hypermind
128
+ make bootstrap # one-time: creates .venv and installs editable
129
+ make run # builds the webui + starts SimLab on http://127.0.0.1:8765
130
+ ```
131
+
132
+ Open **http://127.0.0.1:8765** and you'll see:
133
+
134
+ | Route | What it shows |
135
+ |---|---|
136
+ | `/` | Home — quick orientation |
137
+ | `/how-it-works` | Animated walkthrough of the protocol layers |
138
+ | `/evidence` | IEEE-grade evaluation: HyperMind vs. baselines |
139
+ | `/security` | **NEW.** 5-layer cascaded security stack + failure-isolation matrix |
140
+ | `/usecases` | 6 industries × ~22 use cases each, filterable, expandable |
141
+ | `/sims` | Past simulations (run new ones from `/new`) |
142
+ | `/agents` · `/tools` · `/knowledge` · `/reports` | The SDK in action |
143
+ | `/docs` · `/paper` | Full spec (28 sections) + IEEE paper draft + patent disclosure |
144
+
145
+ **Other make targets:**
146
+
147
+ ```bash
148
+ make run-fast # skip the webui rebuild (when JS hasn't changed)
149
+ make webui-dev # Vite dev server with hot-reload on :5173
150
+ make test # 1753 tests pass, ~80s
151
+ make demo # examples/01_hello_world from the CLI
152
+ make demos # all numbered tutorials + scenarios sequentially
153
+ make help # show all targets
154
+ ```
155
+
156
+ ---
157
+
158
+ ## What it is (30 seconds)
159
+
160
+ **HyperMind is an open protocol** — `draft-hypermind-scitt-contested-claims-profile-00`, an IETF SCITT profile that adds dispute primitives and reputation-gated registration — **plus a reference Python SDK**.
161
+
162
+ It gives AI agents from different organizations five things they don't have today:
163
+
164
+ | Verb | What it does | Biology analogue |
165
+ |---|---|---|
166
+ | 📡 **Share** | Publish a signed, citeable finding any other agent can build on | Lab notebooks + peer review |
167
+ | ⚖️ **Dispute** | Disagree with a bonded, structured counter-statement (FSM, not Slack) | The immune system |
168
+ | 🧠 **Consult** | Query a panel of peers — sealed receipt, weighted by reputation | Swarm decision-making |
169
+ | 🧬 **Evolve** | Per-topic reputation rewards being right, decays being wrong | Selection pressure on ideas |
170
+ | 📚 **Remember** | Sealed claims verifiable in 2045, even if the lab is gone | Inheritance across generations |
171
+
172
+ Built on **RFC 6962** (Merkle transparency), **RFC 9591** (FROST threshold sigs), **IETF SCITT**, **COSE**, **NIST FIPS 204** (ML-DSA-65 hybrid PQ).
173
+
174
+ > **Not a chat protocol. Not a chain. Not another framework.**
175
+ > It's the **substrate** underneath agent collaboration — the layer where `share`, `cite`, `dispute`, and `evolve` become primitives instead of tickets in someone's backlog.
176
+
177
+ ---
178
+
179
+ ## Why this matters (in three lines)
180
+
181
+ > 🌍 **By 2027, ~1B AI agents will run inside companies.** Today, none of them can talk to one across the firewall.
182
+ > 🧠 **Frontier models are already brilliant in isolation.** The bottleneck isn't intelligence — it's *integration*.
183
+ > 🔒 **Without a trust substrate, every "multi-agent" system reinvents (badly): identity, citation, dispute, reputation, audit.** `hypermind` is that substrate — once, properly, open-source.
184
+
185
+ **The value, in one sentence:** *turn isolated AI agents into a swarm that learns, evolves, and remembers — across companies, with cryptographic proof that any auditor (or court, or regulator, or competitor) can verify in 2045.*
186
+
187
+ ---
188
+
189
+ ## Why it matters
190
+
191
+ Today's AI agents are **isolated minds**. An agent at Lab A finds something — the agent at Lab B will never know. Different stores, different keys, no shared trust model. Every multi-agent system in production today reinvents (badly): identity, citation, disagreement, reputation, audit.
192
+
193
+ **Every adaptive system that ever got smarter at scale is a network of agents that share what they learn and dispute what they doubt.** Ant colonies do it with pheromones. Neurons with synapses. Scientists with citations and peer review. Cities with markets. We just haven't built it yet for our agents.
194
+
195
+ `hypermind` is that missing layer. **Not validation. Not citation. Connected, evolving intelligence** — with the cryptographic chain of custody that makes the swarm trustworthy instead of just noisy.
196
+
197
+ <details>
198
+ <summary><b>Imagine this →</b> the swarm in motion (click to expand)</summary>
199
+
200
+ > An agent at Lab A wakes up. It runs an evaluation, finds something interesting, and signs its result.
201
+ >
202
+ > An agent at Lab B sees that result. It doesn't blindly trust it — Lab B's agent has watched Lab A for six months and knows where its strengths and blind spots are. It re-runs the test independently. It mostly agrees, but on one edge case it disagrees, **politely** — it files a counter-statement explaining why, putting some of its reputation on the line.
203
+ >
204
+ > An agent at Lab C, watching both of them, asks the swarm: *"so which is right?"* A panel of five other agents — picked because their views diverge most — weighs in. Their answers are aggregated, weighted by past accuracy. A signed receipt records the outcome.
205
+ >
206
+ > A week later, ground truth arrives. The agents who were right gain standing. The ones who were wrong lose some — *only in this topic, not everywhere*. Nobody is "punished," but **the swarm has learned**. Tomorrow's questions get sharper answers because today's agents got slightly smarter, together.
207
+ >
208
+ > No central server told them to do any of this. No company owns the data. Each agent kept its own keys, its own data, its own boundaries. But the *collective* — that grew.
209
+
210
+ This is how humans work. We talk, we cite, we disagree, we build reputations, we update. Whole civilizations are built on this layer. Our AI agents have none of it. That's the gap `hypermind` exists to close.
211
+
212
+ </details>
213
+
214
+ ---
215
+
216
+ ## SimLab modes (the demo)
217
+
218
+ `hmctl simlab` ships 8 deliberation modes that exercise different protocol primitives:
219
+
220
+ | Mode | One-liner |
221
+ |---|---|
222
+ | **Governance Committee** | FROST 3-of-5 signed verdict on a model card; signed dissents preserved as receipts |
223
+ | **What-If Scenario Tree** | Branching counterfactuals with InformationGainPlanner suggestions |
224
+ | **Red-Team Stress Test** | Bonded dispute FSM swimlanes; surfaces structural weaknesses in any claim |
225
+ | **Post-Incident AAR** | HLC time-slider — drag back to see what the swarm believed at any moment |
226
+ | **Decision Tournament** | Pairwise bracket with Condorcet winner + sensitivity pivots |
227
+ | **Crisis Tabletop** | Auto-composes a swarm by scenario family; produces a recommended playbook |
228
+ | **Backtest Harness** | Predicted vs. actual scoring with per-role drop-one attribution |
229
+ | Binary Forecast | The original calibration-research shape |
230
+
231
+ Full reference: [`docs/simlab/modes.md`](docs/simlab/modes.md).
232
+
233
+ ---
234
+
235
+ ## 60-second demo
236
+
237
+ ```bash
238
+ pip install hypermind # 1️⃣ install
239
+ python -m examples.01_hello_world # 2️⃣ one signed claim
240
+ python -m examples.03_consult_panel # 3️⃣ query a panel of peers
241
+ python -m examples.scenario_threat_intel # 4️⃣ 4-org collective-intelligence pilot
242
+ python -m examples.scenario_geopolitical_crisis --agents 100 # 5️⃣ 100-agent crisis sim
243
+ python -m examples.serve_api --persist demo.db # 6️⃣ HTTP API + durable storage
244
+ ```
245
+
246
+ …or paste this into a Python REPL — five agents form a swarm and answer collectively:
247
+
248
+ ```python
249
+ import asyncio
250
+ from hypermind import Uncertainty, testbed_cohort
251
+
252
+ async def demo():
253
+ # Five agents join one room — the swarm comes alive.
254
+ async with testbed_cohort(5, room="ai-safety") as agents:
255
+ alice, bob, carol, dave, eve = agents
256
+
257
+ # Three agents independently learn, each publishing a signed finding.
258
+ # (Like three lab notebooks contributing to a literature.)
259
+ for who in (alice, dave, eve):
260
+ await who.publish_claim(
261
+ {"finding": f"{who.keypair.did_key[:18]}'s observation"},
262
+ claim_type="eval_result",
263
+ uncertainty=Uncertainty.beta(8, 2), # mean ≈ 0.8 confidence
264
+ )
265
+
266
+ # Carol summons the swarm: "what do you collectively believe?"
267
+ # `route_strategy="disagreement"` picks the panel whose posteriors
268
+ # diverge most — maximises information gain (BALD-style).
269
+ result = await carol.consult(
270
+ "Is HCAST-42 a real model failure?",
271
+ panel_size=3,
272
+ route_strategy="disagreement",
273
+ )
274
+
275
+ print(f"swarm posterior = {result.posterior!r}")
276
+ print(f"panel disagreement = {result.disagreement:.3f}")
277
+ print(f"selection-bias check = {result.calibration_truth_axis.warning}")
278
+ print(f"sealed receipt kid = {result.receipt_kid.hex()[:24]}…")
279
+
280
+ asyncio.run(demo())
281
+ ```
282
+
283
+ That's a swarm at work: three independent observations, **aggregated with reputation weights**, **panel-routed for maximum information gain**, **sealed as a verifiable signed receipt**. No shared database. No central server. No accounts.
284
+
285
+ ---
286
+
287
+ ## Two use cases that make it click
288
+
289
+ ### 🛡️ Use case 1 — Cross-bank threat intel that doesn't leak
290
+ **Problem.** Bank A's SOC agent spots a new phishing kit at 03:14 UTC. Bank B sees it 40 minutes later — too late. Sharing IOCs by email is slow and unverifiable; a shared SaaS means everyone's threat data sits in one vendor.
291
+
292
+ **With `hypermind`.** Bank A's agent publishes a signed claim: *"domain `xyz.click` is C2 for kit-9921, confidence 0.87."* Bank B's agent receives it in seconds, verifies the signature offline, and re-runs detection. Bank C's agent disagrees — the same domain is benign in their region — and files a bonded counter-statement. A panel of 5 ISAC peers consults; the sealed receipt records the outcome. Two weeks later, ground truth lands. Bank A's reputation in *threat-intel-phishing* goes up; Bank C's stays neutral (they were geographically right). **No vendor in the middle. Audit trail valid in 2045.**
293
+
294
+ ### 🧪 Use case 2 — AI-safety eval consortium (METR / Apollo / AISI shape)
295
+ **Problem.** Three labs run the same dangerous-capability eval. They get different numbers. There's no protocol to cite each other, dispute findings, or aggregate confidence. PDFs and Slack threads are the state of the art.
296
+
297
+ **With `hypermind`.** Lab A publishes `eval_result(HCAST-42, pass_rate=0.31)` — signed, citeable. Lab B re-runs, gets 0.28, publishes a `synthesize` claim that cites Lab A as parent. Lab C disagrees on one prompt and files a structured dispute (FSM, with bond). An oracle resolution two weeks later updates per-topic reputation: labs that were calibrated gain standing in *frontier-eval* only. **A regulator a year later replays the entire reasoning chain, end-to-end, with cryptographic proof of who said what when.**
298
+
299
+ > Both stories use the same five primitives: `share`, `dispute`, `consult`, `evolve`, `remember`. That's the whole point — one substrate, every cross-org agent workflow.
300
+
301
+ ---
302
+
303
+ ## How the swarm stays trustworthy
304
+
305
+ A swarm without trust is just noise. `hypermind` ships the safety primitives that turn collective intelligence into **evidence**:
306
+
307
+ - 🔏 **Signed claims (COSE)** — every finding verifiable offline, today or in 2045. *Without this: an attacker forges findings.*
308
+ - ⚖️ **Disputes as data** — `OPEN → ARGUE → COUNTER → CLOSED | FRIVOLOUS` with topic-scoped bonds. **Disagreement is the immune system.**
309
+ - 🎯 **Reputation per topic** — bounded vouching defeats ring-laundering. *Without this: a few bad actors poison the swarm.*
310
+ - 🛡️ **Capability tokens** — Biscuit-shape caveat chains. Agents delegate authority but never widen it.
311
+ - 🔮 **Hybrid post-quantum** — Ed25519 today + ML-DSA-65 hybrid for 2045 verifiability.
312
+ - 🧮 **Threshold signatures** — RFC 9591 FROST k-of-n. 5-of-7 councils sign without a single point of failure.
313
+ - 📜 **Transparency log** — RFC 6962 Merkle with witness cosigning over `(root, tree_size)`.
314
+
315
+ Each is an industry-standard primitive. Together they're the **immune system, governance, and memory** the swarm needs to stay alive across organizations and decades.
316
+
317
+ ---
318
+
319
+ ## Cascaded security — five layers, failure-isolated
320
+
321
+ v0.9.x ships **first-class private/organization-owned namespaces** backed by a five-layer security stack. The **failure-isolation invariant** means compromise of any single layer leaves the invariants of the other four intact:
322
+
323
+ | Layer | What it does | Inherits | Falls ⇒ what still holds |
324
+ |---|---|---|---|
325
+ | **L1 — Signature & domain binding** | A-ALG-BOUND COSE_Sign1; canonical-CBOR re-encode before verify | RFC 9052, RFC 8949 | L2/L3/L4/L5 unchanged |
326
+ | **L2 — Transport (mTLS)** | TLS 1.3 mutual auth with raw public keys; kid via SAN OID; ALPN `hm/2` | RFC 8446, RFC 7250 | L3 envelope still encrypted to non-MITM recipients |
327
+ | **L3 — Envelope encryption** | HPKE + COSE_Encrypt0 + per-Room HKDF epoch keys; **separability invariant** | RFC 9180, RFC 9052 §5.2 | L1 metadata still verifies *without decryption* |
328
+ | **L4 — Namespace identity** | FROST k-of-n founding cohort, `did:web` rendezvous, transparency-anchored | RFC 9591, DID Core | L5 ns: caveat still rejects cross-namespace token reuse |
329
+ | **L5 — Capability + ACL** | Biscuit-shape attenuation with `ns:` / `room:` / `to:` caveats; deny-precedence ACL | Biscuit semantics | L4 namespace_id binding still enforced at the wire |
330
+
331
+ **Public capture-cost lower bound.** A previously-stealth attack ("$3,000 anchor-tenant capture") becomes a publicly-observable event: capture now requires producing a `NAMESPACE_FOUNDING_ATTEST` with member roster + COI disclosure that lands in the transparency log and a `did:web` record receivers can compare.
332
+
333
+ See `/security` in the SimLab UI for the visual stack, or read [docs/spec/21-private-namespaces.md](docs/spec/21-private-namespaces.md).
334
+
335
+ ---
336
+
337
+ ## Who this is for
338
+
339
+ - **Multi-agent research labs.** Dozens of agents discover in parallel — let them cite, dispute, and synthesise across teams without a shared store. → [`scenario_information_pipeline.py`](examples/scenario_information_pipeline.py)
340
+ - **AI-safety eval consortia** (METR, Apollo, AISI). Cross-org findings cited cryptographically; false positives disputed by signed counter-statements. → [`scenario_threat_intel.py`](examples/scenario_threat_intel.py)
341
+ - **Financial-sector ISACs.** Threat intel with topic-scoped reputation — disputes update standing in *threat intel only*, not everywhere.
342
+ - **Biosecurity / dual-use disclosure.** Reputation-gated reviewer cohorts with slashable bonds on frivolous reports. → [`scenario_namespace_trust.py`](examples/scenario_namespace_trust.py)
343
+ - **Curious Python developers.** Async-first, dataclass-typed, fully type-hinted. Run the [60-second demo](#60-second-demo).
344
+
345
+ If your problem doesn't involve cross-organizational agents, you don't need `hypermind` — use Postgres + Sigstore. **If it does, this is the substrate.**
346
+
347
+ ---
348
+
349
+ ## Built at ZySec AI
350
+
351
+ [ZySec AI](https://zysec.ai) is a research lab at the intersection of **AI safety, applied cryptography, and connected intelligence**. `hypermind` is the protocol layer of that agenda. The thesis:
352
+
353
+ - **Single-agent capability is not the bottleneck.** Frontier models are already extraordinary in isolation. The bottleneck is *integration* — how a swarm of agents from different labs, companies, and jurisdictions can learn collectively without surrendering accountability.
354
+ - **Connected intelligence has been studied for decades** — social epistemology (Goldman, Longino), collective intelligence (Malone, Woolley), mechanism design (Prelec, Shnayder, Frongillo, Parkes), distributed systems (Tendermint, Sigstore, SCITT). What was missing was a working *substrate*.
355
+ - **Open by default.** Spec, SDK, security reviews, formal-method sketches, failure-mode analysis — all Apache-2.0. The substrate of connected agent intelligence has to be a public good; otherwise the only "swarm" any lab can build is the one inside its own walls.
356
+
357
+ > *"The swarm gets smarter the moment one agent's mistake can be corrected by another."* — internal ZySec note, January 2026
358
+
359
+ Open research questions — peer-prediction theory, calibration under adversarial pressure, dispute-FSM completeness, post-quantum agent identity — live in [Discussions](https://github.com/ZySec-AI/hypermind/discussions).
360
+
361
+ ---
362
+
363
+ ## Architecture in 30 seconds
364
+
365
+ ```
366
+ Your code
367
+
368
+
369
+ HyperMindAgent ──── publish_claim · consult · synthesize · dispute
370
+ │ · task · place_on · mcp_call
371
+ ┌──────┼──────┬──────────┐
372
+ ▼ ▼ ▼ ▼
373
+ wire/ knowledge/ transport/ mcp/
374
+ COSE reputation • InProcessBus • JSON-RPC 2.0 stdio/WebSocket
375
+ CBOR transparency • TCPGossipBus • MCP_PROVENANCE header binding
376
+ A-ALG- • libp2p (v0.2) • TaskGateway + idempotent retry
377
+ BOUND • placement tasks/
378
+ • backpressure • distributed task coordination
379
+
380
+
381
+ crypto/
382
+ Ed25519 · ML-DSA-65 hybrid · FROST · BLAKE3 · HLC
383
+ ```
384
+
385
+ Drilldown: [docs/concepts.md](docs/concepts.md) ·
386
+ Spec: [docs/spec/](docs/spec/) ·
387
+ Standards inheritance: [docs/_meta/standards-map.md](docs/_meta/standards-map.md)
388
+
389
+ ---
390
+
391
+ ## Getting started
392
+
393
+ ### 5-minute path
394
+ 1. **Install:** `pip install hypermind` (Python 3.11–3.13)
395
+ 2. **Run hello-world:** `python -m examples.01_hello_world`
396
+ 3. **Read the [getting-started guide](docs/getting-started.md)**
397
+
398
+ ### 30-minute path — the four numbered tutorials, in order
399
+
400
+ | # | What you'll do | Time |
401
+ |---|---|---|
402
+ | [`01_hello_world.py`](examples/01_hello_world.py) | One agent, one signed claim | 2 min |
403
+ | [`02_two_agents_dispute.py`](examples/02_two_agents_dispute.py) | Add a second agent, file a bonded dispute | 5 min |
404
+ | [`03_consult_panel.py`](examples/03_consult_panel.py) | Query a panel — collective intelligence in action | 5 min |
405
+ | [`04_oracle_resolve.py`](examples/04_oracle_resolve.py) | Close the loop with ground truth — the swarm gets smarter | 5 min |
406
+
407
+ Then graduate to the [pilot scenarios](examples/) — full multi-agent, multi-topic flows that mirror real adoption stories.
408
+
409
+ ### The flagship simulation — 100 agents, one crisis
410
+
411
+ ```bash
412
+ python -m examples.scenario_geopolitical_crisis --agents 100 --verbose
413
+ ```
414
+
415
+ 100 analyst agents (intel agencies, think-tanks, financial firms, NGOs, contrarians, oracles) deployed into a geopolitical crisis. They publish observations, dispute disinformation, run panel consults, and resolve with oracle ground truth — all in under a second, all cryptographically signed. Pass `--audit audit.jsonl` to capture the full tamper-evident log.
416
+
417
+ ```bash
418
+ # Ask custom questions by editing PANEL_QUESTIONS in the scenario file
419
+ # Scale down for development:
420
+ python -m examples.scenario_geopolitical_crisis --agents 20
421
+ # Full run with JSON output piped for downstream processing:
422
+ python -m examples.scenario_geopolitical_crisis --agents 100 | jq .panel_results
423
+ ```
424
+
425
+ See **[docs/simulations.md](docs/simulations.md)** for how to build your own domain simulation.
426
+
427
+ ### When you're stuck
428
+ - `hmctl doctor` — smoke-tests the install + dependencies
429
+ - `hmctl why-blocked <action>` — every refusal carries `rule_id` + `spec_ref`
430
+ - [Discussions](https://github.com/ZySec-AI/hypermind/discussions) — most onboarding questions are already there
431
+
432
+ ---
433
+
434
+ ## Documentation
435
+
436
+ | You want to… | Go here |
437
+ |---|---|
438
+ | Install and run your first signed claim | **[docs/getting-started.md](docs/getting-started.md)** |
439
+ | Run a 100-agent domain simulation | **[docs/simulations.md](docs/simulations.md)** |
440
+ | Add durable storage, HTTP API, or LLM responders | **[docs/architecture-v0.6.md](docs/architecture-v0.6.md)** |
441
+ | Understand the core concepts | [docs/concepts.md](docs/concepts.md) |
442
+ | Browse runnable examples | [examples/README.md](examples/README.md) |
443
+ | Read the protocol spec (28 normative sections) | [docs/spec/](docs/spec/) |
444
+ | Understand agent-to-agent networking & MCP transport | [docs/spec/01-transport.md](docs/spec/01-transport.md) + [src/hypermind/mcp/](src/hypermind/mcp/) |
445
+ | See the 5-layer cascaded security stack | [docs/spec/21-private-namespaces.md](docs/spec/21-private-namespaces.md) + `/security` in SimLab |
446
+ | Read the IEEE paper draft + patent disclosure | [docs/paper/](docs/paper/) or `/paper` in SimLab |
447
+ | Decide if HyperMind fits your problem | [docs/decide/](docs/decide/) |
448
+ | Operate a deployment | [docs/operate/](docs/operate/) |
449
+ | See the roadmap | [ROADMAP.md](ROADMAP.md) |
450
+ | Contribute | [CONTRIBUTING.md](CONTRIBUTING.md) |
451
+ | Report a security issue | [SECURITY.md](SECURITY.md) |
452
+
453
+ ---
454
+
455
+ ## Project status
456
+
457
+ **v0.10 — coordination engine shipped.** v0.5–v0.10 are all 🟢 code-complete (federation, versioning, trust bundle, crypto hardening, production profile, conformance scaffolding, full mind / swarm-intelligence layer, and coordination engine).
458
+
459
+ ✅ **What works today**
460
+ - Spec — **28 normative sections** (§01–§28) covering protocol, transport mTLS, envelope encryption, namespace identity, capability extensions, workflow (§26), contract-net (§27), and distributed tracing (§28)
461
+ - Reference Python SDK — async-first, fully type-hinted, **1753 tests passing, ≥95% coverage**
462
+ - 20 numbered tutorials (06/07 are v0.7 placeholders) + 20+ scenarios (incl. `scenario_private_namespace`, `scenario_regulated_consortium`)
463
+ - CLI (`hmctl`), hybrid post-quantum signing, FROST k-of-n threshold (RFC 9591)
464
+ - Three cycles of [self-heal security review](tests/test_self_heal_cycle1.py) — including the v0.9.x **5-layer failure-isolation regression** ([test_self_heal_cycle3_cascade_isolate.py](tests/test_self_heal_cycle3_cascade_isolate.py))
465
+ - **Two-impl interop** — independent [`reference_verifier/`](reference_verifier/) re-implements every primitive from spec text, byte-equal CDDL hashes
466
+ - **L2 mTLS profile**, **L3 HPKE envelope encryption**, **L4 namespace lifecycle** (FROST-rooted CREATE / FOUNDING_ATTEST / INVITE / ACCEPT), **L5 ns:/room:/to: caveats + ACL**
467
+ - **MCP transport** (`src/hypermind/mcp/`) — agent-to-agent tool calls via JSON-RPC 2.0 over stdio/WebSocket with `MCP_PROVENANCE` protected-header binding (calling_agent_kid + cap_token_root + request_kid)
468
+ - **TaskGateway** with InProcessGateway + MCPGateway, cancel/timeout, and idempotent retry; distributed task coordination via `src/hypermind/tasks.py`
469
+ - **ConsistentHash placement** (`agent.place_on()` topology hint) and credit-based flow control (TokenBucket backpressure in `transport/bus.py`)
470
+ - **libp2p scaffold** (`transport-rust/` Cargo crate, `hypermind[libp2p]` extra, raise-on-use until v0.2 backend lands)
471
+ - **Workflow primitives** (§26), **contract-net protocol** (§27), **distributed cognitive layer** (§28)
472
+ - **SimLab web UI** at `make run` — Security, Use Cases (125 cases), Namespaces, Docs/Paper/Patent
473
+
474
+ 🛣️ **Roadmap to v1.0 GA** (full plan in [ROADMAP.md](ROADMAP.md)) — engineering is largely done; remaining gates are external:
475
+ IETF I-D submission · IANA early allocation · OpenSSF Sandbox/Incubating · third-party security audit · full Tamarin/ProVerif proofs · ≥2 non-ZySec maintainers · ≥3 pilot MOUs · 7-day chaos-test green run · 30-day side-channel CT.
476
+
477
+ ---
478
+
479
+ ## Testing & quality
480
+
481
+ ```bash
482
+ make test # 1753 passing, ~80s
483
+ make cov # ≥95% coverage gate
484
+ .venv/bin/python -m pytest tests/test_two_impl_interop.py # SDK ↔ verifier interop
485
+ .venv/bin/python -m pytest tests/test_self_heal_cycle1.py \
486
+ tests/test_self_heal_cycle2.py \
487
+ tests/test_self_heal_cycle3_cascade_isolate.py # security regressions
488
+ .venv/bin/python -m pytest tests/test_priv_ns_conformance_coverage.py # C-PRIV-NS-01..18
489
+ ```
490
+
491
+ Covers: real Ed25519 + ML-DSA-65 hybrid signing (with splice-attack rejection), full FROST k-of-n with deterministic nonces, A-ALG-BOUND wire-substitution defences, dispute FSM with partition-heal terminal, capability chain-of-trust with `ns:` namespace caveats, RFC 6962 inclusion proofs, RFC 9180 HPKE round-trip, COSE_Encrypt0 separability invariant, TLS 1.3 mTLS profile (cipher floor, ALPN downgrade-detect, RPK kid binding), and the **5-layer failure-isolation regression** that proves any single layer can be compromised without breaching the other four.
492
+
493
+ ---
494
+
495
+ ## Contributing
496
+
497
+ We welcome issues, design discussions, and PRs. See **[CONTRIBUTING.md](CONTRIBUTING.md)** for dev setup, commit conventions, and the PR checklist.
498
+
499
+ - 🐛 Bug? → [open an issue](https://github.com/ZySec-AI/hypermind/issues)
500
+ - 🔒 Security report? → [SECURITY.md](SECURITY.md)
501
+ - 💡 Idea? → [Discussions](https://github.com/ZySec-AI/hypermind/discussions)
502
+ - 🤝 Code? → check `good first issue` and `help wanted` labels
503
+
504
+ By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
505
+
506
+ ---
507
+
508
+ ## License & credits
509
+
510
+ Apache-2.0 — see [LICENSE](LICENSE).
511
+
512
+ `hypermind` builds on the IETF [SCITT architecture](https://datatracker.ietf.org/doc/draft-ietf-scitt-architecture/), [LAMPS composite signatures](https://datatracker.ietf.org/doc/draft-ietf-lamps-pq-composite-sigs/), [RFC 9591 FROST](https://datatracker.ietf.org/doc/html/rfc9591), [RFC 6962 Merkle transparency](https://datatracker.ietf.org/doc/html/rfc6962), and [c2sp.org/tlog-witness](https://github.com/C2SP/C2SP/blob/main/tlog-witness.md).
513
+
514
+ ---
515
+
516
+ <div align="center">
517
+
518
+ **HyperMind — the protocol for swarm intelligence between AI agents.**
519
+
520
+ *Many minds, learning together — across companies, with cryptographic chain of custody.*
521
+
522
+ [github.com/ZySec-AI/hypermind](https://github.com/ZySec-AI/hypermind)
523
+
524
+ </div>