Cognitive Substrate

io.github.JaysonAIOnline由 GitHub 帳號 JaysonAIOnline 發布v1.0.1更新於 Oct 27, 2026

28-layer cognitive substrate with cross-session ToT evolutionary memory and self-telemetry tools

已驗證STDIO僅桌面知識與記憶AI 與機器學習

概覽

AI 產生的概覽

本機 Python MCP 伺服器,讓助理透過 28 層推理基底處理提示,並以 SQLite 保存跨工作階段的思維樹記憶。

可以做什麼
  • 透過 6 大族、28 層的認知基底驗證提示與分支,並給出剪枝判定
  • 執行七種推理範式(演繹、歸納、溯因、類比、因果、三段論、否證)並產生推理計畫
  • 跨工作階段儲存、召回與剪枝思維樹記憶,包含五鍵遙測與被剪枝分支留下的經驗
  • 透過認知樹狀態工具檢視工作階段遙測:作用中路徑與被剪枝分支
  • 用堆疊式解析器從雜亂文字中擷取並解析 JSON
  • 透過 A2A 列出、探索、呼叫並編排對等代理
適用情境
適合希望助理依明確的分層清單組織推理,並把失敗方案的经验帶入後續工作階段的場合。較偏向推理框架與代理間呼叫的實驗,而非日常資料或檔案處理。
執行需求
以本機 stdio 程序執行,使用 pip 安裝 mcp-cognitive-substrate,並以 cognitive-substrate 指令啟動。需要 Python 3.11 以上版本。未宣告帳號、API 金鑰、環境變數或標頭。記憶儲存在本機 SQLite。
安裝前請注意
基底判定被描述為啟發式,應視為輔助框架而非權威結論。記憶與遙測會寫入本機 SQLite 並跨工作階段保留,推理內容會持久化到磁碟。A2A 工具可呼叫並編排對等代理,可能將資料傳送給這些代理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cognitive Substrate,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-cognitive-substrate

mcp-name: io.github.JaysonAIOnline/cognitive-substrate

A 28-layer cognitive substrate with cross-session Tree-of-Thoughts (ToT) evolutionary memory, conditional self-telemetry, and A2A tools for MCP agents.

Lets agents reason through a validated 28-layer substrate, evolve memory across sessions, and communicate with peer agents — all in one pip-installable package.

Features

  • 28-layer cognitive substrate with Pydantic validation — CognitiveSubstrate validates reasoning through 6 families / 28 layers.
  • Cross-session ToT evolutionary memory — SQLite-backed tree-of-thoughts nodes + substrate history; pruned branches become lessons for future sessions.
  • Robust stack-based JSON parser — no regex; handles nested brackets, escaped strings, embedded code fences (robust_slice / robust_json_slice).
  • Self-telemetry tool — get_cognitive_tree_state returns active paths and pruned branches for a session.
  • Post-execution storage loop — store_5key_telemetry auto-saves compact 5-key telemetry (foundations, metacognition, defensive, resource, utility).
  • 7 reasoning paradigms — deductive, inductive, abductive, analogical, causal, syllogistic, falsification.
  • A2A tools — list, discover, call, and orchestrate peer agents.
  • MCP server — exposes everything as tools via the cognitive-substrate CLI.

Install

bash
pip install mcp-cognitive-substrate

Or install from source:

bash
git clone https://github.com/JaysonAIOnline/mcp-cognitive-substrate.gitcd mcp-cognitive-substratepip install -e .[test]

Requires Python >= 3.11.

Quick Start

python
from mcp_cognitive_substrate.substrate import CognitiveSubstratefrom mcp_cognitive_substrate.memory import get_cognitive_tree_state, store_5key_telemetry
substrate = CognitiveSubstrate()response = substrate.run("Your user prompt here")print(response["layers_applied"], "layers applied")print(response["substrate_verdict"])

Usage

28-layer substrate

python
from mcp_cognitive_substrate import substrate
# Layer count and schemaprint(substrate.layer_count())        # 28print(substrate.SUBSTRATE_SCHEMA)     # the full 6-family schema
# Validate a prompt through the substrateresult = substrate.CognitiveSubstrate(session_id="s1").run("deploy safely")print(result["substrate_verdict"])    # heuristic pruning verdict
# Run a single paradigmfrom mcp_cognitive_substrate import run_paradigmprint(run_paradigm("14_idempotency_side_effect_audit", {"evaluate_branch": True}))

Cross-session ToT evolutionary memory

python
from mcp_cognitive_substrate.memory import (    store_5key_telemetry,    get_cognitive_tree_state,    prune_failed_approach,)
node_id = store_5key_telemetry(    session_id="session-a",    payload={        "foundations": {"premise_validation": "assuming deps", "state_hash": "h", "falsification_notes": "deps missing"},        "defensive": {"blast_radius": "unpredictable", "is_idempotent": True, "invariant_rule": "r"},        "resource": {"big_o": "o(n)", "latency_bottleneck": "none"},        "utility": {"load_summary": "pin versions to deploy", "checklist_verified": True},        "metacognition": {"self_critique": "c", "drift_pct": 0.1},    },    score_delta=-110.0,)prune_failed_approach(node_id)state = get_cognitive_tree_state("session-a", include_pruned=True)print(state["active_path_count"], state["pruned_branch_count"])

Stack-based JSON parser

python
from mcp_cognitive_substrate.memory import robust_slice, robust_json_slice
cleaned, payload = robust_slice('prefix {"a": {"b": [1, 2]}, "c": "x"} suffix')# payload == {"a": {"b": [1, 2]}, "c": "x"}; cleaned == "prefix suffix"

7 reasoning paradigms + A2A

python
from mcp_cognitive_substrate import reason, a2a_list, a2a_call, a2a_orchestrate
print(reason("Solve X", reasoning_type="abductive", depth=3)["steps"])print(a2a_list())print(a2a_call("peer-agent", "hello"))print(a2a_orchestrate("hi", capability="memory"))

As an MCP server

bash
cognitive-substrate          # starts stdio MCP servercognitive-substrate --info   # prints package summary

All of the above — substrate paradigms, extraction/evaluation, memory store/recall, ToT lessons, tree-state telemetry, JSON parsing, reasoning plans, and A2A — are exposed as MCP tools.

Testing

bash
pip install -e .[test]python -m pytest src/tests -q     # 16 tests

License

MIT

來源:README.md,提交 064d125

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分