class

Crig::Memory::InMemoryConversationMemory

Inherits Crig::Memory::ConversationMemory < Reference < Object

A simple thread-safe in-memory ConversationMemory backed by a Hash.

Messages are stored in process memory only and lost on restart.

Constructors

Instance methods

append(conversation_id : String, messages : Array(Crig::Completion::Message)) : Nil

Append messages to the conversation identified by conversation_id.

Source
clear(conversation_id : String) : Nil

Remove all stored messages for conversation_id.

Source
load(conversation_id : String) : Array(Crig::Completion::Message)

Load the full conversation history for conversation_id. Returns an empty Array if the conversation has no stored messages.

Source
with_filter(filter : MessageFilter) : self

Apply a filter to the loaded message list on every load.

Source