█

AI/TLDR

Buy me a coffee
Buy me a coffee

Memori

Persistent, structured memory for any LLM agent with a drop-in SDK

Agent MemoryOpen source
Language
Python, TypeScript
License
Apache-2.0
$pip install memori
IN SHORT

What is Memori?

Memori is a memory layer for LLM agents that captures and recalls structured memory automatically. You register an existing LLM client (such as OpenAI), set an attribution scope, and Memori persists each conversation in the background and recalls relevant context on later requests. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python, TypeScript and licensed Apache-2.0.

Overview

Memori is a memory layer for LLM agents that captures and recalls structured memory automatically. You register an existing LLM client (such as OpenAI), set an attribution scope, and Memori persists each conversation in the background and recalls relevant context on later requests. The README frames it as memory built from what agents do, not just what they say.

It is aimed at developers building chatbots, support agents, and other assistants that need to remember details across sessions without manually managing prompts or retrieval. Memori is described as LLM, datastore, and framework agnostic, and it fits into an architecture you already have.

It ships as both a Python and a TypeScript SDK and offers a hosted Memori Cloud option with an API key, plus a bring-your-own-database (BYODB) mode. It also integrates with tools like OpenClaw, Hermes Agent, and MCP.

What it does

  • Automatic capture and recall: conversations are persisted and relevant memory is recalled in the background, with no manual prompt stuffing
  • Drop-in registration over an existing LLM client (for example an OpenAI client) rather than a rewrite of your call sites
  • Attribution scoping by entity and process so memory is partitioned per user and per agent
  • Python (pip install memori) and TypeScript (@memorilabs/memori) SDKs
  • Hosted Memori Cloud with an API key, plus a bring-your-own-database mode for using your own datastore
  • Integrations for OpenClaw, Hermes Agent, and MCP so agents gain memory without code changes

Getting started

Install an SDK, set your Memori and LLM API keys, then register your LLM client so conversations are saved and recalled automatically.

Install the SDK

Use the Python SDK or the TypeScript SDK.

bashbash
pip install memori

Set your API keys

Sign up at app.memorilabs.ai to get a Memori API key, then set MEMORI_API_KEY and your LLM key (for example OPENAI_API_KEY) in your environment.

Register your client and set attribution (Python)

Register your OpenAI client with Memori and set an attribution scope. After that, conversations are persisted and recalled automatically.

pythonpython
from memori import Memori
from openai import OpenAI

# Requires MEMORI_API_KEY and OPENAI_API_KEY in your environment
client = OpenAI()
mem = Memori().llm.register(client)

mem.attribution(entity_id="user_123", process_id="support_agent")

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "My favorite color is blue."}]
)
# Conversations are persisted and recalled automatically.

Or register in TypeScript

The TypeScript SDK uses the same pattern: register the client and chain attribution.

tsts
import { OpenAI } from 'openai';
import { Memori } from '@memorilabs/memori';

// Requires MEMORI_API_KEY and OPENAI_API_KEY in your environment
const client = new OpenAI();
const mem = new Memori().llm
  .register(client)
  .attribution('user_123', 'support_agent');

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Give a support agent or chatbot memory of a user's past messages and preferences across sessions
  • Add per-user, per-agent memory to an existing OpenAI-based app without rewriting your call sites
  • Provide persistent memory to OpenClaw, Hermes, or MCP-connected agents that otherwise forget between sessions
  • Keep prompts small by recalling structured memory instead of pasting full conversation history into every request

How Memori compares

Memori alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Claude-Mem★ 121kPersistent memory layer for coding agents: it captures what an agent does during a session, compresses it into semantic summaries, and injects the relevant parts back into later sessions.
Mem0★ 69.7kA memory layer that you add to existing LLM agents to extract, store, and recall user facts and preferences across sessions using vector, graph, and key-value backends.
Hindsight★ 64.3kAn agent memory server that stores facts and experiences, consolidates them into observations and mental models, and serves them back through retain, recall, and reflect operations.
MemPalace★ 60.8kLocal-first agent memory that stores conversations verbatim instead of summarising them, with a structured palace index, pluggable vector backends and an MCP server.
OpenViking★ 43.1kA context database that stores an agent's memories, resources, and skills as one browsable viking:// filesystem with three-tier (abstract/overview/details) on-demand loading.
Cognee★ 33.7kA graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge.
Graphiti★ 33.2kA library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time.
Memori★ 17.8kPersistent, structured memory for any LLM agent with a drop-in SDK