$git clone https://github.com/NevaMind-AI/memUAcross Sessions. Across Agents. Across Devices.
| 1 |  |
| 2 | |
| 3 | <div align="center"> |
| 4 | |
| 5 | # memU |
| 6 | |
| 7 | ### Personal memory, stored as files |
| 8 | |
| 9 | **Across Sessions. Across Agents. Across Devices.** |
| 10 | |
| 11 | [](https://badge.fury.io/py/memu-cli) |
| 12 | [](https://opensource.org/licenses/Apache-2.0) |
| 13 | [](https://www.python.org/downloads/) |
| 14 | [](https://discord.com/invite/hQZntfGsbJ) |
| 15 | [](https://x.com/memU_ai) |
| 16 | |
| 17 | <a href="https://trendshift.io/repositories/17374" target="_blank"><img src="https://trendshift.io/api/badge/repositories/17374" alt="NevaMind-AI%2FmemU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> |
| 18 | |
| 19 | </div> |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | memU is a 500-line memory system for AI agents. Agents write what's worth keeping as Markdown; memU stores it, embeds it, and retrieves ranked context in a single call — embeddings are the only model calls it makes. The entire memory logic lives in [`agentic.py`](src/memu/app/agentic.py) + [`service.py`](src/memu/app/service.py); everything else is pluggable storage and embedding transport. |
| 24 | |
| 25 | **Installation is agent-driven.** The guides are written for the agent, not for you. One message is the whole setup — tell your agent: |
| 26 | |
| 27 | > Read https://raw.githubusercontent.com/NevaMind-AI/MemU/main/SKILL.md and follow it to install memU. |
| 28 | |
| 29 | It works for Codex, Claude Code, Cursor, OpenClaw, Hermes, WorkBuddy — and any other agent, via detection. Details in [Host adapters](#host-adapters-memory-for-desktop-coding-agents). |
| 30 | |
| 31 | Want to follow the latest development instead? Install from the newest source (git `main`) — tell your agent: |
| 32 | |
| 33 | > Read https://raw.githubusercontent.com/NevaMind-AI/MemU/main/INSTALL-LATEST.md and follow it to install the latest memU. |
| 34 | |
| 35 | ## Quick start |
| 36 | |
| 37 | ```python |
| 38 | from memu.app import MemoryService |
| 39 | |
| 40 | service = MemoryService( |
| 41 | database_config={"metadata_store": {"provider": "sqlite", "dsn": "sqlite:///memu.sqlite3"}}, |
| 42 | ) |
| 43 | |
| 44 | # 1. Persist agent-prepared memory: recall files (memory/skill tracks) + resources |
| 45 | await service.commit_results( |
| 46 | recall_files=[ |
| 47 | { |
| 48 | "name": "Profile", |
| 49 | "track": "memory", |
| 50 | "description": "who the user is", |
| 51 | "content": "# Profile\n- prefers dark roast coffee\n- ships on Fridays", |
| 52 | }, |
| 53 | { |
| 54 | "name": "deploy-checklist", |
| 55 | "track": "skill", |
| 56 | "description": "how to deploy this repo", |
| 57 | "content": "1. run tests\n2. tag\n3. push", |
| 58 | }, |
| 59 | ], |
| 60 | resource=[{"path": "/abs/path/notes.md", "description": "meeting notes from the launch review"}], |
| 61 | ) |
| 62 | |
| 63 | # 2. See what is stored, across every track |
| 64 | files = await service.list_all_recall_files() |
| 65 | |
| 66 | # 3. Single-shot embedding retrieval over segments / files / resources |
| 67 | context = await service.progressive_retrieve("What should I know about this user's launch preferences?") |
| 68 | ``` |
| 69 | |
| 70 | Or straight from the terminal — no code: |
| 71 | |
| 72 | ```bash |
| 73 | export OPENAI_API_KEY=sk-... # embedding API key — the only model calls memU makes |
| 74 | |
| 75 | npx memu-cli commit results.json # {"recall_files": [...], "resource": [...]} |
| 76 | npx memu-cli list-files |
| 77 | npx memu-cli retrieve "What should I know about this user's launch preferences?" |
| 78 | ``` |
| 79 | |
| 80 | State persists in a local SQLite database (`./data/memu.sqlite3` by default), so commit in one invocation and retrieve in the next. |
| 81 | |
| 82 | ## How it works |
| 83 | |
| 84 |  |
| 85 | |
| 86 | ### The data model |
| 87 | |
| 88 | Memory is a set of **recall files** — one Markdown document per topic (`track="memory"`) or per learned skill (`track="skill"`). Committing a file also writes its search index: |
| 89 | |
| 90 | | Record | What it is | How it's embedded | |
| 91 | |---|---|---| |
| 92 | | **RecallFile** | The Markdown document itself (`na |