resolve_kg
Find knowledge graph nodes in a textbook by fuzzy name search, exact section number match, or browsing child nodes. Filter to leaf nodes for anchoring knowledge points.
Instructions
KG 锚定查表(确定性只读,数学+科学一套通吃):按名称/节号/父节点在某教材根下查节点,供选锚定叶子。
🔴 叶子=无子节点(is_leaf),别按 level 判——科学 901 树 5 层、902-906 树 4 层,叶深不一(H2 实测)。 用法:先 query 模糊(如「乘方」)看候选 → 挑 is_leaf=true 的最贴切者作 ingest_items 的 kp_id; 同步练习类卷名带节号可 section_num 精确命中(如 "2.5" → 「2.5 有理数的乘方」节点)。 参数: subject_root: 教材根 id(数学七上="100";科学="901".."906")——锚定范围的唯一开关 query : 名称模糊词(LIKE %query%) section_num : 节号精确匹配(如 "2.5",命中名称以「2.5 」开头的节点) parent_id : 只列某节点的直接子节点(浏览下钻用;给了它则忽略 subject_root 前缀过滤) leaves_only : 只返回叶子 返回: {ok, count, nodes:[{id,name,level,parent_id,is_leaf}]};无命中 → count=0 不报错。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | No | ||
| parent_id | No | ||
| leaves_only | No | ||
| section_num | No | ||
| subject_root | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||