Public surface for Cogtrix’s hybrid memory subsystem — rolling summary, semantic recall, and three working modes.
src.memory.base
Abstract base classes that define the memory contract. Extend these to plug in a custom memory backend (e.g. a Redis-backed store).
Key types:
MemoryStore— abstract interface for read/write/clear of session history.MemoryEntry— the canonical message record (role, content, timestamp, tool calls).
src.memory.manager
Coordinates the three memory layers — working window, rolling summary, semantic recall — and exposes a single API to the agent.
Key callables:
MemoryManager.add(message)— append a turn.MemoryManager.recall(query, k=...)— semantic recall.MemoryManager.compact()— summarise old turns in place.MemoryManager.snapshot()— serialise to disk.
src.memory.factory
Constructs the right MemoryManager for a given mode. The factory inspects the config’s memory.mode field and assembles the matching pipeline.
src.memory.facts
Mode-specific fact tracking — files touched (code mode), goals (reasoning mode), entities (conversation mode). Stored alongside the message log but queryable separately.
src.memory.recall
The semantic-recall layer. Embeds turn content into the vector DB at write time, queries by similarity at recall time. Embedding provider is configurable.