memU
File System as Memory, Memory Shapes the Agent
A Python library that gives AI agents persistent long-term memory, storing facts and preferences in a linked graph and injecting only the relevant pieces into each new request so context stays small as knowledge accumulates.
memU is a Python library that gives AI agents a persistent memory layer, designed for agents that run around the clock rather than just answering one question and stopping. The core problem it addresses is that language models do not remember anything between sessions by default, and keeping a long conversation history in every request gets expensive. memU stores what the agent has learned about you, then injects only the relevant pieces into each new request, so the context stays small even as knowledge accumulates over time.
The memory is organized like a file system, with categories acting as folders and individual facts or preferences stored as files inside them. Related memories link to each other, forming a connected graph that the agent can navigate. Conversations and documents can be loaded into this structure and then queried later, rather than keeping the raw text around forever.
A key design goal is proactive behavior. Rather than waiting to be asked, the agent is meant to observe interactions, infer what you are likely to need next, and take steps before you ask. The README describes a setup where a secondary memU process monitors what the main agent is doing, continuously extracts insights, and feeds forward-looking context back so the main agent can act ahead of time.
The library integrates with the Model Context Protocol (MCP), which lets it plug into Claude and other MCP-compatible AI tools. It is available as a Python package called memu-py and requires Python 3.13 or newer. A companion application called memUBot, built on top of this library, is also open-sourced separately.
The project is licensed under Apache 2.0 and is maintained by NevaMind AI. A Discord community is available for questions and discussion.
Where it fits
- Build an AI assistant that remembers user preferences and past conversations across multiple sessions without keeping the full history in every API request.
- Create a proactive agent that monitors ongoing interactions, extracts insights, and takes steps before the user asks by feeding forward-looking context to the main agent.
- Integrate persistent memory into Claude or any other MCP-compatible AI tool using the built-in Model Context Protocol adapter.
- Load documents into the memory store and query relevant facts from them later, rather than embedding the raw text in every prompt.