Skip to main content

Module longterm_memory

Module longterm_memory 

Source
Expand description

Session persistence and cross-session history diffusion.

Two trait-based extension points:

TraitRole
SessionStorePersist / load full chat sessions to disk
HistoryStrategyBlend past session content into the current chat prompt

Both operate on the same Turn atom — no duplicate data model.

Structs§

LogHistory
Concatenates the most recent session’s turns into a plain transcript block.
SessionConfig
Snapshot of every hot‑swappable setting at the moment a turn was recorded.
SessionData
The full serialisable payload for one session.
SessionId
Unique identifier for a session.
SessionManifest
Lightweight metadata for listing sessions (no turn payload).
SummaryHistory
Summarises past sessions via an LLM agent (Generator).
Turn
A single conversation turn. Used by both the in‑session memory layer (last N turns for context windows) and the persistence layer (all turns saved to disk).
TurnPairs
Convenience conversion from turns to role/text pairs.
TurnPerf
Performance data for a single assistant turn.

Enums§

MemoryStrategyKind
Memory strategy used during a session.
TurnRole
The speaker of a conversation turn.

Traits§

HistoryStrategy
Controls how past session content influences the current chat prompt.
SessionStore
Pluggable persistence for chat sessions.