Memory Providers
BindAI’s memory package separates memory operations from their storage implementation through a common provider interface. The package includes an abstractMemoryProvider class, a MemoryRegistry for provider registration, and a Memory facade that delegates operations to a selected provider.
Provider Architecture
The package-level architecture is:The MemoryProvider Interface
MemoryProvider is an abstract base class defined in bindai_memory.provider.
A provider implementation must implement these methods:
The exact search behavior, persistence guarantees, dependencies, and configuration requirements depend on the selected implementation.
The Memory Facade
TheMemory class provides a common interface over a selected provider.
It accepts:
- A registered provider name as a string
- An existing
MemoryProviderinstance None, which selects the provider registered under the namememory
memory registration. It does not select SQLite by default.
To select a registered provider explicitly:
sqlite. Successful operation still depends on the provider implementation and its runtime requirements.
When using a provider that supports closing, call memory.close() when finished. The facade also supports context-manager usage.
Registered Built-in Providers
The currentbindai_memory.registry source registers these provider names:
These registrations confirm that the provider classes are included in the package’s registry. They do not, by themselves, confirm that all external services, optional dependencies, or Studio configuration paths are ready to use.
Consult each provider’s implementation and tests before relying on its behavior.
In-Memory and Persistent Storage
The registry distinguishes thememory and sqlite provider names.
memoryselectsInMemoryProvider.sqliteselectsSQLiteMemoryProvider.
Custom Providers
The package supports registering custom provider classes throughMemoryRegistry.register.
A custom provider must inherit from MemoryProvider and implement its abstract methods.
For example, the registration API has this form:
CustomMemoryProvider represents an implementation supplied by the application; it is not a built-in BindAI provider.
After registration, the name can be passed to Memory, provided the registration is available in the running process.
This is a package-level extension mechanism. It does not establish that custom providers can be selected or configured through Studio.
Provider Registry Operations
The registry provides these operations:MemoryProvider.
providers() returns a copy of the registry mapping.
The registry is a runtime registration mechanism, not a persistent provider configuration store.
Memory Record Lifecycle
TheMemory facade uses MemoryManager for certain record updates.
When Memory.get successfully retrieves a record, the inspected implementation:
- Updates the record’s access information.
- Reinforces its importance.
- Writes the updated record through the provider.
- Retrieves the record again and returns that result.
Memory Providers and Agent Execution
The provider package defines record storage and management. It does not, on its own, establish when an Agent loads or saves conversation history. Before documenting automatic conversation persistence, Studio provider selection, or memory sharing across workflow runs, verify the relevant Agent, runtime, and Studio integrations.Storage and Security
Choose a provider based on the application’s requirements and the backend’s verified behavior. Memory records may contain sensitive information. Consider credentials, access controls, backups, retention, and deletion requirements for the chosen storage system. Do not depend on undocumented backend schemas as public interfaces.Summary
The BindAI memory package provides a common storage API throughMemoryProvider, Memory, and MemoryRegistry.
The inspected registry includes in-memory, SQLite, vector, PostgreSQL, Pinecone, and Chroma provider classes. It also supports registering custom provider implementations that satisfy the abstract interface.
Provider registration is not the same as verified backend operation or Studio integration. Document those capabilities separately when their implementations have been checked.