InvestBrain
InvestBrain — 投资第二大脑
有经验投资者的纪律自主工具,解决"知行合一"问题 不是投顾,不给建议,而是"镜子" + "纪律锚点"
5 分钟快速体验
两种使用方式:桌面客户端(推荐) 或 MCP Server。
方式 A:桌面客户端(Windows,推荐)
下载并安装
InvestBrain_0.1.2_x64_en-US.msi(见 Releases)打开桌面应用,即见「大脑已加载」状态条与试聊引导
想对话时在设置页填入自己的 LLM Key,即可走真实对话链路
桌面端数据存储在
%APPDATA%\InvestBrain\data,设置页可直接查看数据位置。
方式 B:MCP Server(任意 MCP 客户端)
# 1. 安装 MCP Server 依赖
cd src/mcp_server && pip install -r requirements.txt
# 2. 配置你自己的 LLM API Key(见下文「你的 Key,自己填」)
cp .env.example .env
# 编辑 .env,把 DEEPSEEK_API_KEY 填成你从 DEEPSEEK 后台拿到的 key
# 3. 启动 MCP Server
python server.py首次启动提示:向量库(Chroma + ONNX Embedding)首次会下载约 80MB 模型文件。若希望跳过向量库、纯工具调用体验,可保持
server.py中相关注释不变;如需完整 RAG 体验,下载后取消server.py内的注释行。
启动后 Server 会以 stdio 方式接受 MCP 客户端调用。配置 Claude Desktop 见下方 Claude Desktop 接入。
Related MCP server: nautilus-compass
你的 Key,自己填
重要:本仓库不预置任何用户的 API key。data/config/llm.json 中 api_key 默认为 null(不是真的 key 占位);.env.example 只是模板;webhook.json 是空 schema。
你需要从下面这些官方后台自己申请 / rotate:
服务 | 用途 | 后台地址 |
DeepSeek API | 主力 LLM(必需) | https://platform.deepseek.com → API Keys |
Tushare Pro | A 股财务/历史数据(可选) | |
DashScope | 阿里通义备选 LLM(可选) | |
Against Finance | 另类数据(可选) | |
飞书机器人 | 通知(可选) | https://open.feishu.cn → 机器人 → Webhook |
4 个 key 都写在哪里(都不会进 git)
MCP 启动必须:
DEEPSEEK_API_KEY环境变量(推荐 User 级系统环境变量,或 CLAUDE.md /.env)可选:
TUSHARE_TOKEN/DASHSCOPE_API_KEY/AGAINST_API_KEY(环境变量)飞书 webhook:
data/config/webhook.json里的feishu字段(已被.gitignore保护)
安全规则
你的 key 是你的——不要 share、不要 commit、不要发到任何对话里
key 进 git 历史(如被 commit 过的老版本)即使后来 rotate 仍可能被人滥用 → 发现泄露立即去对应平台 rotate
仓库已有
.gitignore保护data/config/*.json(含 llm/webhook 配置)+data/memory/*.db(用户记忆库,按 CLAUDE.md 决策"用户数据本地存储,不上传云端"),不要!取消忽略
备注:仓库历史曾 commit 过密钥占位(commit
22e6c72),如已 push 远端,老 key 在 clone 历史里仍可被读——清历史成本高、通常接受 + rotate 即可
快速开始:推送配置
从零到收到第一条微信推送,约 3 分钟。无需阅读任何文档。
方式一:一键脚本(推荐,Windows)
在仓库根目录打开 PowerShell,运行:
powershell -ExecutionPolicy Bypass -File scripts/configure_pushplus.ps1脚本会交互式引导你完成全部步骤:显示 PushPlus 获取 token 的操作步骤 → 粘贴 token(自动校验格式)→ 写入 data/config/webhook.json 并启用 pushplus 渠道 → 自动调用 send_notification 发送测试消息 → 打印成功/失败原因。
方式二:对话内配置(MCP 客户端内)
直接在任意 MCP 客户端中让 AI 帮你配置:
1. 查看当前配置状态:notify_get_notifier_config()
2. 配置 PushPlus 并发送测试:notify_configure_notifier(channel="pushplus", token="你的token", enabled=true, send_test=true)PushPlus token 获取步骤
微信扫码关注公众号:https://www.pushplus.plus
进入「个人中心」→ 复制页面上的 token
填入上述任一方式
验证成功:收到测试消息,或 notify_get_notifier_config() 返回 "enabled_channels": ["pushplus"]。未配置渠道时,提醒触发路径(price_checker / scheduler)返回中会携带 setup_guide 引导信息,而不会静默失败。
安全说明:
data/config/webhook.json已被.gitignore保护,token 不会进入 git;请勿把 token 发到任何对话或提交到仓库。
它解决什么问题
核心问题:投资者被叙事带着走,操作没纪律,事后后悔。
常见痛点 | InvestBrain 的应对 |
看到某只股票大涨就追高 | 强制记录买入理由 + 关联历史相似决策 |
跌了恐慌割肉 | 触发 RAG 检索大师对"恐慌"的看法 |
同一类错误反复犯 | 行为模式挖掘自动识别"追涨杀跌"模式 |
重要时间/价格点位忘记 | 价格/时间/条件监控 + 飞书推送 |
想不起自己过去的判断 | 记忆系统 + 决策卡片回溯 |
核心能力
功能 | 说明 |
想法记录 | 用户说一句话,AI 解析 + 关联历史 + 生成卡片 |
投资 RAG | 大师思想检索问答(16 位投资大师 × 5 个核心概念) |
记忆系统 | 用户画像、历史决策、行为模式挖掘 |
提醒触发 | 价格/时间/条件监控,支持飞书/钉钉/Bark 多通道推送 |
行为模式挖掘 | 自动发现投资者的偏差模式 |
示例对话
下面是三个核心价值场景的真实对话流(任意 MCP 客户端均可使用):
场景 1:RAG 问答 — 大师思想碰撞
用户:段永平怎么看"快钱"和"慢钱"?
调用:
rag_ask_investment(question="段永平怎么看快钱和慢钱")AI 返回: 段永平的核心观点是"快钱"看似机会多但风险敞口大,"慢钱"依靠复利与确定性。 在「段永平」语料中相关论述 12 条,节选:
"投资赚钱的速度不应该快过学习的速度。" "敢重仓的就是你能看懂的生意,剩下的不是机会。" 关联概念:能力圈、安全边际、复利。
场景 2:行为模式分析 — 找出反复犯的错
用户:我最近的交易有什么问题?
调用:
memory_get_behavior_patterns()AI 返回: 检测到你的两个行为模式(过去 30 天,11 笔交易):
追涨模式(置信度 0.83) 触发样本:买入 NVDA/TSLA 在单日涨幅 > 5% 后的 D+1/D+2,胜率 25%,平均收益 -3.2% 建议:买入前强制查看
rag_ask_investment(question="追高的代价")恐慌割肉模式(置信度 0.71) 触发样本:持仓亏损 > 15% 后的 5 日内卖出,后续 30 日反弹 67% 建议:触发时自动推送飞书提醒 + 大师原话引用
场景 3:智能提醒 — 纪律锚点
用户:NVDA 到 950 美元时提醒我重新评估。
调用:
reminder_set_reminder(condition={ticker:"NVDA", operator:"<=", threshold:950, action:"review"})AI 返回: 提醒已建立:NVDA <= 950 USD 时触发"复盘评估"。 触发后将自动拉取:当前价格、你对此票的历史决策卡片、相关大师语录。 提醒已同步通知通道(如已配置)。
Claude Desktop 接入
将 InvestBrain 接入 Claude Desktop(macOS / Windows 通用):
配置文件位置:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
配置内容(路径按你 clone 的实际位置修改):
{
"mcpServers": {
"investbrain": {
"command": "python",
"args": [
"D:/claudework/invest-brain/src/mcp_server/server.py"
],
"env": {
"DEEPSEEK_API_KEY": "sk-your-key-here"
}
}
}
}配置完成后重启 Claude Desktop,会在工具栏出现"投资助手"图标(39 个工具,与
server.json注册的工具清单一致)。
开源协议与路线图
本项目采用 GNU Affero General Public License v3.0 (AGPLv3) 授权。简言之:你可以自由使用、修改和分发,但通过网络提供服务的衍生作品也必须以相同协议开源。详见 LICENSE。
层级 | 功能 | 状态 |
免费层 | 本地 MCP Server | ✅ 已上线 |
16 位大师 RAG 问答 | ✅ 已上线 | |
行为模式检测 | ✅ 已上线 | |
提醒系统 | ✅ 已上线 | |
无限记忆存储 | ✅ 已上线 | |
个人版 | 云端周报/月报(AI 生成) | 计划中(¥39/月) |
跨设备数据同步 | 计划中 | |
团队版 | 团队协作与共享知识库 | 计划中(¥199/月) |
架构
src/mcp_server/ # MCP Server(39 个工具)
├── server.py # 主入口
├── tools/ # 工具集
│ ├── thought_tools.py # 想法记录
│ ├── rag_tools.py # 投资 RAG
│ ├── memory_tools.py # 记忆系统
│ ├── reminder_tools.py # 提醒系统
│ ├── pattern_tools.py # 行为模式
│ ├── report_tools.py # 周报/月报
│ ├── roundtable_tools.py # 大师圆桌
│ └── notifier_tools.py # 多通道通知
├── datasources/ # 数据源
│ ├── akshare_datasource.py
│ └── tushare_datasource.py
├── knowledge/ # 知识库
│ ├── vector_store.py # Chroma 向量存储
│ └── graph_client.py # 图存储
├── memory/ # 记忆存储
├── patterns/ # 行为模式挖掘
├── llm/ # LLM 客户端
│ ├── llm_router.py # 通用 LLM 路由
│ ├── providers.py # Provider 配置
│ └── deepseek_client.py
└── api_server.py # REST API (LLM 配置)
data/
├── graph/ # 知识图谱(16 位大师 + 概念)
├── knowledge/
│ └── vectors/ # 向量索引(Chroma)
├── memory/ # 用户记忆
├── cards/ # 想法卡片
├── reminders/ # 提醒条件
└── config/ # 配置文件MCP Tools(40 个)
// 想法记录(3)
"thought_record_thought(text)",
"thought_search_memories(query)",
"thought_get_thought_cards(ticker)",
// 投资 RAG(4)
"rag_ask_investment(question)",
"rag_get_master_view(master, topic)",
"rag_search_knowledge(query)",
"rag_search_reports(query, top_k)",
// 记忆系统(3)
"memory_get_user_profile()",
"memory_record_decision(data)",
"memory_get_behavior_patterns()",
// 提醒系统(3)
"reminder_set_reminder(condition)",
"reminder_get_reminders()",
"reminder_delete_reminder(id)",
// 行为模式(3)
"pattern_run_pattern_detection()",
"pattern_get_pattern_summary()",
"pattern_get_pattern_report(id)",
// 周报/月报(1)
"report_run_scheduled_report(range)",
// 大师圆桌(1)
"invest_roundtable(question)",
// 通知配置(2)
"notify_configure_notifier(channel, webhook_url)",
"notify_get_notifier_config()",
// 行情数据 — AKShare(5)
"market_get_stock_quote(ticker)",
"market_get_stock_history(ticker, period)",
"market_get_index_components(index_code)",
"market_get_valuation(ticker)",
"market_get_market_sentiment()",
// 行情数据 — Tushare(15)
"tushare_get_daily_price(ts_code)",
"tushare_get_weekly_price(ts_code)",
"tushare_get_realtime_quote(ts_code)",
"tushare_get_index_daily(index_code)",
"tushare_get_financial_indicator(ts_code)",
"tushare_get_income_statement(ts_code)",
"tushare_get_balance_sheet(ts_code)",
"tushare_get_cash_flow(ts_code)",
"tushare_get_index_components(index_code)",
"tushare_get_industry_classification(ts_code)",
"tushare_get_valuation_multi(ts_code)",
"tushare_get_market_top_movers()",
"tushare_get_stock_pledge_status(ts_code)",
"tushare_convert_ticker(ticker)",
"tushare_check_token_status()"完整工具列表见 src/mcp_server/tools/。
知识库
16 位投资大师: 巴菲特、芒格、段永平、霍华德·马克斯、李录、格雷厄姆、达莫达兰、阿克曼、凯西·伍德、迈克尔·伯里、帕伯莱、塔勒布、林奇、费雪、德鲁肯米勒
5 个核心概念: 护城河、安全边际、能力圈、第二层思维、非对称风险
行业知识: 28 个申万行业深度研究框架(向量库内检索,不公开原文,保护核心方法论 IP)
数据源
数据源 | 用途 | 状态 |
AKShare | 实时行情 | ✅ |
Tushare | 财务/历史数据 | ✅ |
Chroma | 向量索引 | ✅ |
SQLite | 本地记忆 | ✅ |
开发
# 启动 REST API Server(用于 LLM 配置)
python src/mcp_server/api_server.py
# 访问 http://localhost:8000/api/llm/config
# 启动前端(Next.js 落地页 + 设置面板)
npm install
npm run dev
# 访问 http://localhost:3000测试:
pytest tests/相关项目
项目 | 用途 |
入门陪伴产品(人格测试) | |
超级系统站(专业分析) |
🛠️ 推荐工具链
以下工具推荐基于 awesome-finai-tools-zn 的 SKILL.md 场景→工具映射表生成,每类场景精选 1 个最佳工具。完整工具清单请访问仓库主页。
推荐工具 | 功能 | 安装方式 |
ashare-mcp | 生产级 A 股 MCP Server,30 个 tool(实时行情/K线/涨停池/龙虎榜/财报/板块资金) |
|
opencli-eastmoney-quote | 零配置 CLI,A 股/港股/美股实时行情秒出结果 |
|
opencli-xueqiu-search | 雪球股票搜索 + 热门帖子舆情分析,中文/代码均可 |
|
Qlib | 微软 AI 量化框架,自动因子挖掘 + 模型训练 + 回测评估 |
|
盈米基金 MCP | 69 个标准化 MCP 工具 + 16 项技能组件,含组合回测/蒙特卡洛模拟 | 联系盈米 AI 开放平台获取 API Key |
工具推荐逻辑基于 awesome-finai-tools-zn/data/institution-skills.json,每周自动更新。
🔗 工具链联动
本仓库是 FinAI 工具生态的一部分,与其他仓库协作:
仓库 | 定位 | 与本仓库的关系 |
数据底座 | 提供工具清单+机构Skill数据 | |
工具推荐引擎 | 基于场景自动推荐工具 | |
人格化投顾 | 按投资人格匹配工具箱 | |
投顾流程工具包 | KYC→配置→组合→报告 | |
知识管理 | 收集→打标→存储→产出 |
🗺️ Roadmap
改造需求详细文档:docs/改造需求-roadmap.md
P0 核心改造(个人知识库愿景):
🔴 用户自定义 RAG 知识库(让用户自己的框架可被 RAG 引用)
🔴 新闻/事件触发 reminder(央行购金、地缘冲突、美债冻结等)
🔴 投资框架管理工具(结构化记录用户的框架规则与触发条件)
P1 数据源:
🟡 黄金现货 / 美元指数 / 美债收益率实时数据
🟡 黄金 ETF(518880 / GLD)数据修复
P2 体验优化:
🟢 思考卡 NLU 抽取 bug(数字/英文名误识别)
最近进展(2026-07-29):
✅ 黄金投资框架核心已写入思考卡(
thought_8)✅ 基于真实数据的黄金推演已写入思考卡(
thought_9)✅ 改造需求文档已建(
docs/改造需求-roadmap.md)
版本: v0.1.2 创建时间: 2026-06-24 许可: AGPL v3
Available Tools
64 toolsbroker_get_importsB
查看交割单导入历史(文件、券商、导入时间、成功/跳过行数)。
Args:
limit: 返回最近 N 次导入记录(默认 20,最大 200)
Returns:
{imports: [{id, broker, file_name, imported_rows, skipped_rows,
total_rows, first_date, last_date, created_at}...]}
Inputs: limit.
broker_get_trade_statsA
汇总已导入交易的统计指标(买卖笔数/股数/金额、费用、持仓标的数)。
Args:
start_date: 起始日期 YYYY-MM-DD(含)
end_date: 结束日期 YYYY-MM-DD(含)
broker: 券商标识筛选(默认全部)
Returns:
{buy: {...}, sell: {...}, total_trades, distinct_symbols, first_date, last_date}
Inputs: broker, end_date, start_date.
broker_import_statementA
导入券商交割单 CSV 文件,解析为标准化交易记录并入库(自动去重)。
Args:
file_path: 券商导出的交割单/对账单 CSV 文件绝对路径
broker: 券商标识,可选 htsc / citic / cms / gtja / generic;
默认 auto 自动按表头特征识别(无法确定时按 generic 处理)
Returns:
{
import_id, broker, file_name,
total_rows, imported_rows, duplicated_rows, skipped_rows,
first_date, last_date, warnings, hint
}
重复导入同一文件时返回 imported_rows=0 并提示已存在。
Inputs: file_path (required), broker.
broker_list_tradesA
查询已导入的标准化交易记录(默认时间倒序)。
Args:
start_date: 起始日期 YYYY-MM-DD(含)
end_date: 结束日期 YYYY-MM-DD(含)
symbol: 按证券代码模糊筛选(如 600519)
side: 买卖方向筛选,可选 buy / sell / other / unknown
broker: 券商标识筛选,可选 htsc / citic / cms / gtja / generic
limit: 返回条数上限(默认 200,最大 2000)
Returns:
{total: n, trades: [{id, trade_date, trade_time, side, symbol,
symbol_name, price, quantity, amount, fee,
net_amount, broker, contract_no}...]}
Inputs: side, limit, broker, symbol, +2 more.
broker_supported_formatsA
查看 InvestBrain 支持的券商交割单格式与标准字段映射。
用于导入前确认券商格式兼容性;返回各券商典型列名与标准化字段对照。
Returns:
{brokers: [{id, name, sample_columns}], standard_fields: {...}, note}
Inputs: no named parameters.
coaching_abandon_coachingB
放弃当前进行中的 Socratic 辅导会话并归档。
Args:
session_id: 要放弃的会话 ID
Returns:
dict: 包含 final_summary 的归档结果
Inputs: session_id (required).
coaching_coaching_compare_historyA
对比当前新事件与历史情景的变量结构异同。
从情景库中取出指定历史事件,用 LLM 对比分析:
- 相同点是什么
- 核心差异是什么
- 上次的教训是否适用于本次
Args:
event: 当前新事件的描述(如"美联储降息50bp")
scenario_id: 要对比的历史情景 ID(从 list_coaching_scenarios 获取)
Returns:
dict: {"status":"success", "comparison": "..."}
Inputs: event (required), scenario_id (required).
coaching_coaching_iterate_judgmentA
当用户判断错误后,更新投研规则中的变量优先级。
输入上次判断错误的变量和实际正确结果,
LLM 会分析并给出变量优先级调整建议——下次遇到类似结构,
哪个变量该调高、哪个该调低。
Args:
wrong_variable: 未按预期变化的变量(如"黄金与美元同涨")
correct_result: 实际发生的正确结果(如"黄金独立上涨,美元回落")
Returns:
dict: {"status":"success", "iteration": "..."}
Inputs: correct_result (required), wrong_variable (required).
coaching_coaching_suggest_thresholdsB
根据用户过去的交易记录,建议触发深度分析的数值阈值。
对于指定的资产类别(如"利率"、"汇率"、"商品"),
LLM 会分析多大的变动幅度应该触发深度分析,
给出具体数值阈值建议并说明理由。
Args:
asset_class: 资产类别,如"利率"、"汇率"、"商品"、"A股"、"美股"
Returns:
dict: {"status":"success", "suggestion": "..."}
Inputs: asset_class (required).
coaching_coaching_switch_to_simpleA
将进行中的 Socratic 多轮辅导会话切换到简单模式。
放弃剩余的问答题,直接用已有的分析上下文走一遍
10 步标准投研模板输出,并正常归档到情景库。
Args:
session_id: 由 start_coaching 返回的会话 ID
Returns:
dict: simple 模式结果,含 answer 和 scenario_id
Inputs: session_id (required).
coaching_continue_coachingA
继续一个进行中的 Socratic 多轮辅导会话。
回复选项字母 (A/B/C/D) 来推进对话,或输入
「直接说」切换到简单模式、「别问了」放弃本轮。
Args:
session_id: 由 start_coaching 返回的会话 ID
user_input: 用户对当前问题的回答(选项字母或指令文本)
Returns:
dict: 下一轮问题或最终结果
Inputs: session_id (required), user_input (required).
coaching_list_coaching_scenariosB
列出最近的学习辅导情景记录。
每次辅导结束(无论是简单模式还是复杂模式)都会自动归档到情景库,
包括触发事件、变量结构、因果链和最终结论。
Args:
limit: 返回的记录数量,默认 20
Returns:
dict: {"count": N, "scenarios": [...]}
Inputs: limit.
coaching_start_coachingA
启动学习辅导,分析投资问题。
自动判断问题是简单还是复杂:
- 简单问题(如"该不该买XX")→ 直接输出 10 步标准投研分析
- 复杂问题(如"为什么XX和YY走势背离")→ 启动 Socratic 多轮引导对话
Args:
user_input: 用户提出的投资问题(如"茅台2000块值得买吗")
mode: 强制模式,"simple" 或 "complex",留空则自动判断
Returns:
simple 模式: {"status":"success", "mode":"simple", "answer": "...", "scenario_id":"..."}
complex 模式: {"status":"success", "mode":"complex", "session_id":"...", "question":"...", "options":[...]}
Inputs: user_input (required), mode.
invest_invest_roundtableA
投资大师圆桌讨论。
自动语义匹配 3-5 位最相关的投资大师,模拟结构化深度对话。
每位大师独立调用 LLM 生成观点,主持人综合交锋并生成结构化纪要。
Args:
topic: 投资议题(如 "贵州茅台当前估值合理吗?")
Returns:
dict: 含 scene / masters / rounds / verdict 的结构化圆桌纪要
Inputs: topic (required).
market_get_index_componentsC
Get constituent stocks of an index (CSI300, etc).
Note: Simplified - returns basic info from Sina.
Args:
index_code: Index code (e.g., "000300" for CSI 300, "000001" for Shanghai)
Returns:
dict: Index name and current value
Inputs: index_code (required).
market_get_market_sentimentB
Get overall market sentiment indicators.
Returns Shanghai Composite as a proxy for market sentiment.
Returns:
dict: Index value, change %, sentiment reading
Inputs: no named parameters.
market_get_stock_historyA
Get historical K-line data for a stock.
Args:
ticker: Stock ticker symbol (e.g., "600519")
period: K-line period - "daily", "weekly", "monthly" (default: "daily")
Returns:
dict: OHLCV data with date, open, high, low, close, volume
Inputs: ticker (required), period.
market_get_stock_quoteB
Get real-time quote for a stock ticker.
Args:
ticker: Stock ticker symbol (e.g., "600519", "sh600519", "贵州茅台")
Returns:
dict: Current price, change %, volume
Inputs: ticker (required).
market_get_valuationB
Get valuation data for a stock.
Note: Sina provides limited fundamental data - returns price-based metrics.
Args:
ticker: Stock ticker symbol (e.g., "600519")
Returns:
dict: Price-based valuation info
Inputs: ticker (required).
memory_get_behavior_patternsB
Get identified behavior patterns from user's investment history.
Returns:
list: Behavior patterns like "tends to buy on price drops", "stops loss too early"
Inputs: no named parameters.
memory_get_user_profileB
Get user investment profile.
Returns:
dict: User profile including risk preference, circle of competence, investment principles
Inputs: no named parameters.
memory_record_decisionB
Record an investment decision made by the user.
Args:
data: Decision data including ticker, action (buy/sell/hold), price, reason, timestamp
Returns:
dict: Confirmation of recorded decision
Inputs: data (required).
notify_configure_notifierB
Configure a notification channel.
Args:
channel: Notification channel name. Supported: feishu, dingtalk, bark, pushplus
webhook_url: Webhook URL for webhook-based channels (feishu / dingtalk / bark)
token: PushPlus token (only used when channel="pushplus")
enabled: Whether to enable this channel (default True)
send_test: Whether to immediately send a test message (default False)
Returns:
dict: Current configuration status for all channels, plus test result if requested
Inputs: channel (required), token, enabled, send_test, +1 more.
notify_get_notifier_configA
Get the current notification configuration for all channels.
Returns:
dict: Configuration status for all channels, e.g.:
{"channels": {"feishu": {...}, "dingtalk": {...}, "bark": {...}, "pushplus": {...}}}
Inputs: no named parameters.
pattern_get_pattern_reportB
Generate a behavior pattern report in Markdown format.
Args:
period: Report period — "weekly" (default) or "monthly"
Returns:
dict: Report path and full Markdown content
Inputs: period.
pattern_get_pattern_summaryA
Get cumulative summary of all detected behavior patterns.
Returns:
dict: Pattern type -> {count, last_seen}, plus prompt_hint for
the agent to decide whether to proactively engage the user
Inputs: no named parameters.
pattern_run_pattern_detectionB
Run behavior pattern detection on all recorded decisions and thoughts.
Detects: 追高, 过早卖出, 情绪化交易, 原则违反.
Results are saved to the behavior_patterns table.
Returns:
dict: Detection results with count and pattern list
Inputs: no named parameters.
rag_ask_investmentB
Ask an investment question and get RAG-augmented answer.
Args:
question: Investment question (e.g., "什么是护城河?")
Returns:
dict: Answer with source citations from master knowledge base
Inputs: question (required).
rag_get_master_viewA
Get a specific master's view on a topic.
Args:
master: Master name (e.g., "巴菲特", "芒格", "段永平")
topic: Topic to query (e.g., "护城河", "安全边际")
Returns:
dict: Master's view on the topic with citations
Inputs: topic (required), master (required).
rag_rag_search_reportsB
搜索券商研报——基于语义向量检索。
返回最近入库的券商研报摘要,包含机构、股票、行业、评级、盈利预测等信息。
Args:
query: 搜索关键词(如"宁德时代 业绩"、"保险 增长"、"半导体")
top_k: 返回结果数量,默认5
Returns:
{
"query": str,
"count": int,
"results": [
{
"info_code": str,
"title": str,
"org_name": str,
"stock_name": str,
"stock_code": str,
"industry_name": str,
"rating": str,
"rating_change": str,
"publish_date": str,
"text": str,
"distance": float,
}
]
}
Inputs: query (required), top_k.
rag_search_knowledgeC
Search the investment knowledge base.
Args:
query: Search query (e.g., "价值投资", "周期")
Returns:
list: Matching knowledge entries
Inputs: query (required).
reminder_delete_reminderC
Delete a reminder by ID.
Args:
id: Reminder ID to delete
Returns:
dict: Deletion confirmation
Inputs: id (required).
reminder_get_remindersB
Get all active reminders.
Returns:
list: All active reminders
Inputs: no named parameters.
reminder_set_reminderA
Set a reminder with trigger condition.
Args:
condition: Reminder condition, e.g.:
- {"type": "price", "ticker": "贵州茅台", "operator": "below", "value": 1400}
- {"type": "time", "cron": "0 9 * * 5"} # Every Friday 9am
- {"type": "pe_ratio", "ticker": "贵州茅台", "operator": "below", "value": 20}
Returns:
dict: Created reminder with ID
Inputs: condition (required).
report_run_scheduled_reportA
Generate a behavior pattern report for this week or month.
Designed to be called on a schedule by the agent (e.g. every Sunday).
Args:
range: Report range — "week" (default) or "month"
Returns:
dict: Compact report with summary, insights, highlight, and report file path
Inputs: range.
thought_get_thought_cardsC
Get all thought cards for a specific ticker/symbol.
Args:
ticker: Stock ticker (e.g., "贵州茅台", "AAPL")
Returns:
list: All thought cards for this ticker
Inputs: ticker (required).
thought_record_thoughtB
Record an investment thought/idea from the user.
Args:
text: The raw thought text from user (e.g., "茅台跌到1400可以考虑买入")
Returns:
dict: A thought card with parsed entities and card ID
Inputs: text (required).
thought_search_memoriesB
Search user's historical thoughts and memories using semantic search.
Args:
query: Search query (e.g., "茅台", "上次关于苹果的想法")
Returns:
list: Matching thought cards, sorted by relevance
Inputs: query (required).
user_create_profileA
创建本地用户 profile。
首次使用前必须创建,用于留存/活跃度追踪的锚点。
Args:
nickname: 用户昵称
risk_profile: 风险偏好,可选 conservative / moderate / aggressive
investment_style: 投资风格,可选 value / growth / trend / mixed
experience_years: 投资经验年限
goals: 投资目标列表,如 ["长期复利", "跑赢沪深300"]
settings: 附加设置(JSON 对象),如 {"currency": "CNY", "notify_channel": "feishu"}
user_id: 用户 ID(默认 local 单用户)
Returns:
{created: true, profile: {...}}
Inputs: goals, user_id, nickname, settings, +3 more.
user_get_activity_statsA
获取用户活跃度统计(近 N 天)。
Args:
user_id: 用户 ID(默认 local)
days: 统计窗口天数,默认 30
Returns:
{exists, stats: {total, active_days, daily_avg, by_type, last_activity_at, active_date_list}}
Inputs: days, user_id.
user_get_profileB
读取本地用户 profile。
Args:
user_id: 用户 ID(默认 local)
Returns:
{exists: true/false, profile: {...}} — profile 含昵称/风险偏好/投资风格/
经验年限/目标/设置/创建与最近活跃时间
Inputs: user_id.
user_get_retentionB
获取用户留存摘要(首次/最近活跃、活跃天数、连续活跃天数、留存跨度)。
Args:
user_id: 用户 ID(默认 local)
Returns:
{exists, retention: {...}}
Inputs: user_id.
user_knowledge_addB
写入用户知识到知识库。
支持 4 类来源:framework(投资框架)、journal(交易日志)、
reading_notes(读书笔记)、insight(关键洞察,默认)。
Args:
title: 知识标题
content: 正文内容(将用于语义搜索的 embedding)
tags: 标签列表,如 ["framework:gold", "strategy:tactical"]
source_type: 来源类型,可选 framework / journal / reading_notes / insight
Returns:
{id, title, status: "added"}
Inputs: title (required), content (required), tags, source_type.
user_knowledge_deleteB
从知识库中删除指定知识条目。
Args:
id: 知识条目 ID(如 uk_1722000000)
Returns:
{id, status: "deleted"}
Inputs: id (required).
user_knowledge_listA
列出用户知识条目,可按来源类型或标签筛选。
Args:
source_type: 按来源类型过滤(framework / journal / reading_notes / insight)
tag: 按标签过滤(如 "framework:gold")
limit: 返回条目数量上限,默认 50
Returns:
{count, items: [{id, title, tags, source_type, created_at}, ...]}
Inputs: tag, limit, source_type.
user_knowledge_searchA
语义搜索用户知识库。
基于向量相似度检索最相关的用户知识条目。
Args:
query: 搜索查询文本
top_k: 返回结果数量,默认 5
Returns:
{query, results: [{id, title, snippet, tags, score, source_type, created_at}, ...]}
Inputs: query (required), top_k.
user_knowledge_updateA
更新已有用户知识条目。
只传需要修改的字段,未传的字段保持不变。
Args:
id: 知识条目 ID(如 uk_1722000000)
content: 新正文(可选)
title: 新标题(可选)
tags: 新标签列表(可选)
Returns:
{id, status: "updated", version}
Inputs: id (required), tags, title, content.
user_record_activityA
记录一次用户活跃事件(自动更新 last_active_at)。
供其他工具/Agent 在关键行为后调用,用于留存与活跃度统计。
Args:
activity_type: 事件类型,如 thought / decision / reminder / pattern / search / coaching / report
detail: 事件说明(可选,最多 500 字)
user_id: 用户 ID(默认 local)
Returns:
{recorded: true/false, activity_id}
Inputs: activity_type (required), detail, user_id.
user_update_profileB
更新本地用户 profile(只更新传入字段)。
Args:
nickname / risk_profile / investment_style / experience_years / goals / settings: 需更新的字段
user_id: 用户 ID(默认 local)
Returns:
{updated: true/false, profile: {...}}
Inputs: goals, user_id, nickname, settings, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 64 tools
There are multiple overlapping tool pairs across modules: market_get_stock_quote vs tushare_get_realtime_quote, market_get_stock_history vs tushare_get_daily_price/weekly_price, market_get_index_components vs tushare_get_index_components, and memory_get_user_profile vs user_get_profile. Agents could easily pick the wrong data source or profile tool because the boundaries are not clearly separated.
Most names use snake_case with a module prefix, which is generally readable. However, several names have redundant or awkward double prefixes such as coaching_coaching_switch_to_simple, rag_rag_search_reports, pattern_run_pattern_detection, and invest_invest_roundtable, making the convention less predictable.
At 64 tools, the surface is very heavy for an agent to navigate reliably. While InvestBrain is broad, the large number of overlapping market/Tushare and profile/memory tools makes the set feel excessive rather than tightly scoped.
The server covers a wide investment workflow: market data, fundamentals, broker imports, thoughts, memory, coaching, RAG, reminders, notifications, reports, and user knowledge/profile/activity. Minor gaps exist, such as no update/delete lifecycle for thoughts or decisions and no direct notification-send tool beyond configuration tests, but core workflows are well represented.
Maintenance
Related MCP Connectors
Investment research superagent: podcasts, SEC filings, and no-code research pipelines.
Pay-per-call trading intelligence for AI agents: live market regime, trading signals, composite conv
AI trading partner and trading journal: trades, reports, journaling, market data.
Trading discipline for AI agents: when to trade or sit in cash, on 650+ US stocks and ETFs
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAI-native productivity backend that gives your AI assistant persistent memory, pattern awareness, and computed intelligence about your work. 14 MCP tools for task management, daily planning, weekly review, and personal context.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to retain memory of past interactions and detect behavioral drift, preventing repeated mistakes without LLM token extraction.22 npm28 PyPI1,258MIT
- AlicenseAqualityBmaintenanceA vendor-agnostic cognitive persistence layer for AI agents. Eliminate the "repetition tax" by transporting your context, preferences, and history across sessions. Features an auto-adaptation engine that syncs global instructions to ensure operational cohesion and optimize token usage across any LLM or multi-agent workflow.386Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to persist and retrieve memories via a personal knowledge graph, with tools for emotional intelligence, CRM, life management, social features, self-training, and autonomous insights.584 npm7MIT