recall
Search session caches and permanent knowledge graphs with automatic routing to find relevant memory results; use session-aware queries when you need context from the current conversation.
Instructions
Search memory with auto-routing and session awareness.
When session_id is provided without datasets or search_type, searches session cache first by keyword matching. Falls through to the permanent knowledge graph if no session results match.
Auto-routing picks the best search strategy when search_type is not specified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language query to search for. | |
| scope | No | Comma-separated memory sources to include: 'graph', 'session', 'session_first', 'trace', 'session_context', 'tools', 'code', 'all', 'auto'. Defaults to 'auto' (session first when session_id is set, else graph). 'tools' and 'code' are explicit opt-in only. 'code' runs a deterministic code-graph query and tags results source='code'. | |
| top_k | No | Maximum results to return (default: 15). | |
| datasets | No | Comma-separated dataset names to search within. | |
| code_query | No | 'code' scope only: structured operation and arguments for the deterministic code-graph query, e.g. {"operation": "query_facts", "property": "language", "limit": 500}. Supported operations: query_facts, explore, traverse, find_path, impact_analysis, insights, architecture, delta, capabilities, search, neighbors, subgraph, flows, hubs, ask. When omitted, 'code' scope runs an 'explore' seeded with the query text. Most operations take exact node names/IDs or structured filters; search and ask take natural-language text. | |
| session_id | No | Session ID for session-first search. | |
| search_type | No | Override auto-routing with one SearchType name. Completion types (answer written by an LLM): HYBRID_COMPLETION (the default when routing is off), GRAPH_COMPLETION, GRAPH_COMPLETION_COT, GRAPH_COMPLETION_CONTEXT_EXTENSION, GRAPH_COMPLETION_DECOMPOSITION, GRAPH_SUMMARY_COMPLETION, RAG_COMPLETION, TEMPORAL, BROAD, AGENTIC_COMPLETION. Retrieval-only types (no LLM): CHUNKS, CHUNKS_LEXICAL, SUMMARIES, SKILLS, CODE. Other: CYPHER, NATURAL_LANGUAGE, CODING_RULES, GRAPH_REPORT, FEELING_LUCKY. An unknown name is rejected with a validation error. | |
| system_prompt | No | Override the synthesis prompt for completion searches. When omitted, falls back to COGNEE_MCP_RECALL_SYSTEM_PROMPT / _FILE if configured on the server. | |
| include_references | No | Show the ids `forget` needs to delete one stored item. Use it when asked to forget something specific, then pass a data_id together with its dataset_id to `forget`. - The default answer cites its sources in an `Evidence:` block (each with a data_id, best match first) and ends with a `dataset: <name> (dataset_id=...)` line. - CHUNKS, SUMMARIES, RAG and graph-completion hits instead get `refs: data_id=..., dataset_id=..., document=...` lines, at most 5 per hit, best match first. A chunk hit names the one item its text came from; a graph-completion answer lists every item in its context, so prefer the default type or CHUNKS to find one fact. Session hits are not stored data and get neither. With backend access control off, ids are only shown when recall is scoped to a single dataset. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |