memory

On this page

memory is the memory subsystem of the [ Zerda ] ecosystem. It provides a multi-tier memory architecture for conversational AI agents: short-lived buffers, sliding windows, LLM-generated summaries, entity tracking, vector-backed semantic recall, durable SQLite-backed long-term storage, privacy/PII controls, and a RAG-style context assembler — all orchestrated by a single high-level AIMemoryManager.

This documentation is generated directly from the memory source tree. Every signature, parameter, and behavior described here was verified against the implementation. Where the implementation's actual behavior differs from what a docstring implies, or where a bug was found, it is called out explicitly rather than silently documented as intended — see Known Issues & Bugs.

Why this package exists

Conversational agents need more than a flat list of chat turns. Different memory tiers solve different problems:

ProblemTier
"What did we just say two turns ago?"ShortTermMemory / ConversationBufferWindowMemory
"The conversation is too long for the context window"ConversationSummaryMemory
"Who is 'Sarah' and what have we discussed about her?"ConversationEntityMemory
"Find anything semantically related to this query, even from months ago"SemanticMemory
"Persist important facts across process restarts"LongTermMemory
"Don't leak the user's credit card number into a prompt"SensitiveDataMasker
"Assemble everything into a token-budgeted prompt"ContextBuilder
"Do all of the above, automatically, per user/tenant"AIMemoryManager

Where to start

[!WARNING] Documentation scope This documentation covers only what is discoverable from the memory package's own source. It does not document other zerda packages (chain, rag, router, etc.) except where memory directly imports from them.