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 分