1. lkm-openapi
literature-sage
  • lkm-openapi
    • 搜索知识:对科学命题/研究问题等进行召回
      POST
    • 搜索推理链:对文献推理过程进行召回
      POST
    • 查询论文对应的完整知识图谱
      POST
    • 查询命题对应的推理链
      GET
    • 批量查询:按知识节点 ID 列表取详情
      POST
    • 问题反馈
      POST
  1. lkm-openapi

搜索推理链:对文献推理过程进行召回

POST
/reasoning/search
用自然语言检索 LKM 中的推理链(论文中得到某一结论的研究过程,包括理论推导、数值计算、实验流程等)。可以理解成:不是找“哪条 claim 文本与用户query相似”,而是找“哪篇论文里的推理过程与用户query相似”。
新调用方建议统一传 format: "graph"。非 graph format 属于旧响应结构,后续不建议继续使用。format: "graph" 会返回 graph.nodes 和 graph.edges,更适合前端展示、agent 消费和后续图谱处理。
如果只想找相关 claim / question 节点,请用 POST /search。如果已经有 claim ID,想看这条 claim 的推理链,请用 GET /claims/{id}/reasoning。

检索模式怎么选#

hybrid:默认推荐
同时使用向量语义检索和关键词匹配。
建议同时传入 query 和 keywords。
query 表达想找的推理过程,例如“从 XRD 证据推断相稳定性”。
keywords 锚定关键方法、材料、现象、指标、实验条件等。
建议从用户 query、检索式、筛选条件或上游 LLM 解析结果中抽取 3 到 10 个短关键词。
不要把整句自然语言塞进 keywords。
semantic:更快,但召回效果可能弱一些
只进行向量语义检索。
会关闭关键词匹配。
更适合高并发、低延迟或只需要粗召回的场景。
代价是不会利用 keywords 做字面命中;当材料名、方法名、缩写、实验条件很关键时,效果通常比 hybrid 差一些。
lexical:只按关键词匹配
只进行关键词匹配。
会关闭向量语义检索。
适合必须命中特定方法、材料、指标、实验条件或缩写的场景。
例如:Rietveld refinement、powder XRD、FAPbI3、85 °C、thermal decomposition。
代价是不会召回“字面不同但推理过程相近”的结果。
论文范围过滤
如果只想在指定论文中检索,传 filters.paper_ids。
paper_ids 必须是纯数字串,例如 ["812481689673531392"]。
不要带 paper: 前缀;传 paper:812481689673531392 会查不到结果。

和 /search 的区别#

/search 召回的是单个节点,例如 claim 或 question。
/reasoning/search 召回的是整条推理链。
/search 更适合做“相关命题/问题发现”。
/reasoning/search 更适合做“找类似论证过程”“找类似实验逻辑”“找相似证据结构”。
/reasoning/search 建议统一使用 format: "graph",直接返回图结构。

format 的用法#

format: "graph"
新调用方推荐使用。
返回图结构,适合直接做 graph 可视化、agent 读取和后续图谱处理。
data.reasoning_chains[] 中每条结果会包含 graph.nodes 和 graph.edges。
每条结果也会内嵌 paper、addressed_problems、open_questions 等信息。
使用 format: "graph" 时,论文信息在每条 chain 的 paper 字段中。
不传 format 或使用非 graph format
后续不建议新调用方继续依赖旧结构,仅建议历史客户端兼容时使用。
会返回旧推理链结构,例如 conclusion_title、conclusion_text、factors、motivating_questions 等字段。
旧结构需要调用方自己从 factors / premises / steps 拼图。

format: "graph" 响应怎么看#

