class

Crig::Memory::DemotingPolicyMemory(M, P, H)

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

A ConversationMemory adapter that wraps a backend with a MemoryPolicy and a DemotionHook. Messages truncated by the policy flow into the hook before the active window is returned.

Concurrent load calls on the same conversation_id are serialized: only one call delivers to the hook at a time; others observe the existing watermark and return immediately.

Constructors

new(inner : M, policy : P, hook : H)
Source

Instance methods

append(conversation_id : String, messages : Array(Crig::Completion::Message)) : Nil
Source
clear(conversation_id : String) : Nil
Source
forget(conversation_id : String) : Nil
Source
hook
Source
inner
Source
into_inner
Source
load(conversation_id : String) : Array(Crig::Completion::Message)
Source
policy
Source
tracked_conversations
Source