# MemU

> Turn raw multimodal data into agent-ready structured memory

- Category: Agents & Automation / Agent Memory
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/NevaMind-AI/memU
- Website: https://memu.so
- Canonical page: https://ai-tldr.dev/tools/memu/

## In short

MemU is a data-to-memory engine for 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 MemU.

## Overview

MemU is a data-to-memory engine for AI agents. It takes raw sources such as conversations, documents, URLs, images, audio, video, and tool logs, and turns them into a structured memory graph: resources, typed memory items, categories, relations, summaries, and embeddings that an agent can query directly.

It is aimed at developers building agents that need to remember things across sessions. Instead of re-reading every source on each turn, you ingest a source once with memorize(), then call retrieve() to pull back ranked context scoped to a specific user, session, or task. This keeps the amount of context you feed the model smaller and more relevant.

As a memory framework, MemU sits between your agent and a storage backend. It supports in-memory, SQLite, and PostgreSQL (with pgvector) backends behind the same repository contracts, and offers a hosted API at memu.so for teams that prefer managed ingestion and retrieval.

## What it does

- Multimodal ingestion of conversations, documents, images, video, audio, URLs, logs, and local files
- Structured memory graph of resources, memory items, categories, relations, summaries, and embeddings
- Typed memory extraction into profile, event, knowledge, behavior, skill, and tool memories
- Scoped, ranked retrieval that returns context for a given user, session, or task
- Pluggable storage backends: in-memory, SQLite, or PostgreSQL with pgvector
- Profile-based LLM routing so you can use OpenAI or custom providers

## Getting started

MemU runs on Python 3.13+. Install the package, set your OpenAI API key, then ingest a source and retrieve scoped context.

1. Install MemU

   Install the published package with pip. To work from a clone instead, run uv sync in the repository.

```bash
pip install memu-py
```

2. Set your API key

   Export your OpenAI key so MemU can run extraction and embeddings. For a PostgreSQL backend, also set POSTGRES_DSN.

```bash
export OPENAI_API_KEY=your_key
```

3. Ingest and retrieve

   Create the service, ingest a source with memorize(), then pull back scoped context with retrieve(). Both calls are async.

```python
from memu import MemUService

service = MemUService()

# Ingest raw data
result = await service.memorize(
    resource_url="path/to/file.json",
    modality="conversation",
    user={"user_id": "123"},
)

# Retrieve scoped context
context = await service.retrieve(
    queries=[{"role": "user", "content": {"text": "What should I remember?"}}],
    where={"user_id": "123"},
)
```

## When to use it

- Give a chat assistant long-term memory so it recalls user preferences and past decisions across sessions
- Reduce prompt size by retrieving only the memory items relevant to the current task instead of replaying full history
- Build a knowledge layer that ingests mixed sources (docs, meeting recordings, images) and exposes them as queryable memory
- Capture and reuse tool-usage patterns so an agent learns effective workflows over time
