Skip to main content

What is Memori BYODB?

Memori is a memory layer for LLM applications, agents, and copilots. It continuously captures interactions, extracts structured knowledge, and intelligently ranks, decays, and retrieves the relevant memories. So your AI remembers the right things at the right time across every session.
Want a zero-setup option? Try Memori Cloud at app.memorilabs.ai.
Memori uses Advanced Augmentation to turn raw conversations into structured, searchable memories. It runs asynchronously in the background to minimize impact on your response path.

Why Memori BYODB?

Database Freedom

Use SQLite, PostgreSQL, MySQL, MariaDB, Oracle, MongoDB, CockroachDB, or OceanBase. Managed providers like Neon, Supabase, and AWS RDS/Aurora are also supported through their compatible engines.

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, and Grok (xAI) via direct SDK wrappers. Bedrock is supported via LangChain ChatBedrock. OpenAI-compatible providers (Nebius, Deepseek, NVIDIA NIM, Azure OpenAI, and more) work through OpenAI’s base_url parameter. Supports sync, async, streamed, and unstreamed modes, plus LangChain, Agno, and Pydantic AI.

Semantic Recall

Semantic search surfaces the right memories at the right time. Memories are ranked by relevance and importance, with intelligent decay so older or less relevant facts recede — so your AI stays contextually aware without clutter. Recall any memory later with semantic search; use manual recall for custom prompts, UIs, or debugging.

Quick Example

Get started with a database connection and your favorite LLM:
import os
import sqlite3
from memori import Memori
from openai import OpenAI

# Requires OPENAI_API_KEY in your environment
def get_sqlite_connection():
    return sqlite3.connect("memori.db")

client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
mem = Memori(conn=get_sqlite_connection).llm.register(client)

# Track conversations by user and process
mem.config.storage.build()
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": "My favorite color is blue."}]
)

Key Features

One-Line Setup

Connect your DB and LLM; memory capture, augmentation, and recall work without extra config.

Semantic Recall

Queries like “what does this user prefer?” pull the right memories automatically.

Dashboard Access

Use app.memorilabs.ai for API keys, usage tracking, and the optional Graph Explorer and Playground (requires Memori Cloud).

Your Data, Your Rules

Store everything in your DB; compliance, backups, and custom analytics stay under your control.

OpenAI-Compatible Providers

Memori supports any model that uses OpenAI’s client interface via the base_url parameter — including Nebius, Deepseek, NVIDIA NIM, and more.
import os
import sqlite3
from memori import Memori
from openai import OpenAI

def get_sqlite_connection():
    return sqlite3.connect("memori.db")

client = OpenAI(
    base_url="https://api.studio.nebius.com/v1/",
    api_key=os.getenv("NEBIUS_API_KEY"),
)

mem = Memori(conn=get_sqlite_connection).llm.register(client)

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 memoriesAuto-runs after wrapped LLM calls
RecallRetrieve relevant memories from previous interactionsAuto-injects recalled memories

Architecture Overview

The diagram shows three lanes: your app, the Memori SDK, and your own database. Your app calls the LLM normally, Memori intercepts the call, and the synchronous response path continues with zero added latency. Synchronous capture: Conversation messages are stored in memori_conversation_message while your normal LLM flow continues. Recall injection: Relevant memories are pulled from memori_entity_fact and injected into later prompts. Async augmentation: Background processing extracts facts, preferences, rules, events, and relationships from conversations. Own-your-data storage: Structured memory records are written to your database, including memori_entity_fact, memori_process_attribute, and memori_knowledge_graph. Memori BYODB architecture

Database Tables

When you run mem.config.storage.build(), Memori creates these tables in your database:
  • memori_conversation_message - Raw conversation messages
  • memori_entity_fact - Extracted facts about entities
  • memori_process_attribute - Process-specific attributes
  • memori_knowledge_graph - Relationship graph data
  • memori_session - Session tracking
Since you own the database, you can query these tables directly for custom analytics, backups, or integration with other systems.

Next Steps

1

Install Memori

Get started by installing the Memori SDK and your database driver.Go to Installation →
2

Quick Start

Build your first memory-enabled application with SQLite in under 3 minutes.Go to Quick Start →
3

Choose Your Database

Explore supported databases and connection patterns.Go to Databases →

Build docs developers (and LLMs) love