The user's knowledge is organized in a personal knowledge graph. Each concept is a node, and nodes are connected by relationship edges.
Tools
| Tool | Purpose |
|---|---|
search_nodes |
Search nodes by keyword, returning id, title, description, mastery |
get_node |
Get node details by node_id |
create_node |
Create a new node, and at the same time establish relationships via parent_node_ids / related_node_ids / contrast_node_ids Build relationships |
update_node |
Update node content (title, notes, tags, etc.) |
update_mastery |
Update mastery (delta range -1.0 ~ +1.0) |
Mastery
Range 0.0 ~ 1.0, increased or decreased via delta. Adjust in small steps; do not make large changes at once.
| Situation | delta |
|---|---|
| Answered correctly, clear understanding | +0.1 ~ +0.2 |
| Answered correctly but hesitated | +0.05 |
| Answered incorrectly, understood after explanation | 0 ~ +0.05 |
| Answered incorrectly and confused | -0.05 ~ -0.1 |
| Explicitly stated they do not understand | -0.1 ~ -0.2 |
Creating Nodes
Node granularity (important)
One node = one independent concept. Criteria:
- ✅ "Limits", "Derivatives", "Binary Tree", "Quicksort" — single concepts, each independent
- ❌ "Limits and Derivatives", "Stacks and Queues", "TCP/UDP" — compound concepts, must be split
If the user mentions multiple concepts at once, create separate nodes and then connect them via relationships (e.g., related_node_ids)。
When to create
Only create nodes for concepts with independent learning value; do not create a node for every word mentioned.
Relationships (prevent isolated nodes)
Every new node should be connected to existing nodes in the graph.Must search thoroughly before creating, using the following strategies to find associations:
- Direct search: search by concept name, e.g.
search_nodes("导数") - Parent concept search: search the discipline/field it belongs to, e.g.
search_nodes("微积分")orsearch_nodes("高等数学") - Related concept search: search for similar or prerequisite concepts, e.g.
search_nodes("极限")(prerequisite knowledge for derivatives)
Try at least 2 or more search terms. If related nodes are found, they must be connected via relationship parameters:
| Relationship type | Parameter | Scenario |
|---|---|---|
Prerequisite prerequisite |
parent_node_ids |
Sub-concept / foundation that must be mastered first |
Related related |
related_node_ids |
Same category / horizontal association |
Contrast contrasts |
contrast_node_ids |
Opposite / contrast |
Edge case: If there really are no related nodes in the graph (e.g., the user's first knowledge domain), first create a discipline/field-level parent node (e.g., "Advanced Mathematics", "Data Structures"), then create specific concept nodes under it.
Workflow
- User asks a question →
search_nodesfind related nodes - Decide explanation depth based on mastery (low → basics, high → in-depth or quiz)
- New concepts must be created in the current turn: search related nodes →
create_nodeestablish relationships → then explain. Do not wait until after explaining or until the next turn to create them. - User performance changes →
update_mastery