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

# memify()

> Enrich an existing knowledge graph with custom tasks

# cognee.memify()

```python theme={null}
async def memify(
    extraction_tasks: Union[List[Task], List[str]] = None,
    enrichment_tasks: Union[List[Task], List[str]] = None,
    data: Optional[Any] = None,
    dataset: Union[str, UUID] = 'main_dataset',
    user: User = None,
    node_type: Optional[Type] = NodeSet,
    node_name: Optional[List[str]] = None,
    vector_db_config: Optional[dict] = None,
    graph_db_config: Optional[dict] = None,
    run_in_background: bool = False,
)
```

## Description

Enrichment pipeline in Cognee, can work with already built graphs. If no data is provided existing knowledge graph will be used as data,
custom data can also be provided instead which can be processed with provided extraction and enrichment tasks.

Provided tasks and data will be arranged to run the Cognee pipeline and execute graph enrichment/creation.

This is the core processing step in Cognee that converts raw text and documents
into an intelligent knowledge graph. It analyzes content, extracts entities and
relationships, and creates semantic connections for enhanced search and reasoning.

Args:
extraction\_tasks: List of Cognee Tasks to execute for graph/data extraction.
enrichment\_tasks: List of Cognee Tasks to handle enrichment of provided graph/data from extraction tasks.
data: The data to ingest. Can be anything when custom extraction and enrichment tasks are used.
Data provided here will be forwarded to the first extraction task in the pipeline as input.
If no data is provided the whole graph (or subgraph if node\_name/node\_type is specified) will be forwarded
dataset: Dataset name or dataset uuid to process.
user: User context for authentication and data access. Uses default if None.
node\_type: Filter graph to specific entity types (for advanced filtering). Used when no data is provided.
node\_name: Filter graph to specific named entities (for targeted search). Used when no data is provided.
vector\_db\_config: Custom vector database configuration for embeddings storage.
graph\_db\_config: Custom graph database configuration for relationship storage.
run\_in\_background: If True, starts processing asynchronously and returns immediately.
If False, waits for completion before returning.
Background mode recommended for large datasets (>100MB).
Use pipeline\_run\_id from return value to monitor progress.

## Parameters

<ParamField path="extraction_tasks" type="Union[List[Task], List[str]]" default="None">List of Task objects or task names for graph/data extraction.</ParamField>
<ParamField path="enrichment_tasks" type="Union[List[Task], List[str]]" default="None">List of Task objects or task names for graph enrichment.</ParamField>
<ParamField path="data" type="Optional[Any]" default="None">Data to ingest. If not provided, operates on existing knowledge graph.</ParamField>
<ParamField path="dataset" type="Union[str, UUID]" default="'main_dataset'">Dataset name or UUID to operate on.</ParamField>
<ParamField path="user" type="User" default="None">User performing the operation.</ParamField>
<ParamField path="node_type" type="Optional[Type]" default="NodeSet">Filter to specific entity types in the graph.</ParamField>
<ParamField path="node_name" type="Optional[List[str]]" default="None">Filter to specific named entities.</ParamField>
<ParamField path="vector_db_config" type="Optional[dict]" default="None">Override vector database configuration.</ParamField>
<ParamField path="graph_db_config" type="Optional[dict]" default="None">Override graph database configuration.</ParamField>
<ParamField path="run_in_background" type="bool" default="False">If true, return immediately and process in background.</ParamField>

## How memify() differs from cognify()

|              | `cognify()`                         | `memify()`                                 |
| ------------ | ----------------------------------- | ------------------------------------------ |
| **Purpose**  | Build knowledge graph from raw data | Enrich an existing graph                   |
| **Input**    | Raw text/files                      | Existing graph or new data                 |
| **Pipeline** | Fixed (chunk → extract → build)     | Customizable extraction + enrichment tasks |
| **Use case** | Initial processing                  | Iterative refinement, entity consolidation |

## Examples

```python theme={null}
import cognee

# Enrich existing graph with default tasks
await cognee.memify()

# Enrich a specific dataset
await cognee.memify(dataset="my_dataset")

# Custom extraction and enrichment
from cognee.modules.pipelines import Task

await cognee.memify(
    extraction_tasks=[my_extractor_task],
    enrichment_tasks=[my_enrichment_task],
    dataset="my_dataset",
)

# Filter to specific entity types
await cognee.memify(node_name=["Person", "Organization"])
```

See the [Memify guides](/guides/memify-quickstart) for detailed walkthroughs.
