Quick Start
Get started with Memori in under 3 minutes. Since Memori BYODB is open source, you bring your own database — and for this quick start, we will use SQLite so there is nothing extra to install.Want a zero-setup option? Try Memori Cloud at app.memorilabs.ai.
Prerequisites
- Python 3.10 or higher
- An OpenAI API key
Step 1: Install Libraries
Install Memori and the OpenAI SDK:Step 2: Set Environment Variables
Set your OpenAI API key as an environment variable:Step 3: Run Your First Memori Application
Create a new Python filequickstart.py and add the following code:
Setup & Configuration
Import libraries, set up a SQLite database with Python’s built-insqlite3, and initialize Memori with your OpenAI client.
connaccepts a connection factory (SQLAlchemy, DB-API 2.0, Django ORM, or MongoDB callable)llm.register()wraps your LLM client for automatic memory captureattribution()links memories to a specific user and processbuild()creates the Memori schema tables in your database
If your app already uses SQLAlchemy, you can pass a
sessionmaker instead of a DB-API 2.0 connection function.SQLAlchemy Alternative
First Conversation
Tell the LLM a fact about yourself. Memori automatically captures the conversation and processes it through Advanced Augmentation. Since augmentation runs asynchronously, callaugmentation.wait() in short-lived scripts to ensure memories are fully processed before continuing.
Memory Recall
Create a completely new client and Memori instance — no prior context carried over. When you ask the LLM what it remembers, Memori automatically injects the relevant facts via semantic search. The second response should correctly recall your favorite color, proving memory persistence works across sessions.Complete Code
Step 4: Run the Application
Execute your Python file:Step 5: Inspect Your Memories
Since you own the database, you can inspect what Memori stored directly:What You Learned
Database Connection
Memori accepts a connection factory (
conn) that works with SQLAlchemy, DB-API 2.0, Django ORM, or MongoDB.Memory Capture
Memori automatically captures all LLM conversations when you wrap your client with
llm.register().Attribution
Using
attribution() links memories to specific users and processes, enabling personalized recall.Automatic Recall
Memori injects relevant memories into new conversations without manual retrieval code.
Next Steps
Explore Other Databases
Learn how to connect PostgreSQL, MySQL, MongoDB, and more.Go to Databases →
Try Other LLMs
Integrate with Anthropic, Gemini, Bedrock, or OpenAI-compatible providers.View LLM integrations in the sidebar