Skip to main content

Crate cognee_session

Crate cognee_session 

Source
Expand description

Session management and QA-history storage for Cognee.

Tracks search/answer history and feedback per session so retrieval can use prior context. Trait-based so the store backend is pluggable.

  • SessionStore — async trait for session persistence
  • FsSessionStore (feature fs), RedisSessionStore, SeaOrmSessionStore — the backing implementations

Structs§

ImproveLockGuard
RAII guard that releases the improve-lock on drop.
SessionContext
Session context passed to retrievers: the session ID and any loaded conversation history (as LLM messages).
SessionManager
Orchestrates session operations using an Arc<dyn SessionStore>.
SessionQAEntry
A single question-answer entry stored in a session.
SessionQAUpdate
Partial update DTO for a QA entry.
SessionTraceStep
One agent-trace step persisted in a session — mirrors Python’s SessionAgentTraceEntry (no created_at; ordering is positional).
UsedGraphElementIds
Graph element IDs that were used to produce the answer for a Q&A entry.

Enums§

SessionError

Traits§

SessionStore
Abstraction over session Q&A storage backends (SQLite, Redis, filesystem, etc.).

Functions§

release_improve_lock
Release the improve-lock for session_id. Idempotent.
try_acquire_improve_lock
Atomically claim the improve-lock for session_id.