API Reference — Overview

On this page

This section documents every public class exported from the top-level memory module . Classes are grouped by the subpackage that defines them.

Core (memory.core)

APITypeDescription
MemoryTypeEnumCategorizes memories: SHORT_TERM, LONG_TERM, WORKING, EPISODIC, SEMANTIC, PROCEDURAL.
MemoryPriorityEnumPriority tiers (CRITICAL…MINIMAL) derived from an importance score.
MemoryEntrydataclassThe universal memory record used by every tier in this package.
BaseMemoryABCAbstract interface implemented by all four ConversationXMemory classes.
BaseRetrieverABCAbstract interface for retrieval-style components; not implemented by any concrete class in this source tree.
MemoryConfigdataclassCentral configuration object (32 fields — see Configuration).
ChatMessagedataclassLightweight input/output/timestamp record. Exported but unused internally.
EntitydataclassNamed entity with rolling context list, used by ConversationEntityMemory.

Conversation Memories (memory.memories)

APITypeDescription
ConversationBufferMemoryclassStores the entire conversation, unbounded.
ConversationBufferWindowMemoryclassBuffer memory capped to the last k turns via a deque.
ConversationSummaryMemoryclassLLM-summarizes old turns once a token budget is exceeded.
ConversationEntityMemoryclassTracks named entities and their accumulated context.

Storage (memory.storage)

APITypeDescription
LongTermMemoryclassSQLite-backed, thread-safe, multi-tenant persistent store.

Security & Privacy (memory.security)

APITypeDescription
SensitiveDataMaskerclassRegex-based PII detection & redaction (10 built-in patterns).
MemoryEncryptorclassFernet symmetric encryption with base64 fallback.
AccessControllerclassRBAC for (user_id, tenant_id, Permission) triples.
PermissionEnumREAD, WRITE, DELETE, ADMIN.

Semantic Memory (memory.semantic_memory)

APITypeDescription
SemanticMemoryclassVector similarity store (FAISS or pure-NumPy fallback).

RAG (memory.rag)

APITypeDescription
ContextBuilderclassAssembles documents/memories/history/profile into a token-budgeted prompt.
DocumentdataclassA single retrieved RAG chunk.
BuiltContextdataclassThe result of ContextBuilder.build().

Intelligent Subsystems (memory.intelligent)

APITypeDescription
ShortTermMemoryclassFixed-window deque of MemoryEntry, decay-aware.
WorkingMemoryclassImportance-ranked, token-budgeted active context store.
MemorySelectorclassMulti-factor scoring (relevance/recency/importance) and selection.
SelectionConfigdataclassWeights and thresholds for MemorySelector.
ScoredMemorydataclassA candidate entry plus its component and composite scores.
MemoryCompressorclassNoise removal, near-duplicate merging, LLM summarization.
ForgettingMechanismclassEbbinghaus-style decay + deletion gating.
ForgettingConfigdataclassTunables for ForgettingMechanism.
UserProfileManagerclassPer-user profile CRUD with optional JSON persistence.
UserProfileclassTyped accessor/mutator wrapper over a profile dict.
AIMemoryManagerclassTop-level orchestrator tying every subsystem together.

Not part of the public API

The following are implementation details, not exported from any __init__.py, and therefore not documented as standalone pages:

  • memory.semantic_memory.semantic_memory._EmbeddingModel, _NumpyIndex, _FAISSIndex
  • memory.intelligent.memory_manager._TenantBundle
  • memory.intelligent.memory_compressor.LLMProtocol, memory.intelligent.memory_manager.LLMProtocol (two structurally-identical Protocol definitions duplicated in separate modules rather than shared from one location)

Where to go next

  • New to the package? See Quickstart.
  • Need the big-picture wiring between these classes? See Architecture.
  • Found a discrepancy between a docstring and actual behavior? Check Known Issues & Bugs first — it may already be documented there.