Skip to main content

SearchType

Enum defining the available search modes for cognee.search().
from cognee import SearchType

results = await cognee.search("query", query_type=SearchType.GRAPH_COMPLETION)

Values

ValueDescription
SearchType.SUMMARIESPre-generated hierarchical summaries of content.
SearchType.CHUNKSRaw text segments matching semantically.
SearchType.RAG_COMPLETIONTraditional RAG: retrieve chunks, then LLM answer.
SearchType.TRIPLET_COMPLETIONRetrieve via triplet relationships, then LLM answer.
SearchType.GRAPH_COMPLETIONDefault. Full graph context with LLM completion. (default)
SearchType.GRAPH_SUMMARY_COMPLETIONGraph context with summary-enhanced completion.
SearchType.CYPHERDirect Cypher query against the graph database.
SearchType.NATURAL_LANGUAGENatural language translated to Cypher.
SearchType.GRAPH_COMPLETION_COTGraph completion with chain-of-thought reasoning.
SearchType.GRAPH_COMPLETION_CONTEXT_EXTENSIONGraph completion with extended context window.
SearchType.FEELING_LUCKYAuto-select the best search type for the query.
SearchType.TEMPORALTemporal-aware search for time-sensitive queries.
SearchType.CODING_RULESCode-specific retrieval (coding rules, codebase search).
SearchType.CHUNKS_LEXICALToken-based lexical chunk search (e.g. Jaccard similarity).

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:
ModeStrategyBest forTrade-off
GRAPH_COMPLETIONSingle-pass retrieval + completionMost queries — good accuracy, low latencyBaseline
GRAPH_SUMMARY_COMPLETIONGraph context condensed via summaries before completionNoisy or large graphs where a tighter context improves coherenceSlightly slower; summary quality matters
GRAPH_COMPLETION_COTIterative: retrieve → answer → validate → follow-up (up to max_iter rounds, default 4)Complex multi-hop questions where stepwise reasoning helpsHigher latency; more LLM calls
GRAPH_COMPLETION_CONTEXT_EXTENSIONIterative: retrieve → generate → use output as new query (up to context_extension_rounds, default 4)Open-ended or exploratory queries needing a broader subgraphHigher latency; early convergence stops extra rounds
See Search Basics — Advanced Parameters and Retrievers for full details.