Skip to main content

SearchType

Enum defining the available search modes for cognee.search().

Values

The Retrieval source column shows what each type reads from: Vector (semantic similarity over embeddings), Graph (knowledge-graph traversal / Cypher), Vector + Graph (semantic seeds plus graph context — the “semantics + graph” combination), or Lexical (keyword matching, no embeddings). Types marked Varies pick or combine sources at runtime.

Speed, cost, and recall depth

Two things drive the cost of a search type: how many LLM calls it makes and how much retrieved context it puts into each prompt. The tabs below give measured reference numbers from one benchmark run: Search speed & recall depth compares every type on latency, call counts, and recall depth, and Session speed and overhead shows what the default session settings add on top, including the prompt-token cost of each type.
Methodology. Measured on cognee 1.4 (dev) with openai/gpt-5-mini, LanceDB and Kuzu, against a small knowledge base (10 short documents → 99 nodes / 191 edges), 3 questions × 2 runs per type (1 run for the iterative modes), default top_k=15. Token counts are provider-reported and summed over all LLM calls in the query. Absolute values scale with your corpus, model, and hardware — read them as ratios and orders of magnitude, not guarantees. On larger corpora token costs grow with chunk size: a single chunk can hold up to ~8,191 tokens, and no layer truncates the assembled context by default.
The single-call types (upper block) were measured with session memory disabled (AUTO_FEEDBACK=false): a query costs exactly its retrieval plus at most one completion. The iterative multi-call modes (lower block) were measured with default session settings — subtract one LLM call for their sessions-off cost, small relative to these totals. Prompt-token costs are in the Session speed and overhead tab.Rows marked (estimated) were not measured — they are derived from how the retriever is built (CYPHER and CODING_RULES are direct graph reads with no LLM or embedding call; TRIPLET_COMPLETION has the same shape as RAG_COMPLETION; GRAPH_REPORT reads every node and edge via get_graph_data(), so its latency grows with the graph rather than with top_k; AGENTIC_COMPLETION is bounded by the measured iterative modes). Embedding-call counts for the multi-call modes are likewise derived rather than measured: each retrieval sweep embeds the query once, and FEELING_LUCKY inherits whatever the chosen type embeds — anywhere from 0 for the direct graph readers up to 5 if the selector picks GRAPH_COMPLETION_COT.The ordering to remember: latency is nearly identical for the three single-call completion types (the single LLM call dominates; retrieval differs by tens of milliseconds), while token cost and recall depth grow together — on this corpus roughly 1 : 4.7 : 7.5 for RAG : GRAPH : HYBRID (measured sessions-off). GRAPH_COMPLETION does the most retrieval work per query (it fans out one vector search per index collection — 5 collections by default, repeated for each searched dataset and each capped at wide_search_top_k=100 results — plus a graph projection), but that stays cheap next to the completion call.
To go faster: prefer CHUNKS, SUMMARIES, or CHUNKS_LEXICAL (no completion call), pass only_context=True, or disable auto-feedback. To go deeper: start with GRAPH_COMPLETION, escalate to GRAPH_COMPLETION_DECOMPOSITION for multi-part questions or GRAPH_COMPLETION_COT for multi-hop reasoning — the tables above show what that escalation costs (roughly 3× and 10× the latency, 2.5× and 8× the prompt tokens of GRAPH_COMPLETION on this corpus). Lowering max_iter / context_extension_rounds via retriever_specific_config reduces cost proportionally. See Search Basics — Advanced Parameters.

Choosing a Search Type

Use GRAPH_COMPLETION (default) for the best balance of accuracy and context. Use RAG_COMPLETION for a simpler chunk-based approach.
Use CHUNKS for semantic chunk retrieval or CHUNKS_LEXICAL for keyword-based. Use SUMMARIES for pre-generated summaries.
Use CYPHER for raw Cypher queries or NATURAL_LANGUAGE to have cognee translate your question to Cypher.
Just call recall() without query_type: its rule-based router picks a strategy from cues in your query and defaults to GRAPH_COMPLETION, so plain questions get a generated answer. Queries with exact-phrase, coding-vocabulary, or Cypher-shaped cues route to payload-returning types (CHUNKS_LEXICAL, CODING_RULES, CYPHER) — see Auto-routing behavior for the full mapping.FEELING_LUCKY is a different, LLM-based selector. It can choose retrieval-only types such as SUMMARIES or CHUNKS, which return payloads instead of a generated answer, so avoid it when you need an answer on every call.
All four graph-completion modes retrieve graph triplets and generate an LLM answer, but they differ in depth and latency:See Search Basics — Advanced Parameters and Retrievers for full details.

Per-search-type parameters

Every type accepts the common parameters (query_text, top_k, system_prompt/system_prompt_path, only_context, verbose, include_references, datasets/dataset_ids, user, session_id) documented in Search Basics — Parameters Reference. The graph-completion family additionally honors the graph-ranking knobs (wide_search_top_k, triplet_distance_penalty, feedback_influence, neighborhood_depth, neighborhood_seed_top_k) and node-set filters. With recall(), use node_name and node_name_filter_operator; node_type is only exposed on lower-level search(). The accordions below list each search type’s type-specific parameters. Most entries are passed through retriever_specific_config; when a search type uses a common parameter in a special way, that is noted.
Retrieval runs as vector seeds → 1-hop graph traversal → triplet ranking (top_k triplets) → context assembly → LLM completion. See the concrete lookup process for each stage and how top_k and wide_search_top_k shape it.
Requires a Cypher-capable graph backend (Kuzu or Neo4j); on a backend that cannot run Cypher, such as the Postgres graph demo backend, the search raises SearchTypeNotSupported.
Generates and executes Cypher, so it requires a Cypher-capable graph backend (Kuzu or Neo4j); on a backend that cannot run Cypher, such as the Postgres graph demo backend, the search raises SearchTypeNotSupported.
Requires the resolved scope to contain exactly one dataset.
Ignores query_text — the report always covers the whole graph — and opts out of the session-turn preparation step, since there is no query to analyse.For the file-writing equivalent with its own top_n argument, see cognee.report().
See Search Basics — Advanced Parameters for retriever_specific_config usage and Retrievers for per-retriever behavior.