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_COMPLETION_DECOMPOSITION | Decomposes a complex query into focused subqueries, retrieves graph context per subquery, then synthesizes a final answer. |
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). |
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.| Search type | LLM calls | Relative speed | Accuracy / depth | Best for |
|---|---|---|---|---|
CHUNKS | 0 | ⚡️ Fastest | Raw passages, no synthesis | Display or post-process exact snippets |
CHUNKS_LEXICAL | 0 | ⚡️ Fastest | Keyword match, no synthesis | Exact-term / stopword-aware lookups |
SUMMARIES | 0 | ⚡️ Fastest | Precomputed summaries | Short, high-signal hits |
CYPHER | 0 | ⚡️ Fastest | Exact graph rows | You know the schema and write the query |
RAG_COMPLETION | 1 | 🟢 Fast | Good, text-only | Simple chunk-based RAG without graph structure |
GRAPH_COMPLETION (default) | 1 | 🟢 Fast | High — graph-grounded | Best balance for most questions |
TRIPLET_COMPLETION | 1 | 🟢 Fast | High — triplet-level | Triplet context (needs TRIPLET_EMBEDDING=true) |
NATURAL_LANGUAGE | 1 query-generation call, retries up to 2 more times on empty/error results | 🟡 Medium | Exact graph rows | Structured graph answers without writing Cypher |
TEMPORAL | 1 time-extraction call + answer completion | 🟡 Medium | Time-aware | ”before/after X”, year ranges, timelines |
GRAPH_SUMMARY_COMPLETION | 2 (summary + answer) | 🟡 Medium | High, condensed | Noisy/large graphs needing a tighter context |
GRAPH_COMPLETION_DECOMPOSITION | several (1 split + up to 5 subqueries + synthesis) | 🟠 Slower | Higher on multi-part questions | Multi-entity / multi-aspect questions |
GRAPH_COMPLETION_CONTEXT_EXTENSION | several (up to context_extension_rounds, default 4) | 🔴 Slowest | Broader subgraph coverage | Open-ended, exploratory queries |
GRAPH_COMPLETION_COT | many (up to max_iter rounds, default 4, several calls each) | 🔴 Slowest | Highest on multi-hop reasoning | Complex A → B → C chains |
FEELING_LUCKY | 1 (selection) + chosen type | Varies | Matches chosen type | One-off queries when unsure which to use |
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
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_COMPLETION_DECOMPOSITION | Decomposes query into 1–5 subqueries, retrieves graph context per subquery, then synthesizes a final answer | Multi-entity or multi-aspect questions (e.g. “Tell me about A and B”) | One extra LLM call for decomposition; slightly higher latency |
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 |