顶层结构
data.reasoning_chains 仍然是命中的结果列表。
每条 chain 对应一张小图。
每条 chain 里有 graph.nodes 和 graph.edges。
每条 chain 里有 paper,表示来源论文。
每条 chain 里可能有 addressed_problems 和 open_questions。
graph.nodes
kind: "conclusion" 表示结论节点。
kind: "reasoning_steps" 表示推理步骤节点,通常包含 steps 数组。
kind: "highlight" 表示正向亮点、关键证据或支持性观察。
kind: "weak_point" 表示弱点、限制或需要审慎看待的前提,不要默认当作正向证据。
kind: "subproblem" 表示驱动该结论的子问题或研究动机。
节点通常包含 id、type、kind、content、title、metadata、global_id 等字段;不同节点类型字段可能不完全一样。
graph.edges
type: "concludes" 通常表示 reasoning_steps / factor 节点指向 conclusion。
type: "highlight_of" 表示某个 highlight 是某个 reasoning_steps / factor 的正向亮点或支持性观察。
type: "weakpoint_of" 表示某个 weak point 指向它所约束或削弱的 reasoning_steps / factor。
type: "subproblem_of" 表示某个 subproblem 指向它驱动的 conclusion。
type: "previous_conclusion_of" 表示前序结论与当前结论或推理单元之间的上下文/前置关系。
edge 上可能有 p1、p2 等数值字段;这些是模型/图谱内部参数,不要直接当作用户侧可信度展示。
推荐渲染方式
主图优先显示 conclusion、reasoning_steps、highlight、weak_point、subproblem。
paper 建议作为图标题、角标、来源信息或侧栏 provenance,不一定作为主图节点。
reasoning_steps.steps 建议折叠在 reasoning_steps 节点详情里;不要默认把每个 step 展开成主图节点。
如果用户点击 reasoning_steps 节点,再展开 steps 的顺序列表。
highlight 节点建议用正向/强调样式,例如绿色、蓝色或实线。
weak point 节点建议用不同颜色或虚线样式,避免被误读成正向支撑证据。
推荐 label
conclusion label 优先用 title,没有 title 时截断 content。
reasoning_steps label 可用 kind / subtype,再显示 steps 数量。
highlight label 优先用 title,没有 title 时截断 content。
weak point label 优先用 title,没有 title 时截断 content。
subproblem label 可以截断 content,或显示为“研究问题 / motivation”。
paper label 可用 paper.en_title,没有英文标题时再用 DOI 或 paper ID。
注意事项
format: "graph" 已经给出 nodes / edges,不建议前端再从 raw factors 重新推导图结构。
不要把 score 画成可信度或证据强度;它只是检索排序分数。
highlight_of 和 weakpoint_of 语义相反:前者表示正向亮点或支持性观察,后者表示限制、弱点或风险。
不要把 highlight 当成最终结论;它通常是支撑推理单元的局部亮点。
不要把 weak_point 当成正向证据;它通常表示限制、弱点、风险或待验证前提。
不要把 subproblem 当成支撑证据;它是研究动机或问题背景。
metadata 在 format: "graph" 中通常已经是 object;默认格式下某些 metadata 可能是 JSON string。

响应怎么看#

业务状态
HTTP 状态通常是 200,业务是否成功看响应体里的 code。
code = 0 表示成功。
推理链列表
data.reasoning_chains 是命中的推理链列表。
在 format: "graph" 下,每条链通常包含 chain_id、paper_id、score、graph、paper、addressed_problems、open_questions。
score 是检索排序分数,不等于科学可信度,也不应该当作证据强度或置信度使用。
推理图结构
graph.nodes 是节点列表。
graph.edges 是边列表。
graph.nodes[].kind 表示节点角色,例如 conclusion、reasoning_steps、highlight、weak_point、subproblem。
graph.edges[].type 表示边语义,例如 concludes、highlight_of、weakpoint_of、subproblem_of、previous_conclusion_of。
论文元数据
format: "graph" 下,论文信息在每条 chain 的 paper 字段中。
每条 reasoning chain 里的 paper_id 是纯数字论文 ID。
分页
分页使用 offset / limit。
响应里返回 has_more(布尔值)表示是否还有下一页。
has_more = true 表示还有下一页;has_more = false 表示当前已是最后一页。
服务端通过多查一条(limit + 1)判断是否还有更多结果,从而省掉额外的 count 查询开销。
翻下一页:当 has_more = true 时,用 offset = offset + limit 再次请求(limit 保持不变)。

常见错误#

290002 表示入参错误。
常见原因:retrieval_mode 取值非法。
常见原因:keywords 超限。
常见原因:filters.paper_ids 格式不正确。
常见原因:分页参数越界。
290009 表示查询超时。
可以缩短 query、减少 keywords 或降低 limit 后重试。
290001 表示其他查询错误。
可以重试一次;如果仍失败,建议简化请求。
2000 表示未授权,通常是请求头缺少有效 accessKey。

使用建议#

默认使用 hybrid,并尽量同时传 keywords。
新调用方默认传 format: "graph"。
高 QPS 或延迟敏感场景可以先用 semantic。
原因:semantic 关闭关键词匹配,速度更快。
如果召回不够,可以再补一次 lexical,或直接切回 hybrid。
关键词建议
优先放方法名、材料名、实验条件、指标名、缩写。
例如:powder XRD、Rietveld refinement、phase transition、85 °C、thermal stability。
即使没有显式关键词,也建议调用方从 query 中抽取一组候选关键词。
如果用户已经限定某篇论文,优先传 filters.paper_ids。
如果用户只是想找相关 claim,不需要完整推理过程,用 /search 会更轻量。
翻页时以 has_more 为准。

请求参数

Header 参数

Body 参数application/json必填

