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.
Install MemU
Install the published package with pip. To work from a clone instead, run uv sync in the repository.
pip install memu-pySet your API key
Export your OpenAI key so MemU can run extraction and embeddings. For a PostgreSQL backend, also set POSTGRES_DSN.
export OPENAI_API_KEY=your_keyIngest and retrieve
Create the service, ingest a source with memorize(), then pull back scoped context with retrieve(). Both calls are async.
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"},
)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 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
How MemU compares
MemU alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Mem0 | ★ 59.6k | A 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. |
| Graphiti | ★ 28.1k | A 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. |
| Supermemory | ★ 27.8k | A memory and context engine that ingests information across tools and sessions and can run fully locally, acting as a second brain for AI applications. |
| Cognee | ★ 24.1k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Letta | ★ 23.6k | A framework (formerly MemGPT) for building stateful agents with long-term memory that persists across sessions and conversations. |
| Memvid | ★ 15.7k | Memvid packs an AI agent's data, embeddings, and search index into one portable file, so it can retrieve memory fast without running a vector database. |
| Memori | ★ 15.5k | An SQL-native memory engine that gives any LLM persistent, structured memory stored in standard PostgreSQL or MySQL databases instead of a vector store. |
| MemU | ★ 13.9k | Turn raw multimodal data into agent-ready structured memory |