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

# Data Models

> Key types used across the cognee API

# Data Models

Key Pydantic models and types used in the cognee Python API.

## SearchResult

Returned by `cognee.search()`.

```python theme={null}
class SearchResult:
    search_result: Any       # The actual result content
    dataset_id: UUID | None  # Associated dataset UUID
    dataset_name: str | None # Associated dataset name
```

## PipelineRunInfo

Returned by `cognee.add()`, `cognee.cognify()`, and pipeline functions.

```python theme={null}
class PipelineRunInfo:
    status: str                # Pipeline status
    pipeline_run_id: UUID      # Unique run identifier
    dataset_id: UUID           # Associated dataset
    dataset_name: str          # Dataset name
    payload: Any | None        # Execution payload
    data_ingestion_info: list | None  # Ingestion details
```

**Status values:** `PipelineRunStarted`, `PipelineRunYield`, `PipelineRunCompleted`, `PipelineRunAlreadyCompleted`, `PipelineRunErrored`

## Task

Wraps a callable for use in pipelines.

```python theme={null}
from cognee.modules.pipelines import Task

# Wrap any async generator, generator, coroutine, or function
task = Task(my_function, task_config={"batch_size": 10})
```

<ParamField path="executable" type="Callable" required>The function to execute. Can be an async generator, generator, coroutine, or regular function.</ParamField>
<ParamField path="task_config" type="dict" default="{&#x22;batch_size&#x22;: 1}">Task configuration, primarily batch size.</ParamField>

## DataPoint

The **public base class** for all user-defined graph entities. Extend `DataPoint` to create custom node types that Cognee can index, search, and connect in the knowledge graph.

```python theme={null}
class DataPoint:
    id: UUID                           # Unique identifier
    created_at: int                    # Creation timestamp (ms)
    updated_at: int                    # Update timestamp (ms)
    version: int                       # Version number
    type: str                          # Data type name
    ontology_valid: bool               # Ontology validation status
    topological_rank: int | None       # Topological rank
    belongs_to_set: list[str] | None   # Node set membership
    source_pipeline: str | None        # Source pipeline name
    source_node_set: str | None        # Source node set
```

**Key methods:** `to_json()`, `from_json()`, `to_dict()`, `from_dict()`, `update_version()`

See [DataPoints](/core-concepts/building-blocks/datapoints) and [Custom Data Models](/guides/custom-data-models) for usage details.

## KnowledgeGraph

Default graph model used by `cognify()` as an **internal LLM extraction format**. The LLM populates this structure while processing documents; it is not exported from the top-level `cognee` package and is not intended for user extension.

```python theme={null}
class KnowledgeGraph(BaseModel):
    nodes: list[Node]    # Graph nodes
    edges: list[Edge]    # Graph edges
    summary: str         # Graph summary
    description: str     # Graph description
```

<Note>
  `Node` and the `Edge` type nested inside `KnowledgeGraph` are used as internal pipeline types during extraction, rather than as user-facing extension points. For custom entities and application models, use [`DataPoint`](#datapoint) subclasses instead.
</Note>

### Node (internal)

```python theme={null}
class Node:
    id: str
    name: str
    type: str
    description: str
```

### Edge (internal)

```python theme={null}
class Edge:
    source_node_id: str
    target_node_id: str
    relationship_name: str
```

## Exceptions

All cognee exceptions inherit from `CogneeApiError`:

| Exception                  | Status Code | Use                        |
| -------------------------- | ----------- | -------------------------- |
| `CogneeSystemError`        | 500         | Internal system errors     |
| `CogneeValidationError`    | 422         | Invalid input/parameters   |
| `CogneeConfigurationError` | 500         | Misconfiguration           |
| `CogneeTransientError`     | 503         | Temporary failures (retry) |
