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

# Tools Reference

> Complete reference for all Cognee MCP tools and operations

Cognee MCP currently exposes 14 tools for memory management, retrieval, and dataset operations.

Unless noted otherwise, parameter names and defaults below reflect the current MCP server implementation.

<Note>
  Some MCP parameters use compact transport-friendly encodings:

  * `datasets` and `session_ids` are comma-separated strings, not JSON arrays.
  * `top_k` must be between `1` and `100`.
  * `cognify.data` accepts either a single string or a JSON array of strings for batch ingestion.
</Note>

## Available Tools

<AccordionGroup>
  <Accordion title="v1.0 Memory Tools (Recommended)">
    Prefer these tools for new integrations. They map to Cognee's current main operations.

    <AccordionGroup>
      <Accordion title="`remember`">
        Store content as permanent graph memory or session memory in one call. See [Remember](/core-concepts/main-operations/remember).

        | Parameter       | Type  | Default        | Notes                                                                |
        | --------------- | ----- | -------------- | -------------------------------------------------------------------- |
        | `data`          | `str` | required       | Text to store.                                                       |
        | `dataset_name`  | `str` | `main_dataset` | Target dataset for permanent memory.                                 |
        | `session_id`    | `str` | `None`         | When set, stores in session cache instead of permanent graph memory. |
        | `custom_prompt` | `str` | `None`         | Custom extraction prompt for permanent-memory mode.                  |
      </Accordion>

      <Accordion title="`recall`">
        Retrieve memory with auto-routing and session-aware behavior. See [Recall](/core-concepts/main-operations/recall).

        | Parameter     | Type  | Default  | Notes                               |
        | ------------- | ----- | -------- | ----------------------------------- |
        | `query`       | `str` | required | Natural-language query.             |
        | `search_type` | `str` | `None`   | Optional override for auto-routing. |
        | `datasets`    | `str` | `None`   | Comma-separated dataset names.      |
        | `session_id`  | `str` | `None`   | Session-first retrieval scope.      |
        | `top_k`       | `int` | `10`     | Must be between `1` and `100`.      |
      </Accordion>

      <Accordion title="`forget`">
        Delete a dataset or wipe all memory owned by the current user. See [Forget](/core-concepts/main-operations/forget).

        | Parameter    | Type   | Default | Notes                                          |
        | ------------ | ------ | ------- | ---------------------------------------------- |
        | `dataset`    | `str`  | `None`  | Dataset name to delete.                        |
        | `everything` | `bool` | `False` | Set to `true` to delete all user-owned memory. |

        At least one of `dataset` or `everything=true` must be provided.
      </Accordion>

      <Accordion title="`improve`">
        Enrich an existing graph and optionally bridge session memory into permanent memory. See [Improve](/core-concepts/main-operations/improve).

        | Parameter      | Type  | Default        | Notes                                                           |
        | -------------- | ----- | -------------- | --------------------------------------------------------------- |
        | `dataset_name` | `str` | `main_dataset` | Dataset to enrich.                                              |
        | `session_ids`  | `str` | `None`         | Comma-separated session IDs to bridge into the permanent graph. |
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Legacy Memory Tools">
    Still available for lower-level control or existing integrations.

    <AccordionGroup>
      <Accordion title="`cognify`">
        Transform ingested data into a structured knowledge graph.

        | Parameter          | Type  | Default        | Notes                                                           |
        | ------------------ | ----- | -------------- | --------------------------------------------------------------- |
        | `data`             | `str` | required       | A single string or a JSON array of strings for batch ingestion. |
        | `dataset_name`     | `str` | `main_dataset` | Dataset to populate.                                            |
        | `graph_model_file` | `str` | `None`         | Path to a custom graph model file.                              |
        | `graph_model_name` | `str` | `None`         | Class name inside `graph_model_file`.                           |
        | `custom_prompt`    | `str` | `None`         | Custom extraction prompt.                                       |

        If `graph_model_file` is set, `graph_model_name` should also be provided.
      </Accordion>

      <Accordion title="`search`">
        Retrieve memory with explicit lower-level search control.

        | Parameter      | Type  | Default  | Notes                                                                                                              |
        | -------------- | ----- | -------- | ------------------------------------------------------------------------------------------------------------------ |
        | `search_query` | `str` | required | Natural-language query.                                                                                            |
        | `search_type`  | `str` | required | Explicit lower-level search type such as `GRAPH_COMPLETION`, `RAG_COMPLETION`, `CHUNKS`, `SUMMARIES`, or `CYPHER`. |
        | `top_k`        | `int` | `10`     | Must be between `1` and `100`.                                                                                     |
        | `datasets`     | `str` | `None`   | Comma-separated dataset names.                                                                                     |
      </Accordion>

      <Accordion title="`prune`">
        Reset the local MCP-managed store for a fresh start.

        This tool has no parameters.

        <Note>
          `prune` is not available in API mode.
        </Note>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Retrieval Context Helpers">
    Use these after retrieval when you need a fuller document view or nearby chunk context.

    <AccordionGroup>
      <Accordion title="`get_document`">
        Retrieve a source document and its chunks.

        | Parameter          | Type   | Default  | Notes                                                                         |
        | ------------------ | ------ | -------- | ----------------------------------------------------------------------------- |
        | `document_id`      | `str`  | required | Document ID. A chunk ID is also accepted and resolves to its parent document. |
        | `include_metadata` | `bool` | `True`   | Include metadata in the response.                                             |
        | `max_chunks`       | `int`  | `0`      | Use `0` to return all chunks.                                                 |
      </Accordion>

      <Accordion title="`get_chunk_neighbors`">
        Retrieve nearby chunks from the same document.

        | Parameter        | Type   | Default  | Notes                                       |
        | ---------------- | ------ | -------- | ------------------------------------------- |
        | `chunk_id`       | `str`  | required | Target chunk ID.                            |
        | `neighbor_count` | `int`  | `2`      | Number of chunks to fetch on each side.     |
        | `include_target` | `bool` | `True`   | Include the original chunk in the response. |
        | `direction`      | `str`  | `both`   | One of `both`, `forward`, or `backward`.    |
      </Accordion>
    </AccordionGroup>

    <Note>
      `get_document` and `get_chunk_neighbors` are not available in API mode.
    </Note>
  </Accordion>

  <Accordion title="Interaction Capture">
    <AccordionGroup>
      <Accordion title="`save_interaction`">
        Store a user-assistant exchange so Cognee can process it into memory and related rules.

        | Parameter | Type  | Default  | Notes                          |
        | --------- | ----- | -------- | ------------------------------ |
        | `data`    | `str` | required | Interaction content to ingest. |
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Data Management">
    <AccordionGroup>
      <Accordion title="`list_data`">
        List datasets and their data items with IDs for deletion operations.

        | Parameter    | Type  | Default | Notes                                                    |
        | ------------ | ----- | ------- | -------------------------------------------------------- |
        | `dataset_id` | `str` | `None`  | Optional dataset UUID. When omitted, lists all datasets. |
      </Accordion>

      <Accordion title="`delete`">
        Remove a specific data item from a dataset.

        | Parameter    | Type  | Default  | Notes                             |
        | ------------ | ----- | -------- | --------------------------------- |
        | `data_id`    | `str` | required | Data item UUID.                   |
        | `dataset_id` | `str` | required | Dataset UUID containing the item. |
        | `mode`       | `str` | `soft`   | Either `soft` or `hard`.          |
      </Accordion>

      <Accordion title="`delete_dataset`">
        Delete an entire dataset by name.

        | Parameter      | Type  | Default  | Notes                   |
        | -------------- | ----- | -------- | ----------------------- |
        | `dataset_name` | `str` | required | Dataset name to delete. |
      </Accordion>

      <Accordion title="`cognify_status`">
        Check current and recent pipeline runs for a dataset.

        | Parameter      | Type        | Default                | Notes                                                        |
        | -------------- | ----------- | ---------------------- | ------------------------------------------------------------ |
        | `dataset_name` | `str`       | `main_dataset`         | Dataset to inspect.                                          |
        | `pipelines`    | `list[str]` | `["cognify_pipeline"]` | Optional list of pipeline names to restrict the status view. |
      </Accordion>
    </AccordionGroup>

    <Note>
      `delete_dataset` and `cognify_status` are not available in API mode. `list_data(dataset_id=...)` also requires direct mode for detailed per-item listing.
    </Note>
  </Accordion>
</AccordionGroup>

## Usage Notes

* For new integrations, start with `remember` to store data and `recall` to retrieve it.
* Use `improve` when you want to enrich an existing graph or bridge session memory into permanent memory.
* Use `forget` to remove a dataset or wipe all memory owned by the current user.
* Reach for `cognify`, `search`, and `prune` only when you need lower-level control or are maintaining an older workflow.
* Use `get_document` or `get_chunk_neighbors` after a `CHUNKS` result when the initial match is too narrow.
* Use `cognify_status` to verify indexing before querying a freshly processed dataset.

## Next Steps

<Card title="Client Integrations" href="/cognee-mcp/integrations" icon="code">
  Learn how to use these tools with your AI development environment
</Card>
