Skip to main content

cognee.run_custom_pipeline()

Description

Custom pipeline in Cognee, can work with already built graphs. Data needs to be provided which can be processed with provided 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: tasks: List of Cognee Tasks to execute. 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. Data rows (cognee’s Data model) are read again under the dataset lock, so tasks get their current values; rows deleted since are dropped (a selection left empty runs over no data, not the whole dataset), and a row of another dataset raises CogneeValidationError. dataset: Dataset name or dataset uuid to process. user: User context for authentication and data access. Uses default if None. vector_db_config: Custom vector database configuration for embeddings storage. graph_db_config: Custom graph database configuration for relationship storage. incremental_loading: If True, only new or modified data will be processed to avoid duplication. (Only works if data is used with the Cognee python Data model). The incremental system stores and compares hashes of processed data in the Data model and skips data with the same content hash. data_per_batch: Number of data items to be processed in parallel. 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. skip_connection_test: If True, skip the first-run LLM/embedding connection checks for this pipeline. Use for pipelines whose tasks perform no LLM or embedding calls.

Parameters

Union[List[Task], List[str]]
default:"None"
List of Task objects or task names defining the pipeline steps.
Any
default:"None"
Input data for the pipeline. Cognee Data rows are read again once the per-dataset lock is held: tasks get their current values, rows deleted in the meantime are dropped (a selection left empty runs over no data, not the whole dataset), and a row of another dataset raises CogneeValidationError. Other items pass through unchanged.
Union[str, UUID]
default:"'main_dataset'"
Dataset name or UUID.
User
default:"None"
User performing the operation.
Optional[dict]
default:"None"
Override vector database configuration.
Optional[dict]
default:"None"
Override graph database configuration.
bool
default:"False"
Skip already-processed data.
int
default:"20"
Number of data items per batch.
bool
default:"False"
If true, return immediately and process in background.
str
default:"'custom_pipeline'"
Name identifier for the pipeline run.
bool
default:"False"
Skip already-processed data. Enables the same per-document skipping as incremental_loading.
bool
default:"False"
Skip the first-run LLM and embedding connection checks, for pipelines whose tasks make no LLM or embedding calls.
use_pipeline_cache has been removed. Passing it raises a TypeError; drop the argument. A re-run skips already-processed data through incremental_loading (or data_cache) and per-document status instead — see How re-runs avoid duplicate work.

Examples

See Custom Tasks & Pipelines for a full guide.