Repository navigation
v0.22.2
·
43 commits
to develop
since this release
Added
- Borrowing history access:
Memory::with_messagesruns a visitor
closure over the stored messages without handing out an owned copy. It is
default-implemented in terms ofget_messages(one full clone), so
existingMemoryimplementors keep compiling unchanged;
SlidingWindowMemoryandTokenWindowMemoryoverride it to borrow their
storage under the lock, andTieredMemoryforwards to its conversation
sub-memory, so read-only consumers (serializing history to disk, measuring
it, rendering it) no longer pay an O(history) deep copy per call.
ErasedMemory::with_messages_erasedis the object-safe counterpart
(callers return values by writing into captured locals), also
default-implemented, and routed throughMemory::with_messagesby the
blanket impl so overriding backends keep their no-clone path through
SharedMemory.SummaryMemory,SqliteMemory, andRedisMemory
deliberately stay on the default: theirget_messagescomposes or
performs IO rather than returning a copy of borrowed storage. Additive
only — no existing API changes.