SearchType
Enum defining the available search modes forcognee.search().
Values
| Value | Description |
|---|---|
SearchType.SUMMARIES | Pre-generated hierarchical summaries of content. |
SearchType.CHUNKS | Raw text segments matching semantically. |
SearchType.RAG_COMPLETION | Traditional RAG: retrieve chunks, then LLM answer. |
SearchType.TRIPLET_COMPLETION | Retrieve via triplet relationships, then LLM answer. |
SearchType.GRAPH_COMPLETION | Default. Full graph context with LLM completion. (default) |
SearchType.GRAPH_SUMMARY_COMPLETION | Graph context with summary-enhanced completion. |
SearchType.CYPHER | Direct Cypher query against the graph database. |
SearchType.NATURAL_LANGUAGE | Natural language translated to Cypher. |
SearchType.GRAPH_COMPLETION_COT | Graph completion with chain-of-thought reasoning. |
SearchType.GRAPH_COMPLETION_CONTEXT_EXTENSION | Graph completion with extended context window. |
SearchType.FEELING_LUCKY | Auto-select the best search type for the query. |
SearchType.TEMPORAL | Temporal-aware search for time-sensitive queries. |
SearchType.CODING_RULES | Code-specific retrieval (coding rules, codebase search). |
SearchType.CHUNKS_LEXICAL | Token-based lexical chunk search (e.g. Jaccard similarity). |
Choosing a Search Type
I want an LLM-generated answer grounded in my data
I want an LLM-generated answer grounded in my data
Use
GRAPH_COMPLETION (default) for the best balance of accuracy and context.
Use RAG_COMPLETION for a simpler chunk-based approach.I want raw data, not an LLM answer
I want raw data, not an LLM answer
Use
CHUNKS for semantic chunk retrieval or CHUNKS_LEXICAL for keyword-based.
Use SUMMARIES for pre-generated summaries.I want to query the graph directly
I want to query the graph directly
Use
CYPHER for raw Cypher queries or NATURAL_LANGUAGE to have cognee
translate your question to Cypher.I'm not sure which to use
I'm not sure which to use
Use
FEELING_LUCKY — cognee will pick the best search type for your query.I need more accurate or comprehensive answers from the graph
I need more accurate or comprehensive answers from the graph
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.
| Mode | Strategy | Best for | Trade-off |
|---|---|---|---|
GRAPH_COMPLETION | Single-pass retrieval + completion | Most queries — good accuracy, low latency | Baseline |
GRAPH_SUMMARY_COMPLETION | Graph context condensed via summaries before completion | Noisy or large graphs where a tighter context improves coherence | Slightly slower; summary quality matters |
GRAPH_COMPLETION_COT | Iterative: retrieve → answer → validate → follow-up (up to max_iter rounds, default 4) | Complex multi-hop questions where stepwise reasoning helps | Higher latency; more LLM calls |
GRAPH_COMPLETION_CONTEXT_EXTENSION | Iterative: retrieve → generate → use output as new query (up to context_extension_rounds, default 4) | Open-ended or exploratory queries needing a broader subgraph | Higher latency; early convergence stops extra rounds |