关于 Deep Thinker
Deep Thinker 是用于结构化推理的 MCP 服务,通过有向无环图管理思路,并提供多种推理策略、评估和会话恢复。适合需要分析复杂问题并检查推理过程的 Agent。
主要功能
- 01以有向无环图组织思路
- 02支持 10 种推理策略
- 03评估置信度并生成自我批评
- 04检测停滞并建议策略切换
- 05保存并恢复推理会话
- 06查询、修剪和优化思路图
适用场景
- 01比较架构方案并整理论据
- 02分析故障并探索可能原因
- 03评估选项、风险和决策影响
- 04恢复先前保存的分析会话
MCP 相关
该 MCP 服务向客户端提供 17 个推理与图管理工具,包含思考、评估、元认知监控和图查询。工具响应采用结构化格式,并建议后续操作。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
17收录的工具列表 · 更新于 3 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | string | 是 | 思考内容 |
| type | enum | 否 | 思考类型(默认值:analysis)hypothesis | analysis | evidence | conclusion | question | assumption | insight | critique | synthesis | observation |
| strategy | enum | 否 | 要使用的推理策略(默认值:来自元认知的当前策略)。使用 'auto' 自动选择策略。新策略:first_principles=分解至基本原理,counterfactual=假设分析,systems_thinking=反馈回路和杠杆点,mcts=用于优化的蒙特卡洛树搜索sequential | dialectic | parallel | analogical | abductive | first_principles | counterfactual | systems_thinking | mcts | auto |
| confidence | number | 否 | 此思考的初始置信度,范围为 0–1(默认值:0.5) |
| parentId | string | 否 | 要连接的父思考 ID(默认值:最后一个活动叶节点) |
| branch | string | 否 | 用于并行探索的分支名称(默认值:main) |
| tags | array | 否 | 用于对思考进行分类的标签 |
| edgeTo | object | 否 | 创建一条指向其他节点的显式边 |
| edgeTo.targetId | string | 否 | 目标节点 ID |
| edgeTo.type | enum | 否 | 边类型derives_from | contradicts | supports | refines | challenges | synthesizes | parallels | abstracts | instantiates |
| dialectic | object | 否 | 辩证模式:提供 thesis(可选提供 antithesis/synthesis) |
| dialectic.thesis | string | 否 | 论题/命题 |
| dialectic.antithesis | string | 否 | 对立观点(可选) |
| dialectic.synthesis | string | 否 | 综合结论(可选) |
| parallel | array | 否 | 并行模式:同时探索多个相互独立的思路 |
| analogical | object | 否 | 类比模式:源领域、映射关系和推导结论 |
| analogical.sourceDomain | string | 否 | 用于进行类比的已知领域 |
| analogical.mapping | string | 否 | 各领域之间的对应关系 |
| analogical.projectedConclusion | string | 否 | 通过类比推导出的结论 |
| abductive | object | 否 | 溯因模式:观察结果、可能的解释和最佳解释 |
| abductive.observation | string | 否 | 需要解释的观察结果 |
| abductive.explanations | array | 否 | 可能的解释及其合理性评分 |
| abductive.bestExplanation | string | 否 | 最佳解释(如已确定) |
| firstPrinciples | object | 否 | 第一性原理模式:将问题分解为基本事实并重新构建 |
| firstPrinciples.problem | string | 否 | 要分解的问题(默认:使用内容) |
| firstPrinciples.assumptions | array | 否 | 需要质疑的假设 |
| firstPrinciples.depth | number | 否 | 分解深度(默认:3) |
| firstPrinciples.domain | string | 否 | 可选的领域背景(例如,'physics'、'economics') |
| counterfactual | object | 否 | 反事实模式:分析假设情景及其连锁影响 |
| counterfactual.currentState | string | 否 | 当前状态的描述(默认:使用内容) |
| counterfactual.variablesToChange | array | 是 | 假设情景中要修改的变量 |
| counterfactual.timeHorizon | enum | 否 | 影响的时间范围immediate | short_term | medium_term | long_term |
| counterfactual.rippleDepth | number | 否 | 涟漪效应阶段数(默认值:3) |
| systemsThinking | object | 否 | 系统思维模式:分析反馈回路和杠杆点 |
| systemsThinking.systemDescription | string | 否 | 系统描述(默认使用内容) |
| systemsThinking.boundaries | array | 否 | 系统边界 |
| systemsThinking.components | array | 是 | 系统组件(至少需要 2 个) |
| systemsThinking.timeScale | enum | 否 | 分析时间尺度immediate | short_term | medium_term | long_term |
| systemsThinking.focusArea | enum | 否 | 分析重点feedback_loops | leverage_points | emergence | resilience | all |
| mcts | object | 否 | MCTS 模式:用于选择最优路径的蒙特卡洛树搜索 |
| mcts.problem | string | 否 | 要解决的问题(默认使用内容) |
| mcts.possibleActions | array | 是 | 待评估的可能操作(至少 2 个) |
| mcts.simulationDepth | number | 否 | 模拟深度(默认值:5) |
| mcts.numSimulations | number | 否 | 模拟次数(默认值:100) |
| mcts.explorationConstant | number | 否 | UCB1 探索常数(默认值:1.414) |
| mcts.pruningThreshold | number | 否 | 剪枝阈值(默认值:0.2) |
| knowledge | object | 否 | 将外部知识附加到此思考中 |
| knowledge.source | string | 否 | 知识来源 |
| knowledge.content | string | 否 | 知识内容 |
| knowledge.relevance | number | 否 | 与此思考的相关性(0-1) |
详细介绍
deep-thinker
高级认知思考 MCP 服务,具备基于 DAG 的思维图、10 种推理策略(包括自动选择)、17 个工具、节点别名、会话持久化、结构化响应和智能错误处理。
相比顺序思考 MCP,这是一次重大升级,通过基于图的思维管理、架构验证和智能策略选择,提供结构化的深度推理。
快速开始
npx deep-thinker
{
"mcpServers": {
"deep-thinker": {
"command": "npx",
"args": ["-y", "deep-thinker"]
}
}
}
示例
| 示例 | 策略 | 使用场景 |
|---|---|---|
| 架构决策 | 辩证 + 并行 | 单体与微服务之争 |
| 调试事故 | 溯因 | 生产环境 500 错误 |
| 功能优先级排序 | 并行 + 辩证 | Q3 路线图规划 |
| 科学假设 | 类比 + 溯因 | 用于 CRISPR 的 LNP 递送 |
| 打破死胡同 | 元认知切换 | 无服务器成本分析 |
功能
- 基于 DAG 的思维图 — 思维构成有向无环图,支持分支、合并和跨边(不只是线性链)
- 10 种推理策略 — 顺序、辩证(论题→反题→合题)、并行、类比、溯因、第一性原理(分解至基本原理)、反事实(假设情景及其连锁影响)、系统思维(反馈回路和杠杆点)、MCTS(蒙特卡洛优化)、自动(根据内容和图状态智能选择)
- 节点别名 — 对任何
nodeId参数使用"last"、"best"、"root",无需使用难以理解的节点 ID - 结构化响应 — 所有工具响应均返回格式一致的
MCPResponseJSON,包含status、summary、confidence、nextSuggested - 会话持久化 — 自动将思维图保存到
~/.deep-thinker/sessions/;通过reset({ resume: "name" })在 MCP 重启后恢复会话 - 友好的错误消息 — 将 Zod 验证错误转换为易于理解的提示(例如,
"confidence 0 ile 1 arasında...") - 置信度评分 — 多因素置信度评估,包含支持/矛盾分析、深度惩罚和知识整合加成
- 自我批判 — 自动生成带有严重程度等级的批判,并调整置信度
- 元认知引擎 — 检测卡住、停滞、置信度下降等状态;建议切换策略并采取纠正措施
- 知识整合 — 为思维附加外部知识、检测知识缺口、验证不同来源之间的一致性
- 思维修剪 — 检测死胡同、移除冗余、清理无成效的深层分支、优化路径
- help 工具 — 按类别(核心/高级/工作流)查看全部 17 个工具,并提供快速入门示例
- conclude 工具 — 全面的图摘要,包含
primaryFinding、actionItems、graphHealth和nextSuggested - 高智商推理增强功能 — 8 种高级工具:可视化、唱反调、跨学科综合、时间投射、伦理评估、情商分析、决策说明、社会影响分析
- 情商 — 分析情感基调、同理心、说服效果和利益相关方的情绪
- 伦理框架 — 从义务论、结果主义、美德伦理和权利视角进行评估
- 跨领域综合 — 综合生物学、经济学、物理学、心理学、计算机科学和艺术领域的见解
- 时间推理 — 将思维投射到未来/过去情境中,涵盖乐观、悲观、现实和颠覆性情境
- 社会影响建模 — 分析利益相关方的情绪、群体凝聚力、说服效果和伦理一致性
- 不确定性量化 — 通过置信区间、概率分布和敏感性分析,支持稳健决策
- 多语言支持 — 支持以英语、土耳其语、德语、法语、西班牙语、日语、中文和俄语进行思考
- 元认知层级 — 在 5 个元认知层级上进行递归推理
- PromptOptimizer(节点零) — 入口点,可将模糊提示词转换为优化后的超级提示词,并自动路由策略
安装
全局安装
npm install -g deep-thinker
npx(无需安装)
npx deep-thinker
MCP 配置
Claude Desktop
将以下内容添加到你的 claude_desktop_config.json:
{
"mcpServers": {
"deep-thinker": {
"command": "npx",
"args": ["-y", "deep-thinker"]
}
}
}
如果已全局安装:
{
"mcpServers": {
"deep-thinker": {
"command": "deep-thinker"
}
}
}
其他 MCP 客户端
该服务通过 stdio 通信。将 MCP 客户端指向 deep-thinker 命令或 node path/to/dist/index.js。
响应格式
所有工具响应均遵循 MCPResponse 结构:
{
"status": "ok | error | warning",
"nodeId": "thought_3",
"summary": "sequential stratejisiyle \"Should we use microservices?...\" eklendi",
"confidence": 0.75,
"data": { "...": "tool-specific data" },
"nextSuggested": {
"tool": "evaluate",
"params": { "critique": true },
"reason": "Düşük confidence — değerlendirme önerilir"
},
"warnings": ["Stuck detected: ..."]
}
nextSuggested 字段始终会推荐下一步的合理操作,让你无需猜测即可串联调用工具。
节点别名
无需查找晦涩的节点 ID,即可将别名用于任何 nodeId、parentId 或 targetId 参数:
| 别名 | 解析为 |
|---|---|
"last" | 最近添加的节点(按插入顺序) |
"best" | 置信度得分最高的节点 |
"root" | 第一个没有入边的节点 |
evaluate({ nodeId: "last" }) → evaluates the latest thought
simulate_devils_advocate({ nodeId: "best", depth: 2 }) → challenges the strongest thought
graph({ action: "path", nodeId: "root", targetId: "best" }) → traces from root to best conclusion
会话持久化
每次调用 think 后,思维图都会自动保存。会话存储在 ~/.deep-thinker/sessions/ 中。
// Save current session explicitly
reset({ save: true, saveName: "my-analysis" })
// List saved sessions
reset({ listSessions: true })
// Resume a saved session after MCP restart
reset({ resume: "my-analysis" })
工具
核心工具
think
使用推理策略向认知图谱添加一条想法。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
content | string | 是 | 想法内容 |
type | string | 否 | 想法类型:hypothesis、analysis、evidence、conclusion、question、assumption、insight、critique、synthesis、observation |
strategy | string | 否 | 策略:sequential、dialectic、parallel、analogical、abductive、first_principles、counterfactual、systems_thinking、mcts、auto |
confidence | number | 否 | 初始置信度,范围为 0-1(默认值:0.5) |
parentId | string | 否 | 父节点 ID 或别名(默认值:最后一个叶节点) |
branch | string | 否 | 并行探索的分支名称 |
tags | string[] | 否 | 用于分类的标签 |
edgeTo | object | 否 | 显式边:{ targetId, type } |
dialectic | object | 否 | 辩证模式:{ thesis, antithesis?, synthesis? } |
parallel | array | 否 | 并行模式:[{ content, type, confidence }] |
analogical | object | 否 | 类比模式:{ sourceDomain, mapping, projectedConclusion } |
abductive | object | 否 | 溯因模式:{ observation, explanations[], bestExplanation? } |
firstPrinciples | object | 否 | 第一性原理模式:{ problem, assumptions?, depth?, domain? } |
counterfactual | object | 否 | 反事实模式:{ currentState?, variablesToChange, rippleDepth? } |
systemsThinking | object | 否 | 系统思维模式:{ systemDescription?, components, focusArea? } |
mcts | object | 否 | MCTS 模式:{ problem?, possibleActions, numSimulations? } |
knowledge | object | 否 | 附加知识:{ source, content, relevance } |
策略详情:
| 策略 | 描述 | 最适用场景 |
|---|---|---|
| Sequential | 线性链:每条想法都从上一条推导而来 | 逐步推理 |
| Dialectic | 通过正题 → 反题 → 合题模式解决矛盾 | 解决冲突 |
| Parallel | 同时探索多个相互独立的分支 | 集思广益 |
| Analogical | 将已知领域中的模式映射到当前问题 | 跨领域洞见 |
| Abductive | 生成假设并推断最佳解释 | 根因分析 |
| First Principles | 将问题分解为基本事实,并质疑假设 | 打破常规 |
| Counterfactual | 探索具有多阶段连锁影响的“假如”情景 | 风险/影响分析 |
| Systems Thinking | 反馈回路、杠杆点和涌现属性 | 复杂系统 |
| MCTS | 使用蒙特卡洛树搜索选择最优决策 | 优化问题 |
| Auto | 根据内容信号和图谱上下文自动选择策略 | 无需手动干预的推理 |
auto 策略的工作原理:
auto 策略会分析内容中的关键词和当前图谱状态:
- 内容包含“why”/“neden”/“how”/“nasıl” →
abductive - 内容包含“if”/“eğer”/“what if”/“varsayalım” →
counterfactual - 内容包含“vs”/“veya”/“compare”/“karşılaştır” →
dialectic - 内容包含“system”/“sistem”/“loop”/“döngü” →
systems_thinking - 内容包含“fundamental”/“temel”/“assumption”/“varsayım” →
first_principles - 平均置信度较低且节点较多 →
parallel(突破僵局) - 第一条想法 →
sequential - 连续添加 4 条或更多想法后 →
dialectic(引入对立观点) - 默认 →
sequential
边类型: derives_from、contradicts、supports、refines、challenges、synthesizes、parallels、abstracts、instantiates
evaluate
通过置信度评分、批判和图健康状况分析来评估思考过程。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
nodeId | string | 否 | 要评估的特定节点(接受别名:last、best、root) |
critique | boolean | 否 | 生成自我批判(默认:true) |
findGaps | boolean | 否 | 查找知识缺口(默认:false) |
validateKnowledge | boolean | 否 | 验证知识一致性(默认:false) |
metacog
元认知操作——监控和控制思考过程。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
action | string | 是 | report = 完整状态,switch = 更改策略,auto_update = 让系统分析 |
strategy | string | 否 | 新策略(用于 switch 操作) |
reason | string | 否 | 切换原因(用于 switch 操作) |
元认知引擎会自动:
- 检测停滞(置信度没有提升)
- 检测置信度下降趋势
- 检测过多矛盾
- 建议切换策略、修剪、回溯或结束
graph
查询和可视化思维图。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
action | string | 是 | visualize、stats、path、node、branches、best_path、leaves |
nodeId | string | 否 | 节点 ID 或别名(用于 path、node 操作) |
targetId | string | 否 | 目标 ID 或别名(用于 path 操作) |
prune
修剪和优化思维图。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
action | string | 是 | analyze(仅报告)、prune(执行)、optimize_path、prune_node |
nodeId | string | 否 | 要修剪的节点——接受别名(用于 prune_node) |
reason | string | 否 | 原因(用于 prune_node) |
reset
重置思维图并开始新会话、保存会话或恢复已保存的会话。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
problem | string | 否 | 新的问题陈述 |
save | boolean | 否 | 重置前保存当前会话(默认:false) |
saveName | string | 否 | 已保存会话的名称(如果 save: true,建议填写) |
resume | string | 否 | 按名称恢复之前保存的会话 |
listSessions | boolean | 否 | 列出所有已保存的会话 |
conclude
分析整个思维图,并生成包含行动项和图健康状况报告的综合总结与结论。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
detailLevel | string | 否 | brief、detailed、technical(默认:detailed) |
includeCounterfactuals | boolean | 否 | 包含反事实分析(默认:false) |
format | string | 否 | prose、structured、executive(默认:structured) |
响应包含:
primaryFinding— 最主要的结论及其置信度supportingEvidence— 其他高置信度节点strategiesUsed— 采用了哪些策略keyInsights— 最佳路径上的洞见类节点actionItems— 根据结论得出的优先行动项graphHealth— 节点数量、死胡同、平均置信度、建议nextSuggested— 合乎逻辑的下一步(状态不佳时修剪,完成后保存)
help
发现深度思考工具并了解使用工作流。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
category | string | 否 | all、core、advanced、workflow(默认值:all) |
类别:
- core — 7 个日常使用的工具(think、evaluate、metacog、graph、prune、reset、conclude)
- advanced — 8 个深度分析工具(可视化、唱反调、跨学科、时间推演、伦理、情感、解释、社会影响、提示词优化器)
- workflow — 3 个推荐工作流:
- 快速决策 — reset → 并行 think → evaluate → conclude
- 深度分析 — reset → first_principles → counterfactual → devil's advocate → evaluate → metacog → prune → conclude
- 打破僵局 — metacog 报告 → 切换策略 → cross-disciplinary → abductive
增强型工具(高智商推理)
visualize_thought_graph
将思维图生成为 SVG 或 ASCII 可视化表示。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
format | string | 否 | svg、ascii 或 tree(默认值:ascii) |
highlightPath | string | 否 | 两个节点 ID 之间的路径(格式:fromId-toId) |
showConfidence | boolean | 否 | 显示置信度分数(默认值:true) |
simulate_devils_advocate
为给定的想法生成反驳论点和对立观点。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
nodeId | string | 是 | 目标节点 ID 或别名(last、best、root) |
depth | number | 否 | 反驳论点的层级(1-5,默认值:2) |
intensity | string | 否 | mild、moderate 或 aggressive(默认值:moderate) |
cross_disciplinary_synthesis
结合多个领域的见解,生成新颖的观点。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
sourceDomains | string[] | 是 | 用于类比的领域(例如,["biology", "economics", "art"]) |
targetProblem | string | 是 | 要应用跨领域见解的问题 |
maxAnalogies | number | 否 | 要生成的最多类比数量(1-10,默认值:3) |
temporal_projection
将想法投射到未来或过去的情境中。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
nodeId | string | 是 | 根节点 ID 或别名 |
years | number | 是 | 向前(正数)或向后(负数)的年数 |
scenario | string | 否 | optimistic、pessimistic、realistic、disruptive(默认值:realistic) |
ethical_framework_evaluation
通过多种伦理框架评估想法或决策。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
nodeId | string | 是 | 节点 ID 或别名 |
frameworks | string[] | 否 | 采用哪些框架:deontological、consequentialist、virtue、rights_based(默认值:全部) |
emotional_intelligence_analysis
分析情感基调、利益相关者的情绪和社会动态。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
text | string | 是 | 要分析其情感内容的文本 |
context | string | 否 | 上下文(例如,team meeting、customer feedback、crisis situation) |
perspectiveTaking | number | 否 | 换位思考程度,范围为 0-1(默认值:0.7) |
explain_decision
生成易于人理解的决策路径解释。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
nodeId | string | 是 | 决策/结论节点 ID 或别名 |
detailLevel | string | 否 | simple、detailed、technical(默认值:detailed) |
includeCounterfactuals | boolean | 否 | 显示假设情景(默认值:true) |
social_impact_analysis
分析社会影响、利益相关者情绪、群体凝聚力和说服效果。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
nodeId | string | 是 | 节点 ID 或别名 |
stakeholders | string[] | 否 | 利益相关者群体(默认值:["customers", "employees", "investors", "community"]) |
optimize_prompt
PromptOptimizer(Node Zero)——将模糊的提示词转化为经过优化的超级提示词,并进行策略路由。
参数:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
originalPrompt | string | 是 | 用户原始的、可能模糊的提示词 |
userContext | object | 否 | { expertiseLevel, domainKnowledge[], preferences } |
conversationHistory | array | 否 | 用于提供上下文的历史消息(最多 20 条) |
optimizationLevel | string | 否 | light、standard、aggressive(默认值:standard) |
targetModel | string | 否 | claude、gpt4、gpt35、local、generic(默认值:generic) |
autoRoute | boolean | 否 | 自动路由至推荐策略(默认值:false) |
使用示例
自动策略选择(新增!)
think: { content: "Eğer mikroservis kullansaydık ne olurdu?" }
→ Auto-selects strategy: counterfactual (detected "Eğer" = "if" signal)
think: { content: "Why is the server crashing?" }
→ Auto-selects strategy: abductive (detected "why" signal)
think: { content: "Monolith vs microservices?" }
→ Auto-selects strategy: dialectic (detected "vs" comparison signal)
顺序推理
think: "Should we use microservices?" → type: question, confidence: 0.9
think: "Monolith has deployment bottlenecks" → type: analysis, confidence: 0.7
think: "Team lacks DevOps capacity for microservices" → type: evidence, confidence: 0.8
evaluate: { nodeId: "last", critique: true }
→ { status: "ok", confidence: 0.73, nextSuggested: { tool: "metacog" } }
辩证推理
think: {
strategy: "dialectic",
dialectic: {
thesis: "Microservices improve scalability",
antithesis: "But add operational complexity",
synthesis: "Use modular monolith as middle ground"
},
confidence: 0.75
}
使用节点别名
evaluate({ nodeId: "last" }) → evaluate latest thought
simulate_devils_advocate({ nodeId: "best", depth: 3 }) → challenge strongest thought
graph({ action: "path", nodeId: "root", targetId: "best" }) → trace reasoning path
think({ parentId: "root", content: "Alternative..." }) → branch from root
会话保存与恢复
// Work on a problem...
think({ content: "Analysis...", strategy: "auto" })
think({ content: "Another insight..." })
// Save before closing
reset({ save: true, saveName: "architecture-review" })
// ... MCP restarts ...
// Resume exactly where you left off
reset({ resume: "architecture-review" })
→ { status: "ok", summary: "architecture-review oturumu geri yüklendi — 5 node ile devam ediliyor" }
第一性原理推理
think: {
strategy: "first_principles",
firstPrinciples: {
problem: "How to improve battery efficiency?",
assumptions: ["Batteries must use lithium", "Charging takes hours"],
depth: 3,
domain: "physics"
}
}
→ Creates: Problem → Assumptions Challenged → Fundamental Truths → Reconstructed Solution
反事实(假设情景)分析
think: {
strategy: "counterfactual",
counterfactual: {
currentState: "Office-based work with 5-day commute",
variablesToChange: [
{ variable: "work_location", currentValue: "office", hypotheticalValue: "remote", impactWeight: 0.9 },
{ variable: "commute_days", currentValue: 5, hypotheticalValue: 0, impactWeight: 0.8 }
],
timeHorizon: "medium_term",
rippleDepth: 3
}
}
→ Creates: Baseline → Variable Changes → Stage 1/2/3 Ripple Effects → Scenarios → Risk Analysis
系统思维
think: {
strategy: "systems_thinking",
systemsThinking: {
systemDescription: "Software development team dynamics",
components: [
{ name: "FeatureBacklog", type: "stock", description: "Pending work" },
{ name: "DeveloperCapacity", type: "stock", description: "Available developers" },
{ name: "CodeReviews", type: "flow", description: "Review process" },
{ name: "Quality", type: "converter", description: "Quality gates" }
],
focusArea: "feedback_loops"
}
}
→ Creates: System Overview → Components → Feedback Loops → Leverage Points → Recommendations
MCTS(蒙特卡洛树搜索)
think: {
strategy: "mcts",
mcts: {
problem: "Which architecture pattern to choose?",
possibleActions: [
{ id: "microservices", description: "Microservices architecture", estimatedReward: 0.7 },
{ id: "monolith", description: "Monolithic architecture", estimatedReward: 0.5 },
{ id: "modular", description: "Modular monolith", estimatedReward: 0.8 }
],
numSimulations: 100,
pruningThreshold: 0.2
}
}
→ Creates: Root → Actions → Simulations → Pruning Analysis → Optimal Path
总结分析
conclude({ detailLevel: "detailed" })
→ {
status: "ok",
summary: "12 dusunce, 3 dal, sequential+counterfactual stratejileriyle analiz tamamlandi",
data: {
conclusion: { primaryFinding: "...", confidence: 0.85 },
actionItems: [{ action: "Investigate...", priority: "high" }, ...],
graphHealth: { totalThoughts: 12, avgConfidence: 0.72, recommendation: "Graf saglikli gorunuyor" }
},
nextSuggested: { tool: "reset", params: { save: true }, reason: "Analizi kaydetmeyi unutmayin" }
}
元认知指导
metacog: { action: "auto_update" }
→ Stuck detected + suggested action in nextSuggested
metacog: { action: "switch", strategy: "parallel", reason: "Break through impasse" }
→ Strategy switched + next step recommended
剪枝
prune: { action: "analyze" }
→ Dead Ends, Redundant Branches, Total prunable count
prune: { action: "prune" }
→ Nodes pruned + metacog updated + nextSuggested
获取帮助
help() → all tools, all categories, all workflows
help({ category: "core" }) → 7 core tools with quick-start examples
help({ category: "advanced" }) → 9 advanced tools
help({ category: "workflow" }) → 3 recommended workflows
友好的错误消息
验证失败时,你会看到易于理解的错误,而不是原始的 Zod 输出:
think({ confidence: 1.5 })
→ {
status: "error",
error: "VALIDATION_ERROR",
message: "\"confidence\" parametresinde hata: ...",
field: "confidence",
hint: "confidence 0 ile 1 arasında bir sayı olmalı. Örnek: confidence: 0.7"
}
evaluate({ nodeId: "nonexistent" })
→ {
status: "error",
error: "NODE_NOT_FOUND",
provided: "nonexistent",
hint: "Geçerli alias'lar: \"last\", \"best\", \"root\" veya graph aracıyla node ID alın"
}
架构
src/
├── index.ts MCP server & 17 tool handlers
├── test.ts Core functionality tests (118 tests)
├── test_enhanced_strategies.ts Strategy tests (13 tests)
├── core/
│ ├── types.ts Type definitions, MCPResponse, NextAction
│ ├── schemas.ts Zod validation schemas (10 strategies incl. auto)
│ ├── node.ts ThoughtNode CRUD operations
│ ├── graph.ts DAG-based thought graph + resolveNodeId + aliases
│ ├── strategies.ts 10 reasoning strategies + selectStrategy (auto)
│ ├── scorer.ts Confidence scoring & self-critique
│ ├── metacog.ts Metacognitive engine with smart triggers
│ ├── knowledge.ts Knowledge integration & validation
│ ├── pruner.ts Dead-end/redundancy detection & pruning
│ ├── session.ts Session persistence (save/load/resume)
│ └── errors.ts Friendly error formatting (Zod + unknown)
└── enhancements/
├── visualization.ts SVG & ASCII graph visualization
├── devils_advocate.ts Counterargument generation
├── cross_disciplinary.ts Cross-domain analogy engine
├── temporal_projection.ts Future/past thought projection
├── ethical_evaluation.ts 4 ethical frameworks
├── emotional_intelligence.ts Emotion & sentiment analysis
├── explanation.ts Decision explainability
└── social_impact.ts Stakeholder & social impact
v3.0.0 新功能
| 功能 | 描述 |
|---|---|
| 节点别名 | 所有 nodeId 参数均可使用 "last"、"best"、"root" 代替节点 ID |
| MCPResponse | 结构化 JSON 响应,包含 status、summary、confidence、nextSuggested |
| 会话持久化 | 自动保存至 ~/.deep-thinker/sessions/,并可在重启后恢复 |
| 友好的错误消息 | 将 Zod 错误转换为易于理解的提示,并提供针对字段的指引 |
| help 工具 | 提供 3 类工具发现功能和工作流示例 |
| conclude 工具 | 生成图表摘要,包含 primaryFinding、actionItems、graphHealth |
| strategy: auto | 根据内容关键词和图状态自动选择策略 |
与 sequential-thinking 的比较
| 特性 | sequential-thinking | deep-thinker |
|---|---|---|
| 思考结构 | 线性链 | DAG(分支/合并/交叉边) |
| 策略 | 仅顺序策略 | 10 种策略(包括自动选择) |
| Schema 验证 | 无 | 所有策略均使用 Zod schema |
| 置信度 | 基本的思考编号 | 多因素评分与趋势分析 |
| 自我批判 | 无 | 自动执行,并设有严重级别 |
| 元认知 | 无 | 卡住检测、智能策略触发、自动切换 |
| 知识 | 无 | 外部参考、缺口检测、一致性验证 |
| 剪枝 | 无 | 死路、冗余、路径优化 |
| 图查询 | 线性回顾 | 可视化、最佳路径、分支分析、统计 |
| 节点引用 | 仅按 ID 引用 | 别名:last、best、root |
| 响应格式 | 纯文本 | 结构化 MCPResponse,包含 nextSuggested |
| 会话持久化 | 无 | 自动保存、保存/加载/恢复 |
| 错误消息 | 原始错误 | 易于理解,并提供提示 |
| 工具发现 | 无 | 带分类和工作流的 help 工具 |
| 结论 | 手动回顾 | 带有 actionItems 的 conclude 工具 |
| 策略选择 | 仅手动选择 | 根据内容自动选择策略 |
开发
git clone https://github.com/hubinoretros/deep-thinker.git
cd deep-thinker
npm install
npm run build
npm start
测试
npm run build
npm test
131 项测试覆盖所有模块:Node、Graph、10 种策略(包括自动策略)、Scorer、Metacog、Knowledge、Pruner、集成测试、边缘情况和 Schema 验证。
文档
贡献
请参阅 CONTRIBUTING.md 了解指南。欢迎提交 PR,尤其是新的推理策略和 MCP 工具创意。
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。