Skip to main content

Prerequisites

The following example requires the memori 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

  1. Create Database Engine: Use SQLAlchemy to create a database connection
  2. Initialize Memori: Create a Memori instance with the database session
  3. Register with Model: Register Memori with your model’s client using .llm.register()
  4. Set Attribution: Define entity and process IDs for memory tracking
  5. Build Storage: Initialize the database schema with .config.storage.build()

Developer Resources