### [ai-hedge-fund:让19位投资大师的AI Agent帮你分析股票,45K+Stars开源AI对冲基金模拟](https://www.willai.cc/article/3249) **Published:** 2026-07-04T12:04:14 **Author:** hiyoho **Excerpt:** 🤖 ai-hedge-fund:让 19 位投资大师的 AI Agent 帮你分析股票 开源 AI 对冲基金团队模拟,用多智能体协作探索量化投资 MIT 开源 45K+ Stars Python 多智能体 📌 项目简介 ai-hedge-f .ai-article { max-width: 800px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.8; color: #333; } .ai-article h2 { color: #1a1a1a; border-bottom: 3px solid #00d68f; padding-bottom: 8px; margin-top: 40px; } .ai-article h3 { color: #00d68f; margin-top: 30px; } .ai-article .hero { background: linear-gradient(135deg, #0a0e27 0%, #1a2332 100%); color: white; padding: 40px; border-radius: 12px; margin: 30px 0; text-align: center; } .ai-article .hero h1 { color: white; margin: 0 0 15px 0; font-size: 28px; } .ai-article .hero .subtitle { color: #00d68f; font-size: 18px; margin-bottom: 20px; } .ai-article .badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 14px; margin: 5px; } .ai-article .badge-green { background: #00d68f; color: #0a0e27; font-weight: bold; } .ai-article .badge-dark { background: #1a2332; color: #00d68f; border: 1px solid #00d68f; } .ai-article .feature-box { background: #f0faf5; border-left: 4px solid #00d68f; padding: 20px; margin: 20px 0; border-radius: 0 8px 8px 0; } .ai-article .agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; } .ai-article .agent-card { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px; } .ai-article .agent-card .name { font-weight: bold; color: #1a1a1a; margin-bottom: 4px; } .ai-article .agent-card .style { font-size: 13px; color: #666; } .ai-article code { background: #f0f0f0; padding: 2px 8px; border-radius: 4px; font-family: monospace; } .ai-article pre { background: #0a0e27; color: #00d68f; padding: 20px; border-radius: 8px; overflow-x: auto; font-family: monospace; font-size: 14px; } .ai-article .warning { background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; border-radius: 0 8px 8px 0; margin: 20px 0; } .ai-article .tip { background: #d1ecf1; border-left: 4px solid #17a2b8; padding: 15px; border-radius: 0 8px 8px 0; margin: 20px 0; } .ai-article .use-case { background: white; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin: 15px 0; } .ai-article .use-case h4 { color: #00d68f; margin-top: 0; } # 🤖 ai-hedge-fund:让 19 位投资大师的 AI Agent 帮你分析股票 开源 AI 对冲基金团队模拟,用多智能体协作探索量化投资 MIT 开源 45K+ Stars Python 多智能体 ## 📌 项目简介 **ai-hedge-fund** 是一个 AI 驱动的对冲基金概念验证项目,由 Virat Singh(virattt)开发。 项目的核心创意令人拍案:**把华尔街最顶尖的 13 位投资大师「人格」训练成 AI Agent**,再配上 6 个专业分析 Agent,共同组成一个虚拟对冲基金团队,对指定股票进行多维度分析和决策模拟。 **⚠️ 重要声明:**本项目仅用于教育和研究目的,不应用于实际交易或投资,也不提供任何投资建议。 ## 🖼️ 项目架构示意图 ![ai-hedge-fund Logo](https://github.com/virattt/ai-hedge-fund/raw/main/logo.png) ai-hedge-fund 项目 Logo(如无法显示请访问 GitHub 仓库) ## ⚙️ 安装要求和过程 ### 环境要求 - **Python 3.10+** - **Poetry**(依赖管理工具) - 至少一个 LLM 的 API 密钥(OpenAI / Groq / Anthropic / DeepSeek 等) - 金融数据 API 密钥(FINANCIAL\_DATASETS\_API\_KEY) ### 快速安装步骤 **1\. 克隆仓库** git clone https://github.com/virattt/ai-hedge-fund.git cd ai-hedge-fund **2\. 安装 Poetry(如未安装)** curl -sSL https://install.python-poetry.org | python3 - **3\. 配置 API 密钥** cp .env.example .env # 编辑 .env 文件,填入你的 API 密钥 在 `.env` 中至少配置一个 LLM 提供商密钥: \# 选择以下至少一个 OPENAI\_API\_KEY=your\_key\_here GROQ\_API\_KEY=your\_key\_here ANTHROPIC\_API\_KEY=your\_key\_here DEEPSEEK\_API\_KEY=your\_key\_here # 金融数据 API 密钥(必需) FINANCIAL\_DATASETS\_API\_KEY=your\_key\_here **4\. 安装依赖** poetry install **5\. 运行** \# CLI 模式 - 分析 AAPL, MSFT, NVDA poetry run python src/main.py --ticker AAPL,MSFT,NVDA # Web 界面模式 cd app && poetry run chainlit run app.py **💡 国内用户提示:**可以使用 DeepSeek API 替代 OpenAI,成本更低。只需在 `.env` 中配置 `DEEPSEEK_API_KEY` 并修改模型配置即可。 ## 🌟 核心功能 ### 1\. 13 位投资大师 AI Agent Warren Buffett 奥马哈先知 · 价值投资 Charlie Munger 只买价格合理的优质企业 Cathie Wood 成长投资女王 · 颠覆性创新 Michael Burry 大空头 · 逆向深度价值 Ben Graham 价值投资之父 · 安全边际 Peter Lynch 十倍股猎手 · 日常业务投资 Stanley Druckenmiller 宏观传奇 · 非对称机会 Nassim Taleb 黑天鹅 · 反脆弱性 Bill Ackman 激进投资 · 推动变革 Phil Fisher 深度闲聊法调研 Mohnish Pabrai Dhandho · 低风险高回报 Aswath Damodaran 估值权威 · 叙事与数据 ### 2\. 6 个专业分析 Agent - **Valuation Agent**:计算股票内在价值,生成买卖信号 - **Sentiment Agent**:分析市场情绪(新闻、社交媒{“”}体) - **Fundamentals Agent**:分析财务数据(P/E、P/B、ROE 等) - **Technicals Agent**:分析技术指标(MA、RSI、MACD 等) - **Risk Manager**:计算风险指标,设置仓位限制 - **Portfolio Manager**:综合所有意见,做出最终交易决策 ### 3\. 双运行模式 - **CLI 模式**:适合自动化脚本和批量分析 - **Web UI**:基于 Chainlit 的可视化界面,交互更友好 - **回测模式**:支持对历史数据进行策略回测 - **Ollama 支持**:可使用本地 LLM,无需云端 API ### 4\. 可扩展架构 - 项目正在重构为「持久化、全天候运行的 AI 对冲基金」 - 投资者 Agent 将重构为可插拔、可回测的「Alpha 模型」 - 支持自定义 Agent,添加你自己的投资哲学 - 完整的愿景文档和路线图(VISION.md / ROADMAP.md) ## 📱 典型使用场景 #### 场景一:学习投资大师的决策逻辑 运行 `poetry run python src/main.py --ticker AAPL`,系统会让 13 位投资大师 Agent 分别分析苹果公司,每位大师会从自己的投资哲学出发给出建议。通过对比不同大师的意见,你可以学习到: - 价值投资者(Buffett/Munger)关注企业质量和估值 - 成长投资者(Cathie Wood)关注创新和市场空间 - 逆向投资者(Michael Burry)关注被市场忽视的风险和机会 - 宏观投资者(Druckenmiller)关注宏观经济周期和趋势 #### 场景二:策略回测与验证 使用回测功能验证投资策略的历史表现: poetry run python src/backtester.py --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-12-31 回测结果会显示: - 各 Agent 的决策准确率 - 模拟投资组合的收益率 - 最大回撤和风险指标 - 不同市场环境下的表现对比 #### 场景三:作为 LLM 多智能体协作的学习案例 如果你是研究 AI Agent 的开发者,这个项目是学习多智能体协作的绝佳案例: - 每个 Agent 有独立的 System Prompt 定义投资哲学 - Agent 之间通过标准化的信号格式通信 - Portfolio Manager 作为「总经理」汇总决策 - 完整的 Python 实现,代码结构清晰易懂 ## 💡 推荐理由 **为什么推荐这个项目?** **1\. 创意独特,执行到位** 把投资大师人格化身为 AI Agent 这个点子本身就很有趣,而项目的执行也相当到位——每位大师的 System Prompt 都经过精心设计,体现了其真实的投资哲学。 **2\. 教育价值极高** 无论你是投资初学者还是 AI 开发者,都能从这个项目中学到东西。投资者可以了解不同投资风格的差异;AI 开发者可以学习多智能体系统的设计模式。 **3\. 代码质量不错** 项目结构清晰,Agent 定义、信号处理、决策流程都有明确的模块化设计。想要添加自己的 Agent 也非常简单。 **4\. 活跃的社区** 项目在 GitHub 上获得了大量关注,社区提出了很多有趣的改进建议(比如添加更多投资大师、支持 A 股等),项目正在积极迭代中。 **5\. 引发思考** 这个项目最有价值的地方在于:它让我们思考 AI 在金融决策中的边界在哪里?投资是艺术还是科学?多智能体协作能否真的产生超越个体的智慧? **⚠️ 风险提示:**再次强调,本项目仅用于教育和研究目的。AI Agent 的分析结果不应作为真实投资的依据。投资有风险,决策需谨慎。 ## 🔗 下载地址 - **GitHub 仓库**:[github.com/virattt/ai-hedge-fund](https://github.com/virattt/ai-hedge-fund) - **项目愿景文档**:[VISION.md](https://github.com/virattt/ai-hedge-fund/blob/main/VISION.md) - **项目路线图**:[ROADMAP.md](https://github.com/virattt/ai-hedge-fund/blob/main/ROADMAP.md) - **License**:MIT License(自由使用、修改和分发) * * * _如果你觉得这个项目有意思,欢迎在 GitHub 上给它一个 ⭐️_ _更多 AI 开源项目介绍,请关注本栏目持续更新_ **Tags:** 1-bit LLM, AI, AI Agent, AI开源, AI开源项目, MIT许可, Python, 多智能体系统, 量化投资, 金融科技 **Categories:** 开源项目 ---