POST/agentic-search

agentic-search 智能检索与片段返回

用自然语言提问,返回最相关的可引用文献段落。

概述

agentic-search 面向 LLM Agent 与 RAG 场景。每条结果包含标题、正文片段、doc_id 和页码/位置等来源信息,适合快速找到可引用的上下文;需要读全文时,可用 doc_id 继续调用 content。

适用场景

  • · RAG 应用:为 LLM 补充含引用的文献证据
  • · Agent 工具调用:一屏拿到可回链的片段与原文位置
  • · 问答系统:结合文献原文与片段生成带出处的回答

不适用场景

  • · 精确 DOI、标题或字段化分页导出,请优先使用 meta-search。
  • · 读取完整原文上下文,请使用返回的 doc_id 继续调用 content。
  • · 下载图表或附件资源,请使用 resource。

鉴权

统一使用 API Key Bearer Token 鉴权,详见统一鉴权章节。在 HTTP Header 中加入:

Authorization: Bearer YOUR_API_TOKEN

请求示例

curl -X POST https://api.sciverse.space/agentic-search \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "graphene battery cycle stability",
    "top_k": 10,
    "filters": {
      "lang": "en",
      "publication_published_year": {"gte": 2020},
      "topics": {
        "logic": "and",
        "dimensions": {
          "primary_topic_domain": "Physical Sciences"
        }
      }
    }
  }'

请求体(JSON)

字段类型必填说明
querystring必填你的检索问题;不能为空。
范围 最大 4096 字符
top_kinteger可选返回片段数量。
默认 10范围 1–100
sub_queriesinteger可选查询改写数量,0 表示不改写。
默认 0范围 0–4
filtersobject可选按文献元数据收窄语义检索范围;字段结构见 filters 字段表。
默认 {}

filters 字段表

字段类型说明
字段组合规则rule字段间 AND;同字段数组值 OR不传 filters 或传 {} 表示不过滤。
langstringen、zh 等语言代码文献语言。
titlestring标题字符串按标题精确匹配。
authorstring / string[]作者名;数组表示任一作者命中按作者名过滤。
publication_venue_name_unifiedstringNature、Science 等按规范化发表载体名称过滤。
publication_venue_typestringjournal、conference、book series、repository 等按发表载体类型精确匹配,传值不区分大小写。
publication_published_datestring / rangeYYYY、YYYY-MM、YYYY-MM-DD、{gte,lte}、[min,max]按发表日期过滤。
publication_published_yearnumber / range2024、{gte:2020,lte:2025}、[2020,2025]按发表年份过滤。
citation_countnumber / range100、{gte:100}、[100,null]按被引次数过滤。
influential_citation_countnumber / range10、{gte:10}、[10,null]按高影响力被引次数过滤。
topics.logicstringand、or;默认 or控制 topics.dimensions 中多个主题维度的组合方式。
topics.dimensions.primary_topicstringMachine Learning 等主题名按主要主题名称过滤。
topics.dimensions.primary_topic_domainstringPhysical Sciences、Social Sciences、Health Sciences、Life Sciences按主要主题所属领域过滤。

响应结构

字段类型说明
hitsarray命中片段列表。
hits[].chunk_idstring片段 ID。
hits[].chunkstring片段文本内容。
hits[].doc_idstring所属文献 ID,可传给 /content 读取原文。
hits[].titlestring文献标题。
hits[].abstractstring文献摘要。
hits[].scorefloat相关度得分。
hits[].source_typestringpdf / web 等来源类型。
hits[].offsetinteger片段在原文中的字符偏移(Unicode 码点数)。
hits[].page_nointeger原文页码(仅 pdf 类有)。
hits[].model_namestring用于打分的模型名。
hits[].model_versionstring模型版本。
hits[].langstring文献语言。
hits[].metadata_typestring资源类型,如 paper、ebook。
hits[].authorarray<string>作者列表。
hits[].publication_venue_name_unifiedstring发表载体名称。
hits[].publication_venue_typestring发表载体类型。
hits[].publication_published_datestring发表日期,格式为 YYYY-MM-DD。
hits[].publication_published_yearinteger发表年份。
hits[].citation_countinteger被引次数。
hits[].influential_citation_countinteger高影响力被引次数。
hits[].primary_topicstring文献主要主题名称。
hits[].primary_topic_domainstring文献主要主题所属领域。

响应示例

{
  "hits": [
    {
      "chunk_id": "c_8c1f...",
      "chunk": "Graphene-based cathodes exhibit improved cycle stability ...",
      "doc_id": "d_2a91...",
      "title": "Cycle stability of graphene composite cathodes",
      "abstract": "...",
      "score": 0.873,
      "source_type": "pdf",
      "offset": 18432,
      "page_no": 4,
      "model_name": "sciverse-retriever",
      "model_version": "v2.3",
      "lang": "en",
      "metadata_type": "paper",
      "author": ["Jane Doe", "John Smith"],
      "publication_venue_name_unified": "Nature",
      "publication_venue_type": "journal",
      "publication_published_date": "2023-06-15",
      "publication_published_year": 2023,
      "citation_count": 128,
      "influential_citation_count": 12,
      "primary_topic": "Energy Storage",
      "primary_topic_domain": "Physical Sciences"
    }
  ]
}

错误码

错误码信息说明
400INVALID_REQUEST请求参数错误,检查 query / top_k 等取值。
401UNAUTHORIZED鉴权失败,检查 Authorization 请求头。
429RATE_LIMITED触发账号配额限制,请等待限流窗口恢复或每日额度重置后重试。
500INTERNAL_ERROR服务错误,指数退避重试。
502/503UPSTREAM_UNAVAILABLE服务暂不可用,指数退避重试。

通用错误码请参考「错误码」章节。

重试建议

  • · 建议重试:500 / 502 / 503
  • · 不应重试:400 / 401;429 请等待限流窗口恢复或每日额度重置

能力边界

  • · agentic-search 返回 semantic evidence retrieval 结果和 evidence chunk,不生成最终答案。
  • · query 最长 4096 字符;top_k 范围 1–100;sub_queries 范围 0–4。
  • · filters 是语义检索过滤对象,结构不同于 meta-search 的 FieldFilter 数组。
  • · 结果字段会按账号权限裁剪,调用方必须容忍字段缺失。

FAQ

agentic-search 会直接生成综述或回答吗?

不会。它只返回可引用的证据片段、doc_id 和位置线索,上层 Agent 或 RAG 应用负责生成答案。

如何从 evidence chunk 继续读取上下文?

使用命中的 doc_id、offset 等字段调用 content,按字符切片读取原文上下文。

返回片段能直接引用吗?

可以作为引用线索,但回答中应同时保留 doc_id、doi、chunk_id、offset 或页码等来源信息。

agentic-search 和 meta-search 如何选择?

自然语言科研问题和证据召回选 agentic-search;字段化筛选、排序、导出和 DOI 查询选 meta-search。

还没有 API Key?

登录控制台「密钥」即可创建。同一套 API Key 可用于已开通的 Sciverse、点石与 Skills 能力,提供基础试用额度,具体以账号权限为准。

前往控制台