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 vs. accuracy

The biggest cost driver is how many LLM calls a search type makes. Retrieval-only modes return matches without any generation step and are the fastest; single-completion modes add one LLM call; iterative modes make several calls and scale with their round/iteration settings. The table below orders types roughly from fastest to slowest. β€œAccuracy” here means how well-grounded and complete the answer tends to be β€” it depends on your data and query, so treat it as a relative guide, not a benchmark.
To go faster: prefer CHUNKS, SUMMARIES, or CHUNKS_LEXICAL (no LLM call), or pass only_context=True to skip the final completion on any type. To go more accurate: start with GRAPH_COMPLETION, then escalate to GRAPH_COMPLETION_DECOMPOSITION for multi-part questions or GRAPH_COMPLETION_COT for multi-hop reasoning β€” both trade latency for depth. Lowering max_iter / context_extension_rounds via retriever_specific_config reduces cost for the iterative modes. 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.
Use FEELING_LUCKY β€” cognee will pick the best search type for your query.
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.
Requires the resolved scope to contain exactly one dataset.
See Search Basics β€” Advanced Parameters for retriever_specific_config usage and Retrievers for per-retriever behavior.