Quick Start
Get started with Memori in under 3 minutes. No database setup required — just your Memori API key and your favorite LLM provider.In this example, we’ll use Memori with OpenAI. Check out our Integration guides for other LLM providers and frameworks.
Prerequisites
- Python 3.10 or higher
- An OpenAI API key
- A Memori API key from app.memorilabs.ai
Step 1: Install Libraries
Install Memori and the OpenAI SDK:Step 2: Set Environment Variables
Set your API keys as environment variables:Step 3: Run Your First Memori Application
Create a new Python filequickstart.py and add the following code:
Setup & Configuration
Import libraries and initialize Memori with your API key and OpenAI client.- Memori reads your
MEMORI_API_KEYfrom the environment automatically llm.register()wraps your LLM client for automatic memory captureattribution()links memories to a specific user and process
First Conversation
Tell the LLM a fact about yourself. Memori automatically captures the conversation and processes it through Advanced Augmentation. Since Advanced 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. Memori automatically injects relevant facts via semantic search, so the second response should correctly recall your favorite color. This verifies recall from stored memories, not prior in-memory message history.Complete Code
Step 4: Run the Application
Execute your Python file:Step 5: Check the Dashboard
Visit app.memorilabs.ai to see your memory usage and try the Graph Explorer to interact with your memories visually.What You Learned
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.