
Semahash
io.github.emergent-wisdom由 GitHub 帳號 emergent-wisdom 發布v0.10.0更新於 Oct 25, 2026
Content-addressed semantics: fail-closed handshakes over 617 cognitive patterns.
概覽
本機 MCP 伺服器,提供 Sema 的內容定址認知模式詞彙表,讓助理搜尋、解析、鑄造模式並在共用概念上做握手驗證。
- 可以做什麼
- 搜尋、查詢與解析內容定址模式,可展開相依關係,並透過分層分類樹、詞彙統計與極簡圖概覽瀏覽詞彙表,也可驗證模式 JSON。鑄造新模式:驗證、計算雜湊並加入詞彙表;計算或驗證情境摘要,用於多代理定義集的漂移偵測。在代理之間執行失敗即停的握手,支援協作式前綴比對與嚴格全雜湊驗證,不符即中止。尋找、驗證、安裝、發布 semahash.org 上的詞彙庫並登入,以及清除工作階段快取以恢復完整搜尋結果。
- 適用情境
- 適合多個代理或人員需要共用一套可雜湊驗證的協作、推理與信任模式詞彙表,並在依賴某個概念前確認雙方理解一致的場景。也適合建置或散布自有私有模式庫的團隊。
- 執行需求
- 以本機 stdio 程序執行,透過 uvx 從 semahash 的 PyPI 套件啟動(或以 pip 安裝),機器上需要 uv 或 Python。內建詞彙表無需 API 金鑰。從 semahash.org 安裝或發布需要網路存取,發布另需 semahash.org 帳號及在個人資料頁建立的金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Semahash,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[Sema — When the hash is the word]
Sema: When the Hash Is the Word
Content-addressed semantics for multi-agent coordination.
[PyPI] [MCP Registry] [Paper] [DOI] [Code: MIT] [Content: CC BY 4.0]
Sema is a content-addressed reference system for reasoning and communication. Participants encode and hash information under an agreed representation, then reuse the content address as a verifiable reference, optionally paired with a human-readable handle. Matching full references establishes identity of the resolved hashed content; semantic equivalence, correctness, and enforcement remain separate questions.
Web: semahash.org · Discord: Join
Install
MCP Server (recommended)
Add to any MCP client (Claude Code, Cursor, VS Code, Windsurf, Claude Desktop):
Or via Claude Code CLI:
This uses uv to download, install, and run sema in an isolated environment on first invocation, then caches it for subsequent calls.
Claude Code plugin (MCP server + skill)
Sema also ships as a Claude Code plugin — MCP server plus a skill that teaches the agent the search/resolve/mint/handshake workflow:
This gives you the MCP server and the sema-usage skill (auto-loaded), which teaches when to search vs mint, how to embed handles in text, and how to verify meaning at boundaries. The skill is a Claude Code convenience — the MCP server works with any client.
For local development:
Permanent install (pip)
For CLI-only use (no MCP server):
Quick Start
Use with AI Agents (MCP)
Already covered above via the JSON config or pip install path. For development against this repo:
Your agent now has access to sema_search, sema_lookup, sema_handshake, and 9 more tools. Any MCP-compatible client works — Sema exposes a standard stdio server.
Verify it works — ask your agent: "Search sema for coordination patterns and handshake on StateLock"
Sema exposes a standard MCP stdio server — any MCP-compatible client works, including OpenClaw (openclaw mcp set sema '{"command":"uvx","args":["--from","semahash[mcp]","sema","mcp"]}').
Use via CLI
Bring Your Own Vocabulary
Build a private registry from scratch — no PR or maintainer in the loop:
Subsequent sema commands (including sema mcp) read from your private
registry. (SEMA_DB_PATH, if set, overrides sema use.) See
CONTRIBUTING.md for the canonical
contribution path and docs/specification/versioning.md for the
refinement and supersession policy.
Package a project database as a verified, standalone library release:
Publish the generated library.json and versioned ZIP as assets on the
corresponding published GitHub Release. Consumers install the Release asset URL
for library.json—not the repository URL or a branch:
It installs one verified snapshot at a time rather than merging vocabularies;
the bundled vocabulary remains the offline default. Use sema update mylib to
follow the installed library's recorded release pointer. See
Publishing and Installing Vocabulary Libraries for
the complete DeFi authoring, dependency-closure, packaging, GitHub Release, and
update workflow.
Libraries published on semahash.org can be found and installed by name, without an account:
To list a release there so other people and agents can find it, log in once and publish from the command line:
An agent can log in with a key that you create on your semahash.org profile
page instead: it pipes the key to sema login --key - or calls the
sema_library_login MCP tool.
The login follows the OAuth 2.0 device authorization flow, so it also works
from an agent or a machine without a browser. To use another deployment, run
sema login --registry https://registry.example. A successful login remembers
that registry for subsequent commands. --registry and SEMA_REGISTRY_URL
override the remembered choice; https://semahash.org is the first-use default.
Use in Python
Try the Protocol (No API Keys Needed)
See the handshake in action: matching hashes PROCEED, mismatched hashes HALT, and unknown patterns HALT. Cooperative mode accepts short prefixes for drift detection; strict mode requires the full hash. Takes 2 seconds.
How It Works
Take any concept (a coordination protocol, a reasoning pattern, a trust mechanism), express it in canonical form, hash it. That hash IS the word. Change one byte in the definition, get a different word.
This is the Anti-Postel principle: strict mode proceeds only on full-hash identity; cooperative mode uses compact prefixes as a non-adversarial drift signal. Mismatches fail closed in both modes.
The Vocabulary
The bundled vocabulary spans 4 layers:
- Physics — Immutable substrate (locks, entropy, causality)
- Mind — Hybrid cognition (reasoning, inference, strategy)
- Society — Multi-agent coordination (economics, governance, protocols)
- Infrastructure — Operational constraints (data structures, verification)
Each pattern is a content-addressed behavioral definition. Concrete cards may add machine-verifiable contracts, invariants, failure modes, parameters, and typed dependencies where those fields are identity-defining.
MCP Tools
When running as an MCP server (sema mcp), these tools are available:
Local View
The local view shows the vocabulary selected with sema use, the same one a
connected agent writes to. It follows later switches, and its 3D graph grows
while the agent mints: new patterns light up and appear in a live list. The
pattern browser has card, list, and JSON views. Development stays on your
computer; semahash.org hosts finished libraries, and a
writable vocabulary's page lists the optional steps to publish one there.
Experiments
The experiments/ directory contains reproducible evaluations of Sema's
claims and implementation boundaries.
Delta reconstruction
The public v0.3.0 to v0.4.0 reconstruction experiment checks whether the
current graph and hash-cascade algorithm can rebuild a target vocabulary from
an earlier release. It compares both aggregate roots, semantic pattern content,
the logical dependency graph, unhashed metadata, and the complete normalized
read model rather than treating root equality as complete release equality.
It also demonstrates the safe reconstruction path: integrate the delta into a
complete staged card snapshot, compile a fresh database, verify the result, and
only then activate it.
The experiment and its expected results are documented in
experiments/delta_reconstruction/README.md.
Small synthetic versions of its addition, removal, rename, cascade, metadata,
and failure cases run in the regular test suite.
Multi-agent design challenge
The controlled multi-agent design challenge compares three conditions:
Agents with Sema patterns produced physics-grounded designs that survived adversarial scrutiny. Agents without Sema produced shallow designs that failed safety review.
To reproduce:
See experiments/sema_design_challenge/README.md for details.
Key Properties
- Zero semantic collisions across the full vocabulary
- 16.9x average token compression via content-addressed stubs
- Fail-closed architecture — mismatches halt, never fail silently
- Mean embedding similarity of 0.21 — high structural distinctness
Formal-verification pilot
Sema's handshake decision kernel and canonicalization type tags have a small
Lean 4 proof suite. The handshake supports cooperative prefix matching for
ordinary drift detection and strict full-hash verification for proof-grade
identity; the proofs state each guarantee separately. The encoding proof
establishes pre-hash domain separation, while Python conformance tests connect
the models to production. See
verification/README.md for the proven theorems,
trusted-computing-base assumptions, and explicit limits of the claim.
Using with understanding-graph
Sema gives your agents shared semantic memory — a vocabulary of cognitive patterns with content-addressed identity. Understanding Graph gives them shared episodic memory — the actual thinking trail behind a decision. They compose:
With both installed, an agent can:
- Anchor an understanding-graph decision node in a sema pattern hash (e.g.
StateLock#c9c2) so the meaning of the primitive can never drift. - Use
graph_semantic_searchto find all past graph nodes that reference a given sema pattern — hash-stable history, not keyword matching. - Call
sema_handshakebefore writing a decision that depends on a shared concept; if it returnsHALT, the agent writes atensionnode instead and stops, preventing silent divergence.
Full walkthrough: docs/guides/understanding-graph.md
Repository Structure
Contributing
Want to add patterns, improve existing ones, or host the frontend locally? See CONTRIBUTING.md.
Citing
See CITATION.cff for the machine-readable version (GitHub
renders a "Cite this repository" button from it).
Safety
Sema ships no executable code — it's a library of pattern definitions (handles, mechanisms, invariants, dependency graphs). The MCP server hands patterns to clients as data; it does not execute the behaviors they describe.
Intended use: reasoning and reference. Patterns are thinking tools — named concepts agents can search, resolve, and handshake on to reason about coordination, risk, and procedure. See docs/manuals/vocabulary-design.md for the intent behind each pattern and the design choices.
Running patterns as executable recipes is untested. Many patterns describe procedures an agent could step through; patterns in a Dynamics category do not, because they describe how a system behaves and are applied to interpret a case rather than executed. Executing a procedure is still a research phase — the mechanism text has not been validated end-to-end, and we make no claims about safety when a pattern is executed rather than referenced. If you go this route, run the agent's execution step in a sandboxed environment. Patterns with known risks carry a caution field in their metadata; absence of that flag means the pattern has not been classified as risky, not that it has been certified safe.
The long-term goal is cryptographically enforced safety constraints on agent-to-agent communication — an active research direction.
License
Sema is dual-licensed:
-
Code (everything in
src/,web/,experiments/,scripts/, and the package config) — MIT. Self-host it, fork it, build commercial products on top of it. -
Content (the pattern vocabulary in
data/, the documentation indocs/, the academic paper inpaper/, and the prose displayed on semahash.org) — CC BY 4.0. Reuse the patterns and prose anywhere, for any purpose including commercial. Suggested attribution when sharing the vocabulary:
For academic citation, see CITATION.cff. GitHub renders this
as a "Cite this repository" button on the project page that generates APA and
BibTeX automatically.
來源:README.md,提交 61c94b8
工具
0版本歷史
9- v0.10.0最新Oct 11, 2026
- v0.9.1Oct 9, 2026
- v0.9.0Oct 8, 2026
- v0.8.1Oct 8, 2026
- v0.8.0Oct 7, 2026
- v0.7.1Oct 4, 2026
- v0.7.0Sep 28, 2026
- v0.6.0Sep 27, 2026
- v0.5.5Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分