Skip to content

Findworth/openbb_agent

Repository files navigation

OpenBB Agent

OpenBB Terminal Pro 的 Copilot Agent,集成 OpenBB 金融数据、MCP 工具、Skills 机制与 CrewAI,为金融分析提供统一的 AI 助手能力。


一、为什么做这个项目?

用户需求

  • 数据源分散:用户在寻找金融数据时,需要熟悉不同数据提供商(FRED、IMF、BLS、各交易所等),逐一查阅 API 文档,学习不同调用方式
  • 接口不统一:各数据源返回格式各异,需要重复编写适配逻辑
  • AI 能力割裂:金融分析工具与 AI 助手分离,无法在对话中直接获取行情、图表、研报等
  • 扩展成本高:接入新数据源或新工具时,需要改代码、重新部署

功能设计

基于 OpenBB Platform 统一接口,将多数据源抽象为标准化 Widget,并整合 MCP、Skills、CrewAI 等扩展能力,用户只需在 OpenBB Terminal 中与 Copilot 对话即可完成数据查询、图表生成、多步骤分析,无需切换工具或编写代码。


二、项目功能

核心能力

功能 说明
OpenBB Widget 集成 调用 get_widget_data 获取 Dashboard 中 Widget 的数据,支持 primary/secondary 优先级
MCP 工具 通过 execute_agent_tool(server_id, tool_name, parameters) 调用 OpenBB 配置的 MCP 服务器工具
Skills 机制 workspace/skills 或内置 skills 目录加载 SKILL.md,支持 always 常驻与按需加载
CrewAI 支持 run_crewrun_flow,从 crews/flows/ 目录发现并执行
图表与表格 render_chartrender_tablerender_text 输出可视化结果
可选工具 Bash 执行、文件读写、gerp 正则搜索,通过 workspace_options 开关控制
记忆服务 基于 mem0 + ChromaDB,持久化对话事实,检索注入上下文
流式输出 SSE 推送推理步骤、工具调用、文本流

技术栈

  • Web 框架:FastAPI + SSE-Starlette
  • Agent 框架:magentic
  • LLM:OpenAI 兼容接口(如 DeepSeek、OpenAI)
  • 记忆:mem0、ChromaDB
  • 缓存:Redis(可选)
  • 多智能体:CrewAI

启动方式

pip install openbb-agent
openbb-agent

开发模式从源码安装:pip install -e .

服务默认监听 http://0.0.0.0:7777/agents.json 提供 OpenBB Terminal Pro 的 Widget 配置。


三、未来迭代计划

  • 完善 Skills 元数据
  • 优化记忆检索策略(token 窗口管理)
  • 更多crewai金融分析工作流
  • 多平台接入:参考 nanobot 的 Channel 架构,接入 Slack、Telegram、Discord、飞书等,使 Copilot 可在聊天应用中直接使用
  • 定时任务:支持 Cron 调度(如每日研报推送、行情提醒)
  • 可观测性:工具调用追踪、成本统计、审计日志

配置

  • 环境变量:参考 .env.example,配置 LLM、Redis、ChromaDB、mem0 等
  • 记忆作用域:memory_ids.json 中配置 user_idagent_idapp_id
  • 详细说明见 docs/CONFIG.mddocs/MEMORY.mddocs/CACHE.md

License

MIT

About

An AI assistant designed specifically for OpenBB, supporting multi-agent systems, RAG(mem0), MCP, tool calls, and other modern tools.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages