银河大脑
想想。做,完成。
*顺序思维+顺序行动=完整的认知循环*
  
______________________________________________________________________
这是什么?
银河大脑 是一个结合了两个强大概念的MCP服务器:
- 顺序思维 (摘自Anthropic的MCP)-带有修订和分支的结构化推理
- 顺序执行 -在操作之间使用可变管道进行批处理执行
它们共同构成了一个完整的 认知回路思考问题,将想法转化为行动,执行,完成。
PROBLEM
│
▼
┌─────────────┐
│ THINK │ ← reason step by step
│ │ ← revise if wrong
│ │ ← branch to explore
└──────┬──────┘
│
▼
┌─────────────┐
│ BRIDGE │ ← convert thoughts to operations
└──────┬──────┘
│
▼
┌─────────────┐
│ DO │ ← execute sequentially
│ │ ← pipe results between ops
└──────┬──────┘
│
▼
DONE______________________________________________________________________
安装
快速安装(PowerShell)
git clone https://github.com/For-Sunny/galaxy-brain.git
cd galaxy-brain
.\scripts\install.ps1快速安装(Bash)
git clone https://github.com/For-Sunny/galaxy-brain.git
cd galaxy-brain
chmod +x scripts/install.sh
./scripts/install.sh手动安装
pip install galaxy-brain然后添加到您的Claude Desktop配置中(%APPDATA%\Claude\claude_desktop_config.json 在Windows上):
{
"mcpServers": {
"galaxy-brain": {
"command": "python",
"args": ["-m", "galaxy_brain.server"]
}
}
}______________________________________________________________________
用法
银河大脑运动: think_and_do
一个工具来统治他们:
think_and_do({
"problem": "I need to read a config file, parse it, and count the keys",
"thoughts": [
"First I need to read the config file",
"Then parse it as JSON",
"Finally count the number of keys"
],
"operations": [
{
"service": "file",
"method": "read",
"params": { "path": "config.json" }
},
{
"service": "transform",
"method": "json_parse",
"params": { "content": "$results[0].result.content" }
},
{
"service": "python",
"method": "eval",
"params": { "expression": "len($results[1].result)" }
}
]
})看到了吗 $results[0].result.content?那是 可变管道 -每个操作都可以参考之前操作的结果。
______________________________________________________________________
思维工具
开始一个思考环节,逐步推理:
# Start thinking
start_thinking({
"problem": "How should I refactor this authentication system?",
"initial_estimate": 5
})
# Returns: { "session_id": "think_abc123..." }
# Add thoughts
think({
"session_id": "think_abc123...",
"thought": "The current system uses session cookies...",
"confidence": 0.8
})
# Realize you were wrong? Revise!
revise({
"session_id": "think_abc123...",
"revises_thought": 2,
"revised_content": "Actually, we should use JWTs because...",
"reason": "Stateless is better for our scale"
})
# Want to explore an alternative? Branch!
branch({
"session_id": "think_abc123...",
"branch_from": 3,
"branch_name": "oauth_approach",
"first_thought": "What if we used OAuth2 instead?"
})
# Done thinking
conclude({
"session_id": "think_abc123...",
"conclusion": "We should migrate to JWT with refresh tokens",
"confidence": 0.9
})______________________________________________________________________
做工具
使用可变管道执行操作:
execute_batch({
"batch_name": "process_data",
"operations": [
{
"service": "shell",
"method": "run",
"params": { "command": "curl -s https://api.example.com/data" }
},
{
"service": "transform",
"method": "json_parse",
"params": { "content": "$results[0].result.stdout" }
},
{
"service": "file",
"method": "write",
"params": {
"path": "output.json",
"content": "$results[1].result"
}
}
]
})可用服务
| 服务 | 方法 | 描述 |
|---|---|---|
python | execute, eval | 运行Python代码或计算表达式 |
shell | run | 执行shell命令 |
file | read, write, exists | 文件操作 |
transform | json_parse, json_stringify, extract, template | 数据转换 |
______________________________________________________________________
桥接工具
将思考环节转化为行动计划:
# Generate plan from concluded session
generate_plan({
"session_id": "think_abc123..."
})
# Execute the generated plan
execute_plan({
"plan_id": "plan_xyz789..."
})______________________________________________________________________
可变管道语法
参考之前的结果 $results[N].path.to.value:
$results[0] # Full result of operation 0
$results[0].result # The result field
$results[0].result.content # Nested access
$results[1].result.data[0] # Array access (in path format)变量在执行每个操作之前都会被解析,因此您可以构建管道:
operations = [
# Op 0: Read a file
{ "service": "file", "method": "read", "params": { "path": "input.txt" } },
# Op 1: Use content from op 0
{ "service": "python", "method": "execute",
"params": { "code": "print(len('$results[0].result.content'))" } },
# Op 2: Use stdout from op 1
{ "service": "file", "method": "write",
"params": { "path": "count.txt", "content": "$results[1].result.stdout" } }
]______________________________________________________________________
配置
创建 galaxy-brain.json 在您的工作目录中:
{
"thinking": {
"max_thoughts": 50,
"max_branches": 10,
"max_revisions_per_thought": 5
},
"doing": {
"max_operations": 50,
"default_timeout": 30,
"max_timeout": 300,
"stop_on_error": true
},
"bridge": {
"auto_execute": false,
"validate_before_execute": true
},
"log_level": "INFO"
}或者使用环境变量:
GALAXY_BRAIN_LOG_LEVELGALAXY_BRAIN_MAX_THOUGHTSGALAXY_BRAIN_MAX_OPERATIONS
______________________________________________________________________
为什么是“银河大脑”?
因为当你将结构化思维与链式执行相结合时,你就在另一个层面上运作。
想想。做,完成。大脑能量大,宇宙效率高。
______________________________________________________________________
学分
- 顺序思维:基于 @模型上下文协议/服务器顺序思维 (麻省理工学院许可)
______________________________________________________________________
许可证
麻省理工学院许可证-随心所欲。
______________________________________________________________________
想想。做,完成。
______________________________________________________________________
由...建造 CIPS公司
网站 | 商店 | | glass@cipscorps.io
AI系统的企业内存基础设施: CASCADE Enterprise、PyTorch Memory、Hebbian Mind和完整的CIPS堆栈.
版权所有(c)2025-2026 c.I.P.S.有限责任公司
