# Memori

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

- Category: Agents & Automation / Agent Memory
- Language: Python, TypeScript
- Licence: Apache-2.0
- Repository: https://github.com/MemoriLabs/Memori
- Website: https://memori.gibsonai.com
- Canonical page: https://ai-tldr.dev/tools/memori/

## In short

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.

1. Install the SDK

   Use the Python SDK or the TypeScript SDK.

```bash
pip install memori
```

2. 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.

3. 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.

```python
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.
```

4. Or register in TypeScript

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

```ts
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');
```

## 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
