Skip to content

feat: hy3-research — 深度研究助手,由 Hy3 驱动#143

Open
ilovecplusplus230 wants to merge 5 commits into
Tencent-Hunyuan:rhinobird2026from
ilovecplusplus230:issue4
Open

feat: hy3-research — 深度研究助手,由 Hy3 驱动#143
ilovecplusplus230 wants to merge 5 commits into
Tencent-Hunyuan:rhinobird2026from
ilovecplusplus230:issue4

Conversation

@ilovecplusplus230

Copy link
Copy Markdown

hy3-research

深度研究助手 — 输入一个主题,自动完成 Plan → Search → Fetch → Synthesize → Report 全流程,由 Hy3 大模型驱动

零外部依赖(仅 Python 标准库 + 少量 pip 包),支持 OpenAI 兼容的 Hy3 API,内置 mock 离线模式,开箱即可演示。


✨ 它能做什么

  • 自动研究规划:给定一个主题,Hy3 自动拆分为 3-6 个子主题,生成搜索策略和报告大纲。
  • 并行搜索抓取:Tavily + DuckDuckGo 双引擎搜索,并行抓取源内容。
  • 结构化综合:每个子主题独立综合,保留引用标注 [1][2]。
  • 长文报告生成:一键生成带摘要、正文、结论、引用列表的完整 Markdown 报告。
  • Web 交互查看:内置 HTTP 服务器,浏览器查看报告(暗色/亮色主题、引用 tooltip)。
  • 交互 + 自动双模式:CLI 分步交互确认,或 --auto 一键到底。

🧩 Hy3 在系统中承担的角色

  • Hy3 负责「理解 + 生成 + 综合」:拆分研究计划、综合多源材料、撰写结构化报告。
  • 本地代码负责「搜索 + 编排 + 渲染」:Tavily/DDG 搜索、URL 抓取、并行调度、Web 报告展示。

即使在无 key 的 mock 模式下,整体交互链路也完全可跑通。


🎬 两个端到端 Demo

Demo 1 — 浅度研究
python -m hy3research --auto "Kubernetes vs Serverless 2026年企业选型对比"
→ Plan: 3 subtopics → Search: ~20 sources → Synthesize: 3 concurrent Hy3 calls → Report

Demo 2 — 深度研究
python -m hy3research --auto "Transformer架构的替代方案最新进展"
→ Plan: 5 subtopics → Search: ~30 sources → Synthesize: 5 concurrent Hy3 calls → 深度综述

Demo 视频见 issue4/demo/ 目录(≤2min / 个)


🤝 与 CodeBuddy / WorkBuddy 的协作记录

  • hy3research/client.py:Hy3 OpenAI 兼容客户端、重试逻辑与 mock 模式(CodeBuddy 骨架 + WorkBuddy 推理模型兼容)
  • hy3research/planner.py:研究计划生成、JSON 解析与容错(WorkBuddy 设计 prompt 结构)
  • hy3research/searcher.py:Tavily + DDG 双引擎搜索(复用 issue3 逻辑,WorkBuddy 适配)
  • hy3research/reporter.py:长文报告生成 prompt 设计(WorkBuddy 撰写)
  • hy3research/__main__.py:CLI 编排逻辑(WorkBuddy 搭建骨架)
  • templates/report.html:Web 报告模板(WorkBuddy 设计暗色/亮色主题)
  • README.mddemo/ 目录(WorkBuddy 撰写)

其余配置、测试与调试由作者完成。


📦 项目结构

issue4/
├── hy3research/
│ ├── init.py # 版本信息
│ ├── main.py # CLI 入口 (argparse)
│ ├── config.py # 配置 / .env 加载
│ ├── client.py # Hy3 客户端 (OpenAI 兼容 + mock)
│ ├── planner.py # 研究计划生成 (Hy3)
│ ├── searcher.py # Tavily + DDG 后备搜索
│ ├── fetcher.py # URL 内容抓取
│ ├── synthesizer.py # 源材料 → Hy3 综合
│ ├── reporter.py # 长文报告 + 引用生成
│ ├── server.py # HTTP 静态文件服务
│ └── ui.py # 终端渲染
├── templates/report.html # 报告 Web 模板
├── tests/ # 单元测试
├── demo/ # 演示脚本 + 视频
└── README.md


🔒 安全说明

  • API Key 仅通过环境变量 / .env 提供,.env 已被 git 忽略。
  • Mock 模式不发起任何网络请求。

xhx1022 and others added 5 commits July 15, 2026 15:22
Update README files to include dataset preparation instructions and clarify key parameters for Hy3 reinforcement learning training.

Enhance README files with acknowledgements for support from Tencent Hunyuan team and relevant communities.

Fix typo in README by changing "Posttraining" to "Post-training" for consistency and clarity.

Fix RL Post-training TOC anchor in README
- quickstart.md: API basics, curl/Python examples, parameter guide, troubleshooting
- 6 runnable examples under issue1/examples/:
  basic_chat, streaming, latency_compare, tool_calling, reasoning_mode, retry
- each example includes .py (runnable) and .md (documentation)
- uses TokenHub OpenAI-compatible API (hy3-preview)
- .gitignore updated to exclude .env files
- api_demo.py: standalone API demo under project root
- Plan → Search → Fetch → Synthesize → Report full pipeline
- Dual search engine (Tavily + DuckDuckGo)
- Interactive CLI + auto mode + Web report viewer
- Mock offline mode for demo without API key
- Hy3-driven: planning, synthesis, report generation via chat/completions API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants