> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SearchType

> All available search modes

# SearchType

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

```python theme={null}
from cognee import SearchType

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

## 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.

| Value                                           | Retrieval source | Description                                                                                                                |
| ----------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `SearchType.SUMMARIES`                          | Vector           | Pre-generated hierarchical summaries of content.                                                                           |
| `SearchType.CHUNKS`                             | Vector           | Raw text segments matching semantically.                                                                                   |
| `SearchType.CHUNKS_LEXICAL`                     | Lexical          | Token-based lexical chunk search (BM25-style keyword ranking, no embeddings).                                              |
| `SearchType.RAG_COMPLETION`                     | Vector           | Traditional RAG: retrieve chunks by semantic similarity, then LLM answer.                                                  |
| `SearchType.HYBRID_COMPLETION`                  | Vector + Graph   | Hybrid answer combining lexical chunks, semantic chunks, and graph/entity context.                                         |
| `SearchType.TRIPLET_COMPLETION`                 | Vector           | Semantic search over triplet embeddings, then LLM answer (needs `TRIPLET_EMBEDDING=true`).                                 |
| `SearchType.GRAPH_COMPLETION`                   | Vector + Graph   | **Default.** Semantic seeds expanded into graph context, then LLM completion.                                              |
| `SearchType.GRAPH_COMPLETION_DECOMPOSITION`     | Vector + Graph   | Decomposes a complex query into focused subqueries, retrieves graph context per subquery, then synthesizes a final answer. |
| `SearchType.GRAPH_SUMMARY_COMPLETION`           | Vector + Graph   | Graph context condensed via summaries before completion.                                                                   |
| `SearchType.GRAPH_COMPLETION_COT`               | Vector + Graph   | Graph completion with iterative chain-of-thought reasoning.                                                                |
| `SearchType.GRAPH_COMPLETION_CONTEXT_EXTENSION` | Vector + Graph   | Graph completion that iteratively feeds each answer back as a new query to widen subgraph coverage.                        |
| `SearchType.TEMPORAL`                           | Vector + Graph   | Time-aware search: extracts time constraints, then combines graph events with semantic retrieval.                          |
| `SearchType.CYPHER`                             | Graph            | Direct Cypher query against the graph database.                                                                            |
| `SearchType.NATURAL_LANGUAGE`                   | Graph            | Natural language translated to Cypher, then executed against the graph.                                                    |
| `SearchType.CODING_RULES`                       | Graph            | Retrieves coding rules stored in a graph node set.                                                                         |
| `SearchType.AGENTIC_COMPLETION`                 | Varies           | Agentic completion that chooses sources via skills and tools.                                                              |
| `SearchType.FEELING_LUCKY`                      | Varies           | Auto-selects the best search type (and its source) for the query.                                                          |

## 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                                            |
| `HYBRID_COMPLETION`                  | 1                                                                          | 🟢 Fast        | High — chunk + graph context   | Questions that benefit from lexical, semantic, and graph evidence together |
| `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                                                 |
| `AGENTIC_COMPLETION`                 | varies (up to `max_iter`, default 6)                                       | 🔴 Slowest     | Tool- and skill-assisted       | Single-dataset agentic retrieval with skills/tools                         |
| `FEELING_LUCKY`                      | 1 (selection) + chosen type                                                | Varies         | Matches chosen type            | One-off queries when unsure which to use                                   |

<Note>
  **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](/guides/search-basics#advanced-parameters).
</Note>

## Choosing a Search Type

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="I want to query the graph directly">
    Use `CYPHER` for raw Cypher queries or `NATURAL_LANGUAGE` to have cognee
    translate your question to Cypher.
  </Accordion>

  <Accordion title="I'm not sure which to use">
    Use `FEELING_LUCKY` — cognee will pick the best search type for your query.
  </Accordion>

  <Accordion title="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:

    | 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          |

    See [Search Basics — Advanced Parameters](/guides/search-basics#advanced-parameters) and [Retrievers](/core-concepts/main-operations/legacy-operations/search#retrievers) for full details.
  </Accordion>
</AccordionGroup>

## 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](/guides/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.

<AccordionGroup>
  <Accordion title="SUMMARIES">
    | Parameter | Type | Default | Explanation                                                       |
    | --------- | ---- | ------- | ----------------------------------------------------------------- |
    | —         | —    | —       | No `retriever_specific_config` keys. Uses common parameters only. |
  </Accordion>

  <Accordion title="CHUNKS">
    | Parameter                   | Type                | Default | Explanation                                                                 |
    | --------------------------- | ------------------- | ------- | --------------------------------------------------------------------------- |
    | `node_name`                 | `list[str] \| None` | `None`  | Common parameter used to filter chunks by node set.                         |
    | `node_name_filter_operator` | `"OR" \| "AND"`     | `"OR"`  | Common parameter controlling how multiple `node_name` filters are combined. |
  </Accordion>

  <Accordion title="CHUNKS_LEXICAL">
    | Parameter | Type | Default | Explanation                                                       |
    | --------- | ---- | ------- | ----------------------------------------------------------------- |
    | —         | —    | —       | No `retriever_specific_config` keys. Uses common parameters only. |
  </Accordion>

  <Accordion title="RAG_COMPLETION">
    | Parameter                   | Type                | Default | Explanation                                                                 |
    | --------------------------- | ------------------- | ------- | --------------------------------------------------------------------------- |
    | `response_model`            | `type`              | `str`   | Output type or Pydantic model for the completion response.                  |
    | `node_name`                 | `list[str] \| None` | `None`  | Common parameter used to filter chunks by node set.                         |
    | `node_name_filter_operator` | `"OR" \| "AND"`     | `"OR"`  | Common parameter controlling how multiple `node_name` filters are combined. |
  </Accordion>

  <Accordion title="HYBRID_COMPLETION">
    | Parameter                      | Type          | Default | Explanation                                                         |
    | ------------------------------ | ------------- | ------- | ------------------------------------------------------------------- |
    | `response_model`               | `type`        | `str`   | Output type or Pydantic model for the completion response.          |
    | `chunks_top_k`                 | `int`         | `top_k` | Max merged lexical and semantic chunks included in context.         |
    | `entities_top_k`               | `int`         | `top_k` | Number of matched entities used for graph context.                  |
    | `max_edges_per_entity`         | `int`         | `10`    | Max connected edges listed per entity.                              |
    | `facts_top_k`                  | `int`         | `top_k` | Max edge-derived facts included in the related facts context.       |
    | `include_global_context_index` | `bool`        | `False` | Adds global-context summaries to the retrieved context.             |
    | `global_context_index_top_k`   | `int`         | `3`     | Number of global-context summaries to include when enabled.         |
    | `text_summaries_top_k`         | `int \| None` | `None`  | Optional limit for text summaries included by the hybrid retriever. |
    | `use_importance_weight`        | `bool`        | `True`  | Applies importance weighting when ranking hybrid context.           |
  </Accordion>

  <Accordion title="TRIPLET_COMPLETION">
    | Parameter                   | Type                | Default | Explanation                                                                 |
    | --------------------------- | ------------------- | ------- | --------------------------------------------------------------------------- |
    | `response_model`            | `type`              | `str`   | Output type or Pydantic model for the completion response.                  |
    | `node_name`                 | `list[str] \| None` | `None`  | Common parameter used to filter triplets by node set.                       |
    | `node_name_filter_operator` | `"OR" \| "AND"`     | `"OR"`  | Common parameter controlling how multiple `node_name` filters are combined. |
  </Accordion>

  <Accordion title="GRAPH_COMPLETION">
    | Parameter                      | Type   | Default | Explanation                                                   |
    | ------------------------------ | ------ | ------- | ------------------------------------------------------------- |
    | `response_model`               | `type` | `str`   | Output type or Pydantic model for the completion response.    |
    | `include_global_context_index` | `bool` | `False` | Adds global-context summaries to the retrieved graph context. |
    | `global_context_index_top_k`   | `int`  | `3`     | Number of global-context summaries to include when enabled.   |
  </Accordion>

  <Accordion title="GRAPH_COMPLETION_DECOMPOSITION">
    | Parameter            | Type                                                   | Default                 | Explanation                                                                                                         |
    | -------------------- | ------------------------------------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
    | `response_model`     | `type`                                                 | `str`                   | Output type or Pydantic model for the completion response.                                                          |
    | `decomposition_mode` | `"answer_per_subquery" \| "combined_triplets_context"` | `"answer_per_subquery"` | Controls whether each subquery is answered separately or all retrieved triplets are merged before the final answer. |
  </Accordion>

  <Accordion title="GRAPH_SUMMARY_COMPLETION">
    | Parameter               | Type  | Default                          | Explanation                                                    |
    | ----------------------- | ----- | -------------------------------- | -------------------------------------------------------------- |
    | `summarize_prompt_path` | `str` | `"summarize_search_results.txt"` | Prompt file used to summarize graph context before completion. |
  </Accordion>

  <Accordion title="GRAPH_COMPLETION_COT">
    | Parameter                       | Type   | Default                              | Explanation                                                       |
    | ------------------------------- | ------ | ------------------------------------ | ----------------------------------------------------------------- |
    | `max_iter`                      | `int`  | `4`                                  | Number of follow-up reasoning rounds after the initial retrieval. |
    | `response_model`                | `type` | `str`                                | Output type or Pydantic model for the completion response.        |
    | `validation_system_prompt_path` | `str`  | `"cot_validation_system_prompt.txt"` | System prompt used to validate the current answer.                |
    | `validation_user_prompt_path`   | `str`  | `"cot_validation_user_prompt.txt"`   | User prompt used to validate the current answer.                  |
    | `followup_system_prompt_path`   | `str`  | `"cot_followup_system_prompt.txt"`   | System prompt used to generate follow-up questions.               |
    | `followup_user_prompt_path`     | `str`  | `"cot_followup_user_prompt.txt"`     | User prompt used to generate follow-up questions.                 |
  </Accordion>

  <Accordion title="GRAPH_COMPLETION_CONTEXT_EXTENSION">
    | Parameter                  | Type   | Default | Explanation                                                                      |
    | -------------------------- | ------ | ------- | -------------------------------------------------------------------------------- |
    | `context_extension_rounds` | `int`  | `4`     | Max rounds for extending context by using the previous output as the next query. |
    | `response_model`           | `type` | `str`   | Output type or Pydantic model for the completion response.                       |
  </Accordion>

  <Accordion title="TEMPORAL">
    | Parameter                     | Type   | Default                            | Explanation                                                         |
    | ----------------------------- | ------ | ---------------------------------- | ------------------------------------------------------------------- |
    | `response_model`              | `type` | `str`                              | Output type or Pydantic model for the completion response.          |
    | `user_prompt_path`            | `str`  | `"graph_context_for_question.txt"` | Prompt file used to format temporal graph context for the question. |
    | `system_prompt_path`          | `str`  | `"answer_simple_question.txt"`     | System prompt file used for the final answer.                       |
    | `time_extraction_prompt_path` | `str`  | `"extract_query_time.txt"`         | Prompt file used to extract temporal constraints from the query.    |
  </Accordion>

  <Accordion title="CYPHER">
    | Parameter            | Type  | Default                        | Explanation                                    |
    | -------------------- | ----- | ------------------------------ | ---------------------------------------------- |
    | `user_prompt_path`   | `str` | `"context_for_question.txt"`   | Prompt file used to format Cypher results.     |
    | `system_prompt_path` | `str` | `"answer_simple_question.txt"` | System prompt file used for result formatting. |
  </Accordion>

  <Accordion title="NATURAL_LANGUAGE">
    | Parameter            | Type  | Default                                   | Explanation                                                      |
    | -------------------- | ----- | ----------------------------------------- | ---------------------------------------------------------------- |
    | `system_prompt_path` | `str` | `"natural_language_retriever_system.txt"` | System prompt file used to translate natural language to Cypher. |
    | `max_attempts`       | `int` | `3`                                       | Max attempts to generate and run a useful graph query.           |
  </Accordion>

  <Accordion title="CODING_RULES">
    | Parameter   | Type                | Default | Explanation                                                     |
    | ----------- | ------------------- | ------- | --------------------------------------------------------------- |
    | `node_name` | `list[str] \| None` | `None`  | Common parameter interpreted as the coding-rules node set name. |
  </Accordion>

  <Accordion title="AGENTIC_COMPLETION">
    Requires the resolved scope to contain exactly one dataset.

    | Parameter                    | Type                         | Default                | Explanation                                                        |
    | ---------------------------- | ---------------------------- | ---------------------- | ------------------------------------------------------------------ |
    | `skills`                     | `list[str \| Skill] \| None` | `None`                 | Skill names or `Skill` objects to load into the agentic retriever. |
    | `tools`                      | `list[str] \| None`          | `None`                 | Optional whitelist of tool names available to the agent.           |
    | `max_iter`                   | `int`                        | `6`                    | Max tool-call iterations before forcing a final answer.            |
    | `agentic_system_prompt_path` | `str`                        | `"agentic_system.txt"` | System prompt file used inside the agent loop.                     |
    | `agentic_user_prompt_path`   | `str`                        | `"agentic_user.txt"`   | User prompt file used inside the agent loop.                       |
    | `response_model`             | `type`                       | `str`                  | Output type or Pydantic model for the final response.              |
  </Accordion>

  <Accordion title="FEELING_LUCKY">
    | Parameter | Type | Default | Explanation                                                                                                     |
    | --------- | ---- | ------- | --------------------------------------------------------------------------------------------------------------- |
    | —         | —    | —       | No direct `retriever_specific_config` keys. It selects another search type and inherits that type's parameters. |
  </Accordion>
</AccordionGroup>

```python theme={null}
# Example: tune the chain-of-thought depth and request typed output
await cognee.recall(
    query_text="How did the incident propagate across services?",
    query_type=SearchType.GRAPH_COMPLETION_COT,
    retriever_specific_config={"max_iter": 2},
)
```

See [Search Basics — Advanced Parameters](/guides/search-basics#advanced-parameters) for `retriever_specific_config` usage and [Retrievers](/core-concepts/main-operations/legacy-operations/search#retrievers) for per-retriever behavior.
