# MemOS

> A memory operating system that gives LLM agents persistent, manageable long-term memory

- Category: Agents & Automation / Agent Memory
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/MemTensor/MemOS
- Website: https://memos.openmem.net
- Canonical page: https://ai-tldr.dev/tools/memos/

## In short

MemOS is an open-source memory layer for large language models and AI agents. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0. To get started: install MemOS.

## Overview

MemOS is an open-source memory layer for large language models and AI agents. It unifies the three jobs of long-term memory — storing, retrieving, and managing it — behind a single API, so an agent can remember facts about a user across many conversations instead of starting fresh each time.

It is built for developers who are wiring memory into chatbots, assistants, or multi-agent systems and want an inspectable store rather than a black-box embedding index. Memory is structured as a graph you can read and edit, and you can correct or delete individual memories with natural-language feedback or by ID.

Within the agent-memory space, MemOS sits alongside other memory frameworks but leans toward an operating-system model: multiple knowledge bases (memory cubes), multi-modal content (text, images, tool traces), and asynchronous ingestion for production workloads. You can run it self-hosted or use the hosted cloud service.

## What it does

- Unified memory API to add, retrieve, edit, and delete memories, structured as an inspectable graph rather than a black-box embedding store
- Multi-cube knowledge base management — isolate or share memory across users, projects, and agents
- Multi-modal memory covering text, images, tool traces, and personas in one system
- Natural-language feedback and correction to refine, supplement, or replace existing memories
- Asynchronous ingestion via MemScheduler for low-latency operation under high concurrency
- Self-hosted REST API plus a hosted cloud option and plugins for agent frameworks

## Getting started

Install the Python package, run the self-hosted service, then add and search memory over its REST API.

1. Install MemOS

   Install the package from PyPI. MemOS requires Python 3.10 or newer.

```bash
pip install MemoryOS
```

2. Add a memory

   With the service running locally (default http://localhost:8000), POST a message to store it under a user and memory cube.

```python
import requests, json

data = {
    "user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
    "mem_cube_id": "b32d0977-435d-4828-a86f-4f47f8b55bca",
    "messages": [
        {"role": "user", "content": "I like strawberry"}
    ],
    "async_mode": "sync"
}
headers = {"Content-Type": "application/json"}
url = "http://localhost:8000/product/add"

res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
```

3. Search the memory

   Query the same user and cube to retrieve what was stored.

```python
import requests, json

data = {
    "query": "What do I like",
    "user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
    "mem_cube_id": "b32d0977-435d-4828-a86f-4f47f8b55bca"
}
headers = {"Content-Type": "application/json"}
url = "http://localhost:8000/product/search"

res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
```

## When to use it

- Give a chatbot or assistant persistent memory of a user's preferences and past conversations across sessions
- Share and isolate memory across a multi-agent system using separate memory cubes keyed by user or project
- Store and reason over tool traces and images alongside text so an agent can plan from past tool usage
- Correct or delete what an agent has learned over time using natural-language feedback or memory IDs
