Skip to main content

Module session_record

Module session_record 

Source
Expand description

SeaORM entity for the session_records table (LIB-03).

Mirrors Python’s SessionRecord SQLAlchemy model at cognee/modules/session_lifecycle/models.py:10-86 byte-for-byte:

  • Composite primary key on (session_id, user_id).
  • status defaults to "running". The "abandoned" value is never written to the row — it is inferred at read time by LIB-05’s effective_status SQL expression based on last_activity_at.
  • Aggregate counters (tokens_in, tokens_out, cost_usd, error_count) accumulate via LLMGateway / SessionManager hooks.

UUIDs (user_id, dataset_id) are persisted as 32-char hex strings to match the rest of the schema (see uuid_hex.rs); LIB-05’s trait converts uuid::UuidString at the repository boundary.

Structs§

ActiveModel
Generated by sea-orm-macros
ColumnIter
An iterator over the variants of Column
Entity
Generated by sea-orm-macros
Model
PrimaryKeyIter
An iterator over the variants of PrimaryKey
RelationIter
An iterator over the variants of Relation

Enums§

Column
Generated by sea-orm-macros
PrimaryKey
Generated by sea-orm-macros
Relation