Prerequisites
The following example requires thememori library.
Example
The following agent uses Memori to maintain persistent memory across conversations with SQLite:Key Features
- LLM Agnostic: OpenAI, Anthropic, Bedrock, Gemini, Grok (xAI) - all modes (streamed, unstreamed, sync, async)
- Smart Attribution: Track memories by entity (e.g., customer) and process (e.g., support agent)
- Advanced Augmentation: AI-powered memory augmentation with no latency impact
- Database Flexibility: Supports PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, CockroachDB, Neon, Supabase, Oracle, and more
Setup
- Create Database Engine: Use SQLAlchemy to create a database connection
- Initialize Memori: Create a Memori instance with the database session
- Register with Model: Register Memori with your Agno agent using
.agno.register() - Set Attribution: Define entity and process IDs for memory tracking
- Build Storage: Initialize the database schema with
.config.storage.build()