| title | Memory Implementations |
|---|
This document lists the memory classes exported by multimind.memory, what state each one is actually in, and how to use the ones that work. Every class below is importable from multimind.memory; the lightweight ones are imported eagerly and the rest resolve lazily on first access.
All memory classes derive from BaseMemory, whose contract is five async methods: add_message(message), get_messages(), clear(), save() and load(). A class that does not implement all five is abstract and raises TypeError: Can't instantiate abstract class ... when constructed. Those classes are listed separately below as scaffolds; their constructor signatures and helper methods exist, but you cannot use them without subclassing.
For the authoritative stable/beta/planned status, see feature-status.md.
| Extra | Needed for |
|---|---|
| none (core install) | BufferMemory, BufferWindowMemory, SummaryMemory, SummaryBufferMemory, TokenAwareMemory, EntityMemory, TimeWeightedMemory, HierarchicalMemory, EpisodicMemory, SemanticMemory, ProceduralMemory, AssociativeMemory, EmotionalMemory, DeclarativeMemory, SpatialMemory, TemporalMemory, SensoryMemory, VersionedMemory, EventSourcedMemory, CognitiveScratchpadMemory, ActiveLearningMemory, ConsensusMemory, ReinforcementMemory, GenerativeMemory, ChatMemory, SimpleMemory, CombinedMemory, ReadOnlyMemory, SQLAlchemyMemory |
pip install "multimind-sdk[memory]" (redis, numpy, networkx) |
VectorStoreMemory, KnowledgeGraphMemory, HybridMemory, ContextualMemory, WorkingMemory, ForgettingCurveMemory, NoveltyMemory, DNCMemory, ImplicitMemory, PlanningMemory, RedisMemory, plus the scaffolds that need numpy |
pip install "multimind-sdk[finetune]" (torch) |
FastWeightMemory, AdapterMemory, FederatedMemory, BayesianMemory, AdvancedMemory |
These classes implement the full BaseMemory contract and can be instantiated directly. Most of the LLM-backed ones take a BaseLLM instance (for example OpenAIModel) as their first argument and call it for summarization, routing or extraction.
BufferMemory(memory_key="chat_history", max_tokens=2000, max_messages=None, strategy="sliding", ...)- stores conversation history with sliding/FIFO/LRU pruningBufferWindowMemory(window_size=10, window_type="count", ...)- sliding window of recent messagesSummaryBufferMemory(max_messages=None, max_tokens=None, summary_interval=10, ...)- buffer plus periodic summariesTokenAwareMemory- token-budgeted historyTimeWeightedMemory(decay_rate=0.1, ...)- time-decayed relevanceEntityMemory(entity_types=None, relationship_types=None, ...)- entity and relationship trackingChatMemory,SimpleMemory,CombinedMemory,ReadOnlyMemory- small utility memoriesSQLAlchemyMemory,RedisMemory- persistence-backed buffers (RedisMemoryneeds thememoryextra)
SummaryMemory(llm, ...)- summarized conversation historyVectorStoreMemory(llm, vector_store_config=None, similarity_threshold=0.7, ...)- embedding-based similarity retrieval over a FAISS store by defaultKnowledgeGraphMemory(llm, ...)- graph of entities and relations (needs networkx)HybridMemory(llm, memory_types=None, routing_threshold=0.7, ...)- routes each message to the best of several child memoriesHierarchicalMemory(llm, ...),ContextualMemory(llm, ...),EpisodicMemory(llm, ...),SemanticMemory(llm, ...),ProceduralMemory(llm, ...),WorkingMemory(llm, ...),AssociativeMemory(llm, ...),EmotionalMemory(llm, ...),DeclarativeMemory(llm, ...),SpatialMemory(llm, ...),TemporalMemory(llm, ...),SensoryMemory(llm, ...),ForgettingCurveMemory(llm, ...),NoveltyMemory(llm, ...),VersionedMemory(llm, ...),EventSourcedMemory(llm, ...),CognitiveScratchpadMemory(llm, ...),ActiveLearningMemory(llm, ...),DNCMemory(llm, ...)
ImplicitMemory(skill_decay=0.95, max_skills=1000, ...)- skill tracking with prerequisite graphConsensusMemory(node_id, nodes=None, ...)- local in-process replication with majority-vote reads; networked RAFT (elections, RPCs) is not implemented and raisesNotImplementedErrorReinforcementMemory(total_budget=1000, ...)- tabular Q-learning for keep/evict/compress budgetingPlanningMemory(similarity_threshold=0.8, ...)- plan-step recording with success-weighted next-step suggestionsGenerativeMemory- regeneration bookkeeping with a caller-supplied generator
The following classes exist and expose their own methods (for example add_memory / get_memory on the quantum classes), but they do not implement add_message, get_messages, clear, save and/or load from BaseMemory. Constructing them raises TypeError. Treat them as starting points for a subclass, not as usable memories.
| Class | Notes |
|---|---|
TokenBufferMemory |
token-count buffer; missing save/load |
MetaMemory(base_memory, ...) |
memory about memories |
SketchMemory |
count-min sketch / bloom-filter approximate storage |
CausalMemory |
causal relationship store |
NeuroSymbolicMemory |
neural + symbolic hybrid |
AutobiographicalMemory |
self-referential event memory |
ProspectiveMemory |
reminders / intentions |
ExplicitMemory |
fact store |
AdaptiveMemory |
self-tuning context size |
HTMMemory(input_size=1024, num_columns=2048, ...) |
hierarchical temporal memory |
SpikingMemory |
neuromorphic spiking network with STDP |
BayesianMemory |
nonparametric Bayesian clustering (needs torch) |
QRAM, QAM, TopologicalMemory, QuantumClassicalHybridMemory |
classical simulations of quantum memory designs, not quantum hardware |
FastWeightMemory, AdapterMemory, FederatedMemory |
torch-based (finetune extra); implement add_memory/get_memory only |
Nothing in the package implements holographic, DNA or neuromorphic-quantum memory. There are no ShortTermMemory or LongTermMemory classes; use BufferMemory / BufferWindowMemory for short-term history and VectorStoreMemory or SQLAlchemyMemory for durable storage.
import asyncio
from multimind import OpenAIModel
from multimind.memory import BufferMemory, VectorStoreMemory, HybridMemory, SummaryMemory
model = OpenAIModel(model_name="gpt-4o-mini") # reads OPENAI_API_KEY
async def main():
# Plain conversation buffer (no LLM calls)
conv_memory = BufferMemory()
await conv_memory.add_message({"role": "user", "content": "This is an example memory"})
print(await conv_memory.get_messages())
# Vector store memory (requires multimind-sdk[memory]; embeds via the model)
vector_memory = VectorStoreMemory(llm=model)
# Summary memory (calls the model to summarize older turns)
summary_memory = SummaryMemory(llm=model)
# Hybrid memory routes each message to the best child memory (uses the model)
hybrid_memory = HybridMemory(
llm=model,
memory_types=[BufferMemory, VectorStoreMemory],
)
await hybrid_memory.add_message({"role": "user", "content": "Remember that I prefer Python."})
print(await hybrid_memory.get_messages())
asyncio.run(main())Agents use a separate, simpler multimind.agents.AgentMemory(max_history=100) for task/response history; see rag.md.
-
Memory Selection
- Start with
BufferMemory; addSummaryMemoryorVectorStoreMemoryonly when history outgrows the context window - Check the extras table above before importing a memory type
- Do not rely on the scaffold classes in production code
- Start with
-
Memory Configuration
VectorStoreMemorydefaults to a FAISS backend; the FAISS backend ignoresfilter_criteria, soget(memory_id)is not reliable once more than one vector is stored- Set
storage_pathwhen you needsave()/load()persistence
-
Memory Management
- Call
clear()between unrelated conversations - LLM-backed memories make model calls on
add_message; budget for that cost
- Call
To contribute new memory implementations (or to finish one of the scaffolds):
- Create or edit a file in the
multimind/memorydirectory - Implement all five
BaseMemorymethods:add_message,get_messages,clear,save,load - Register the class in
multimind/memory/__init__.py(_LAZY_ATTRS, with the extra it needs) - Update this document and feature-status.md
- Add tests
- Submit a pull request