Skip to main content

Module database

Module database 

Source
Expand description

Metadata database abstraction.

Modules§

entities
migrator
ops
pipelines
sync
sync_operations repository surface.
uuid_hex
UUID ↔ 32-char hex string conversions.

Structs§

CostByModelRow
Single per-model row for GET /api/v1/sessions/cost-by-model. Parity with the Python response items at cognee/api/v1/sessions/routers/get_sessions_router.py:241-251.
DatasetConfiguration
DatasetConfigurationPatch
GraphEdge
GraphMetrics
GraphNode
NoopPipelineRunRepository
PipelineRunRepository that ignores all writes and returns empty results for reads.
Notebook
A single row from the notebooks table.
NotebookUpdatePatch
Fields that can be updated in a PUT /{notebook_id} call.
PipelineRun
PipelineRunWithAttributionRow
Row returned by PipelineRunRepository::list_recent_with_attribution.
SeaOrmCheckpointStore
SeaORM-backed implementation of CheckpointStore that writes to the graph_sync_checkpoints table.
SeaOrmPipelineRunRepository
SeaORM-backed implementation of PipelineRunRepository.
SeaOrmSyncOperationRepository
SeaORM impl of SyncOperationRepository. Cheap to clone (interior Arc).
SearchHistoryEntry
SessionListFilters
Filters for SessionLifecycleDb::list_session_rows. Field-for-field parity with Python’s list_session_rows keyword arguments at cognee/modules/session_lifecycle/metrics.py:365-374.
SessionListPage
Paginated envelope returned by list_session_rows. Parity with Python’s SessionListPage dataclass at metrics.py:351-362.
SessionRowWithStatus
Wraps a stored session_records row plus the read-time effective status (abandoned for stale running rows). Mirrors Python’s SessionRowWithStatus dataclass at cognee/modules/session_lifecycle/metrics.py:336-348.
SessionStats
Aggregate counters for GET /api/v1/sessions/stats. Field-for-field parity with the Python response body at cognee/api/v1/sessions/routers/get_sessions_router.py:179-196.
SyncOperationRow
Snapshot of one sync_operations row (every column).
TaskRun

Enums§

DatabaseConnection
Handle a database connection depending on the backend enabled by the feature flags. This creates a database pool. This will be Clone unless the feature flag mock is enabled.
DatabaseError
PipelineRunStatus
SearchHistoryEntryType
SyncOperationStatus
Status enum used by the repository surface. String values match Python’s JSON column verbatim.

Constants§

TUTORIAL_BASICS_ID
UUID5(NAMESPACE_OID, “Cognee Basics - tutorial 🧠”)
TUTORIAL_PYTHON_DEV_ID
UUID5(NAMESPACE_OID, “Python Development with Cognee - tutorial 🧠”)

Traits§

AclDb
Access control list database trait.
CheckpointStore
Abstraction over persistent timestamp checkpoints keyed by string.
DatasetConfigDb
DeleteDb
IngestDb
NotebookDb
CRUD operations for the notebooks table.
PipelineRunRepository
Persistence abstraction for pipeline run status rows.
SearchHistoryDb
SessionLifecycleDb
Repository trait for /api/v1/sessions/*. See module docs.
SyncOperationRepository
Persistence trait for the cloud sync router.

Functions§

connect
Open a connection to the relational database.
database_system_label
Map the active SeaORM backend to a cognee.db.system string matching the values used by the vector / graph adapters.
initialize
Run all pending migrations on an existing connection.
seed_tutorials_if_first_call
Seed the two tutorial notebooks for user_id if not already present.