Data Models
Key Pydantic models and types used in the cognee Python API.SearchResult
Returned bycognee.search().
PipelineRunInfo
Returned bycognee.add(), cognee.cognify(), and pipeline functions.
PipelineRunStarted, PipelineRunYield, PipelineRunCompleted, PipelineRunAlreadyCompleted, PipelineRunErrored
Task
Wraps a callable for use in pipelines.The function to execute. Can be an async generator, generator, coroutine, or regular function.
Task configuration, primarily batch size.
DataPoint
The public base class for all user-defined graph entities. ExtendDataPoint to create custom node types that Cognee can index, search, and connect in the knowledge graph.
to_json(), from_json(), to_dict(), from_dict(), update_version()
See DataPoints and Custom Data Models for usage details.
KnowledgeGraph
Default graph model used bycognify() 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.
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 subclasses instead.Node (internal)
Edge (internal)
Exceptions
All cognee exceptions inherit fromCogneeApiError:
| Exception | Status Code | Use |
|---|---|---|
CogneeSystemError | 500 | Internal system errors |
CogneeValidationError | 422 | Invalid input/parameters |
CogneeConfigurationError | 500 | Misconfiguration |
CogneeTransientError | 503 | Temporary failures (retry) |