What is Memori?

Memori is an open-source AI agent memory system that gives your applications structured, persistent memory. It automatically captures conversations, extracts meaningful facts, and makes them searchable — all stored in your own database on your own infrastructure.

Want a zero-setup option? The hosted platform at app.memorilabs.ai offers 100 memories free without an API key, and 5,000/month with a free API key.

Memori uses Advanced Augmentation to automatically enhance your memories with facts, preferences, skills, and relationships. It runs in the background with zero added latency to your AI processes.

Why Open Source?

Database Freedom

Use PostgreSQL, MySQL, SQLite, Oracle, or MongoDB — whatever fits your stack. Memori adapts to your database, not the other way around.

Full Data Ownership

Your data stays in your database, on your infrastructure. Full compliance and regulatory control with no third-party storage.

LLM Provider Support

OpenAI, Anthropic, Gemini, Bedrock, Grok (xAI) — all modes including streamed, unstreamed, sync, and async. Plus LangChain and Pydantic AI.

Semantic Recall

Background AI processing extracts facts, preferences, and relationships from your conversations. Recall any memory later with semantic search.

Quick Example

Get started with a database connection and your favorite LLM:

  • Register any supported LLM client with a single call
  • Track conversations by entity and process
  • Conversations automatically persisted and recalled
  • Full data ownership — everything stored in your database
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from memori import Memori
from openai import OpenAI

engine = create_engine("sqlite:///memori.db")
SessionLocal = sessionmaker(bind=engine)

client = OpenAI()
mem = Memori(conn=SessionLocal).llm.register(client)

# Track conversations by user and process
mem.attribution(entity_id="user_123", process_id="support_agent")

# All conversations automatically persisted and recalled
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "What color is Mars?"}]
)

# Recall facts later using semantic search
facts = mem.recall("Mars color")

Core Concepts

ConceptDescriptionExample
EntityPerson, place, or thing (like a user)entity_id="user_123"
ProcessYour agent, LLM interaction, or programprocess_id="support_agent"
SessionGroups LLM interactions togetherAuto-generated UUID, manually manageable
AugmentationBackground AI enhancement of memoriesExtracts facts, preferences, skills, etc.
RecallSemantic search across stored factsmem.recall("Mars color", limit=5)

Architecture Overview

Guides

Quick Start

Get up and running with Memori in just a few minutes.

Read more

Installation

Step-by-step guide to install Memori in your project.

Read more

Architecture

Understand the core architecture and design principles.

Read more

Databases

Learn how to configure and use different database backends.

Read more

Resources

Quick Start

Get started with Memori in minutes. Learn the basics and start building your AI-powered applications.

Architecture

Understand the core architecture of Memori and how different components work together.

LLM Integration

Learn how to integrate various LLM providers and configure them for your use case.

CLI Reference

Command-line interface documentation for managing Memori from your terminal.