deepsearch-service

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

功能

Features

基于 LLM 的迭代式深度搜索服务,能够:
  1. 将复杂问题分解为多个子查询
  2. 迭代搜索收集多源信息
  3. 评估信息充分性,动态调整搜索策略
  4. 综合生成结构化分析报告
LLM-based iterative deep search service that can:
  1. Decompose complex problems into multiple sub-queries
  2. Iteratively search and collect multi-source information
  3. Evaluate information sufficiency and dynamically adjust search strategies
  4. Synthesize and generate structured analysis reports

适用场景

Application Scenarios

  • 复杂问题需要多角度分析
  • 需要综合多个来源的信息
  • 要求生成完整的研究报告
  • Complex problems requiring multi-angle analysis
  • Need to synthesize information from multiple sources
  • Require generating complete research reports

调用方式

Calling Method

python
from services.deepsearch_service.client import DeepSearchClient

client = DeepSearchClient()
python
from services.deepsearch_service.client import DeepSearchClient

client = DeepSearchClient()

健康检查

健康检查

status = client.health_check()
status = client.health_check()

深度搜索(默认参数)

深度搜索(默认参数)

result = client.search("Python异步编程的最佳实践有哪些?")
result = client.search("Python异步编程的最佳实践有哪些?")

自定义参数

自定义参数

result = client.search( query="如何设计一个高可用的微服务架构?", max_iterations=3, # 最大迭代次数 (1-5) queries_per_iteration=3, # 每轮查询数 (1-5) depth_level="deep" # 搜索深度: quick/normal/deep )
result = client.search( query="如何设计一个高可用的微服务架构?", max_iterations=3, # 最大迭代次数 (1-5) queries_per_iteration=3, # 每轮查询数 (1-5) depth_level="deep" # 搜索深度: quick/normal/deep )

获取报告和来源

获取报告和来源

print(result["report"]) for source in result["sources"]: print(f"- {source['title']}: {source['url']}")
undefined
print(result["report"]) for source in result["sources"]: print(f"- {source['title']}: {source['url']}")
undefined

返回格式

Return Format

json
{
  "query": "Python异步编程的最佳实践有哪些?",
  "report": "# Python异步编程最佳实践\n\n## 1. 核心概念...",
  "sources": [
    {
      "title": "Python官方asyncio文档",
      "url": "https://docs.python.org/...",
      "relevance": 0.95,
      "snippet": "asyncio是Python标准库中的异步I/O框架..."
    }
  ],
  "iterations": [
    {
      "iteration": 1,
      "queries": ["Python asyncio 教程", "async await 用法"],
      "results_count": 6,
      "key_findings": ["asyncio是标准库组件"]
    }
  ],
  "total_iterations": 2,
  "total_sources": 8,
  "elapsed_seconds": 45.32,
  "search_timestamp": "2025-12-28T18:30:00"
}
json
{
  "query": "Python异步编程的最佳实践有哪些?",
  "report": "# Python异步编程最佳实践\n\n## 1. 核心概念...",
  "sources": [
    {
      "title": "Python官方asyncio文档",
      "url": "https://docs.python.org/...",
      "relevance": 0.95,
      "snippet": "asyncio是Python标准库中的异步I/O框架..."
    }
  ],
  "iterations": [
    {
      "iteration": 1,
      "queries": ["Python asyncio 教程", "async await 用法"],
      "results_count": 6,
      "key_findings": ["asyncio是标准库组件"]
    }
  ],
  "total_iterations": 2,
  "total_sources": 8,
  "elapsed_seconds": 45.32,
  "search_timestamp": "2025-12-28T18:30:00"
}

与 websearch_service 的区别

Differences from websearch_service

特性WebSearchDeepSearch
搜索模式单轮搜索迭代多轮搜索
查询策略直接使用输入LLM 分解/优化
输出格式结构化列表综合报告 + 来源
响应时间10-30s30-120s
FeatureWebSearchDeepSearch
Search ModeSingle-round searchMulti-round iterative search
Query StrategyDirect use of inputLLM decomposition/optimization
Output FormatStructured listComprehensive report + sources
Response Time10-30s30-120s