示例
{
  "query": "perovskite thermal stability",
  "keywords": ["FAPbI3", "Cs doping"],
  "filters": {
    "paper_ids": ["1250224056288936031", "1250166588896706604"]
  },
  "retrieval_mode": "hybrid",
  "offset": 0,
  "limit": 20,
  "format": "graph"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://open.bohrium.com/openapi/v1/lkm/reasoning/search' \
--header 'accessKey;' \
--header 'Authorization: Bearer 5cc6462133d64251bf6ab64815c0e9xx' \
--header 'Content-Type: application/json' \
--data '{
  "query": "perovskite thermal stability",
  "keywords": ["FAPbI3", "Cs doping"],
  "filters": {
    "paper_ids": ["1250224056288936031", "1250166588896706604"]
  },
  "retrieval_mode": "hybrid",
  "offset": 0,
  "limit": 20,
  "format": "graph"
}'

返回响应

🟢200
application/json
业务错误,按响应体 code / msg 分类
Bodyapplication/json

示例
{
    "code": 0,
    "data": {
        "reasoning_chains": [
            {
                "chain_id": "811894248839315456_4",
                "paper_id": "811894248839315456",
                "score": 0.030158730158730156,
                "paper": {
                    "id": "811894248839315456",
                    "doi": "10.1016/j.tins.2008.09.010",
                    "publication_id": "6770",
                    "publication_name": "Trends in Neurosciences _ Trends in Neurosciences",
                    "zh_title": "注意力缺陷多动障碍的多巴胺能假说需要重新审视",
                    "en_title": "The dopaminergic hypothesis of attention-deficit/hyperactivity disorder needs re-examining",
                    "authors": "Francois Gonon",
                    "publication_date": "2009-1",
                    "available_online": "",
                    "cover_date_start": "2009-01-01",
                    "area": "Medicine, Psychology, Biological Psychology",
                    "research_categories": "[\"Psychology\", \"Biological Psychology\"]",
                    "keywords": "",
                    "created_at": "2022-12-20T01:37:53+08:00"
                },
                "addressed_problems": [
                    {
                        "id": "paper:811894248839315456::problem",
                        "content": "Attention-deficit/hyperactivity disorder (ADHD) has been widely described as a childhood neuropsychiatric disorder whose core symptoms are often alleviated by psychostimulants, and this therapeutic response has been used to argue that ADHD reflects an underlying dopaminergic deficit of mainly genetic origin. The scientific problem is that this dopamine-deficit hypothesis has been treated as established even though the supporting evidence is fragmentary and methodologically indirect: neurochemical studies yield inconsistent findings on dopamine transporter function and extracellular dopamine tone; imaging studies using [11C]raclopride can be interpreted in more than one way and do not provide a clean measure of basal dopamine state; genetic associations with dopaminergic variants are statistically small and do not establish a strong causal link; pharmacological efficacy is confounded because psychostimulants also act through noradrenergic mechanisms and non-dopaminergic treatments can be equally effective; and animal models or brain-imaging abnormalities do not map straightforwardly onto a simple dopamine-deficit mechanism. As a result, the field lacks a robust basis for claiming that ADHD is a primary dopaminergic hypofunction disorder, and that uncertainty has consequences: it can bias interpretation of ADHD biology, overstate the explanatory power of dopamine-centered theories of reward, and preferentially frame psychostimulant medication as the scientifically privileged treatment despite limited evidence for long-term benefit on educational, behavioral, or substance-use outcomes.",
                        "keywords": [
                            "ADHD pathophysiology",
                            "dopamine-deficit hypothesis",
                            "psychostimulant treatment bias",
                            "neurochemical and genetic evidence",
                            "long-term outcomes"
                        ],
                        "metadata": {
                            "keywords": [
                                "ADHD pathophysiology",
                                "dopamine-deficit hypothesis",
                                "psychostimulant treatment bias",
                                "neurochemical and genetic evidence",
                                "long-term outcomes"
                            ]
                        }
                    }
                ],
                "open_questions": [
                    {
                        "id": "paper:811894248839315456::open_question",
                        "content": "The paper leaves unresolved what the most adequate non-dopaminergic or multicomponent biological account of ADHD should be, since no alternative theory has yet achieved general consensus. It also leaves open how the heterogeneous structural and functional brain abnormalities seen in ADHD relate to development, symptom expression, and treatment response, especially given the observation that ADHD may involve delay rather than deviance in cortical maturation. More broadly, the mechanistic role of dopamine in reward, motivation, and decision making remains debated in ways that continue to complicate attempts to connect neurobiology with ADHD symptoms and comorbidities. Finally, the long-term functional impact of stimulant medication remains uncertain enough that future work is needed to determine which interventions most effectively improve educational, behavioral, and social outcomes over time."
                    }
                ],
                "graph": {
                    "nodes": [
                        {
                            
修改于 2026-07-08 07:14:18
上一页
搜索知识:对科学命题/研究问题等进行召回
下一页
查询论文对应的完整知识图谱
Built with