Memory Providers
BindAI separates memory management from memory storage through memory providers. A memory provider is responsible for saving, loading, updating, and deleting conversation history or other persistent information. Because providers follow a common interface, applications can switch storage backends without changing agent code.Why Providers?
Different applications have different requirements. For example:- prototypes may only need temporary memory
- production systems often require persistent storage
- distributed deployments may use centralized databases
- AI assistants may combine multiple memory systems
Provider Architecture
The architecture is intentionally simple.Available Providers
BindAI currently includes:- In-Memory Provider
- SQLite
- PostgreSQL
- Redis
- MongoDB
- Vector Databases
- Cloud Storage
In-Memory Provider
The default provider stores everything in memory.- development
- testing
- examples
- temporary conversations
Using a Provider
Attach the memory instance to an agent.Provider Responsibilities
Every provider is responsible for operations such as:- storing messages
- retrieving messages
- clearing memory
- updating stored data
- managing conversation state
Persistent Providers
Persistent providers keep data after the application stops. Typical workflow:Distributed Systems
Providers also enable multiple application instances to share memory.Session Isolation
Most providers organize memory by session. Example:Performance
Different providers offer different performance characteristics.
The appropriate provider depends on application requirements.
Choosing a Provider
General recommendations: In-Memory- tutorials
- local development
- examples
- production deployments
- persistent conversations
- multi-user systems
- distributed applications
- shared state
- high performance
- semantic memory
- similarity search
- long-term retrieval
Swapping Providers
Because all providers implement the same interface, changing storage usually requires only replacing the provider. Example:Best Practices
- Use In-Memory during development.
- Use persistent providers for production.
- Isolate conversations by session.
- Avoid storing unnecessary information.
- Consider backup and retention strategies.
- Select a provider that matches expected scale.
