Skip to main content

Module memory

Module memory 

Source
Expand description

Conversation memory — store and retrieve message history per session.

The Memory trait defines async operations for loading, saving, and appending messages. InMemoryStore keeps everything in a parking_lot::RwLock<HashMap>, while SlidingWindowMemory wraps any Memory and trims to a maximum message count.

Structs§

InMemoryStore
A simple in-process memory store backed by a RwLock<HashMap>.
SlidingWindowMemory
Wraps any Memory and limits the stored history to the last max_messages non-system entries (always preserving a leading system message in addition to that limit).

Traits§

Memory
Async conversation memory backend.