query_graph
Search a knowledge graph to retrieve prior context, preferences, and decisions before answering questions. Returns related nodes and their connections.
Instructions
Automatically search the memory graph before answering questions that may depend on prior context, user preferences, project decisions, constraints, or earlier conversation state. Returns a serialized subgraph with matching nodes and their connected neighborhood. Uses hybrid retrieval (transcript + graph) by default for robust fallback. Understands temporal references such as 'recently', 'latest', 'originally', and 'last week'. Benchmark modes: use retrieval_mode='graph' for graph-only (no verbatim fallback), 'verbatim' for transcript-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | ISO-8601 datetime. When provided, return only nodes valid at that point in time (overrides include_invalidated). | |
| query | Yes | Natural-language search query. | |
| project | No | Optional project or workspace name used to partition memory. | |
| agent_id | No | Optional agent or client identifier used to partition memory. | |
| max_depth | No | Relationship traversal depth around matching nodes. | |
| max_nodes | No | Maximum number of matching nodes to return. | |
| session_id | No | Optional conversation or run identifier used to partition memory. | |
| expand_depth | No | Optional support expansion depth. At 1, graph mode may return up to twice max_nodes. | |
| retrieval_mode | No | Retrieval strategy: graph-only, verbatim transcript retrieval, or hybrid fusion with reranking. | hybrid |
| include_invalidated | No | When true, include nodes whose valid_to has passed. Default false excludes expired nodes. |