memU: Enabling Long-Term Memory for AI Coding Agents
memU is an open‑source Python library and CLI that gives AI coding agents persistent memory by converting past conversations, code, documents, and media into a structured Markdown file tree, allowing agents to retrieve only the needed context instead of re‑entering project details each session.
Why it is needed
AI coding tools without a memory system treat each conversation as a first meeting, requiring repeated description of project architecture, coding style, and past decisions. In collaborative projects, agents cannot acknowledge prior work.
Solution
memU organizes information into a structured Markdown file tree. An agent loads only the required files based on a given path, avoiding inclusion of the entire history in each prompt.
Usage
Python library
from memu import Service
await service.memorize(resource_url="workspace/meeting-notes.md", modality="document")
context = await service.retrieve(
queries=[{"role": "user", "content": {"text": "关于这个用户的什么偏好需要知道?"}}]
)CLI tool
npx memu-cli memorize-workspace ./workspace
npx memu-cli retrieve-workspace "what do I need to know?"Memory content
memU supports dialogue logs, code files, documents, images, audio, video, web links, and tool‑call records. These are compiled into three core Markdown files:
INDEX.md – index for quick navigation
MEMORY.md – stored memory content
SKILL.md – description of the agent’s skills
The agent traverses the file tree and loads only needed pieces, preserving long‑term memory without wasting tokens.
One‑sentence summary
memU provides long‑term memory for AI agents: define project structure and preferences once, and the agent automatically loads them on subsequent runs.
Stars: 13.9k+ Language: Python License: Apache 2.0
Project URL: https://github.com/NevaMind-AI/memU
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Geek Labs
Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
