-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Describe the bug
The open_nodes tool returns an empty relations array even when the requested entity has outgoing relations in the knowledge graph. This makes it impossible to traverse the graph from a specific node without calling read_graph and filtering the entire dataset client-side.
To Reproduce
- Create two entities and a relation between them:
create_entities({
entities: [
{ name: "2025-12-17", entityType: "work-day", observations: [] },
{ name: "incident/example", entityType: "incident", observations: ["Test incident"] }
]
})
create_relations({
relations: [{
from: "2025-12-17",
to: "incident/example",
relationType: "worked-on"
}]
})- Call
open_nodeson the source entity:
open_nodes({ names: ["2025-12-17"] })- Observe the result has an empty
relationsarray
Expected behavior
open_nodes should return outgoing relations from the requested entity, similar to how graph databases return edges when querying a node. The response should include:
{
"entities": [
{
"type": "entity",
"name": "2025-12-17",
"entityType": "work-day",
"observations": []
}
],
"relations": [
{
"type": "relation",
"from": "2025-12-17",
"to": "incident/example",
"relationType": "worked-on"
}
]
}Logs
Actual response from open_nodes:
{
"entities": [
{
"type": "entity",
"name": "2025-12-17",
"entityType": "work-day",
"observations": []
}
],
"relations": []
}Calling read_graph confirms the relation exists in the graph.
Additional context
This limitation forces users to call read_graph (which returns the entire knowledge graph) and filter client-side to find relations for specific entities. This doesn't scale as the graph grows.
Use case: Daily work tracking where date entities link to topic entities via worked-on relations. To generate a daily summary for a specific date, we need to find all topics linked from that date, but open_nodes doesn't provide this information.
Suggested solutions:
- Include both incoming and outgoing relations in
open_nodesresponse by default - Add optional parameters to
open_nodesto control relation inclusion (e.g.,includeRelations: "both" | "outgoing" | "incoming" | "none",relationDepth: number)
Note: Both directions are useful for different queries. Outgoing relations answer "what does this entity link to?" (e.g., which topics were worked on this date?), while incoming relations answer "what links to this entity?" (e.g., which dates was this incident worked on?). Most graph databases provide both by default.