跳转到主内容

深度研究 ✨ 最新 ✨

随着人工智能社区最新的“深度研究”趋势,我们很高兴能实现我们自己的开源深度研究功能!隆重推出 GPT Researcher 的深度研究功能——一个先进的递归研究系统,它以前所未有的深度和广度探索主题。

每次深度研究大约需要 5 分钟完成,成本约为 0.4 美元(在“高”推理强度下使用 o3-mini 模型)。

工作原理

深度研究采用一种有趣的树状探索模式。

  1. 广度:在每一层,它会生成多个搜索查询,以探索您主题的不同方面。
  2. 深度:对于每个分支,它会递归地深入挖掘,跟踪线索并发现关联。
  3. 并发处理:利用 async/await 模式同时运行多个研究路径。
  4. 智能上下文管理:自动聚合和综合所有分支的研究发现。
  5. 进度跟踪:实时更新广度和深度维度的研究进展。

您可以把它想象成部署一个由 AI 研究员组成的团队,每个成员都遵循自己的研究路径,同时协作构建对您主题的全面理解。

流程

Logo

快速入门

from gpt_researcher import GPTResearcher
from gpt_researcher.utils.enum import ReportType, Tone
import asyncio

async def main():
# Initialize researcher with deep research type
researcher = GPTResearcher(
query="What are the latest developments in quantum computing?",
report_type="deep", # This triggers deep research modd
)

# Run research
research_data = await researcher.conduct_research()

# Generate report
report = await researcher.write_report()
print(report)

if __name__ == "__main__":
asyncio.run(main())

配置

深度研究的行为可以通过几个参数进行自定义。

  • deep_research_breadth:每一层的并行研究路径数量(默认值:4)。
  • deep_research_depth:探索的层级深度(默认值:2)。
  • deep_research_concurrency:最大并发研究操作数(默认值:4)。
  • total_words:生成报告的总字数(推荐值:2000)。

您可以通过多种方式配置这些参数。

  1. 环境变量:
export DEEP_RESEARCH_BREADTH=4
export DEEP_RESEARCH_DEPTH=2
export DEEP_RESEARCH_CONCURRENCY=4
export TOTAL_WORDS=2500
  1. 配置文件:
deep_research_breadth: 4
deep_research_depth: 2
deep_research_concurrency: 4
total_words: 2500
researcher = GPTResearcher(
query="your query",
report_type="deep",
config_path="path/to/config.yaml" # Configure deep research parameters here
)

进度跟踪

on_progress 回调函数提供研究过程的实时洞察。

class ResearchProgress:
current_depth: int # Current depth level
total_depth: int # Maximum depth to explore
current_breadth: int # Current number of parallel paths
total_breadth: int # Maximum breadth at each level
current_query: str # Currently processing query
completed_queries: int # Number of completed queries
total_queries: int # Total queries to process

错误处理

深度研究工作流被设计为具有弹性。

  • 失败的查询会被自动跳过。
  • 即使某些分支失败,研究仍会继续。
  • 进度跟踪有助于识别任何问题。

最佳实践

  1. 从宽泛开始:从一个笼统的查询开始,让系统探索具体细节。
  2. 监控进度:使用进度回调函数来了解研究流程。
  3. 调整参数:根据您的需求调整广度和深度。
    • 更大广度 = 更广覆盖面
    • 更深深度 = 更深刻洞见
  4. 资源管理:根据您的系统能力考虑并发限制。

局限性

  • 使用像 o3-mini 这样的推理型 LLM 模型。
  • 深度研究可能比标准研究花费更长时间。
  • 由于多个并发查询,API 使用量和成本会更高。
  • 可能需要更多系统资源用于并行处理。

研究愉快!🎉