Generated banner for memU
Generated logo for memU

memU

Memory framework

First committed by evan-ak

Published in NevaMind-AI/memU. Publisher page

14,613 GitHub stars

What it is

Personal memory across agents
— the description by evan-ak

AutoGineer overview, from the brain’s own files

memU is an agent-driven memory system designed to provide persistent knowledge across different AI agents, sessions, and devices. It functions as a sidecar to desktop coding agents, automatically mining session logs to extract reusable skills and workflows. These skills are stored as Markdown files, which the agent can then retrieve and apply to future tasks. The system is designed to be storage-agnostic, supporting local SQLite databases for single-device use or Postgres for concurrent access, and it integrates with various coding agents through dedicated host adapters.

How it works

Memory model: LLM wiki

AutoGineer overview, from the brain’s own files

memU operates by installing a scheduled background task that monitors agent session logs. It slices these logs into jobs, which the agent then processes to create or update Markdown-based skill files. These skills are indexed and stored in a configured backend. When an agent performs a task, it uses a standing instruction to trigger a retrieval process, which fetches relevant skills from the memory store and injects them into the agent's context.

Folders
FolderRoleFiles
.githubagent-config10
assetsattachments24
docsdocs25
scriptsscripts1
srcsource-code190
teststests69
npmfolder3

The agent reads

The agent writes

Requirements

Runtimes: Python >=3.11

Databases: PostgreSQL, SQLite

API keys (by name): MEMU_API_KEY, OPENAI_API_KEY

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 4 scripts. Review Makefile, src/memu/hosts/claude_code/install.py, src/memu/hosts/codex/install.py, src/memu/hosts/pi/install.py before opening the folder in Claude Code. No step below turns a hook on for you.

    • Makefile: echo "🚀 Creating virtual environment using uv"; uv sync; uv run pre-commit install
    • src/memu/hosts/claude_code/install.py: python src/memu/hosts/claude_code/install.py
    • src/memu/hosts/codex/install.py: python src/memu/hosts/codex/install.py
    • src/memu/hosts/pi/install.py: python src/memu/hosts/pi/install.py
  2. Not scanned by AutoGineerIts dependencies are installed by pip or uv when you run it and were not scanned by AutoGineer (7 declared). https://pypi.org/project/memu-cli/
  3. First committed by evan-ak. Published in NevaMind-AI/memU. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Install memU via the provided CLI or agent-specific instructions.
  • Configure the memory backend using a local SQLite file or a Postgres DSN.
  • Allow the background task to automatically distill agent history into Markdown skills.
  • Use the agent's integrated retrieval mechanism to access relevant past skills during new tasks.
  • Manage memory settings and storage via the memU CLI or environment variables.
  • Use the doctor command to verify the configuration and retrieval path.
“memu-codex retrieve "What should I remember about this project?"”
The system returns relevant memory hits containing text, descriptions, and paths from previous sessions.
“memu-agent detect”
The system probes the machine to identify the agent and reports if memorization and retrieval are supported.

Documentation by evan-ak

Image: memU Banner

<div align="center">

memU

Personal memory, stored as Wiki

Across Sessions. Across Agents. Across Devices.

Image: PyPI version Image: License: Apache 2.0 Image: Python 3.11+ Image: Discord Image: Twitter

<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>

</div>


memU is a lightweight, agent-driven memory system that gives users a shared LLM wiki across sessions, agents, and devices. It automatically distills your own reusable skills from your agent history. Its core memory logic is only 500 lines — compact enough to inspect, understand, and adapt.

Quick start

memU works with Codex, Claude Code, Cursor, OpenClaw, Hermes, WorkBuddy, Cola, pi, and more. See Host adapters.

Cross-device · Free · Unlimited · View online

Get your API key from memu.so, then send this message to your agent:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is memu_•••••••••(get Api Key from memu.so).

Agent support

This matrix lists the currently tested memU integrations by operating system.

  • Memorize — capture useful session knowledge through a scheduled background task and turn it into reusable memory.

  • Retrieve — bring relevant memory into a future task.

  • ⚠️ — supported with an important limitation; see the user note.

macOS
AgentModeMemorizeRetrieveUser note
ChatGPTChatGPT(Work mode), codex and VS Code extension✅✅
ChatGPTChat❌❌Chat mode is not currently supported. Please use Work mode.
Claude CodeDesktop and CLI✅✅If the selected model declines the setup steps, retry with Opus or another model. Sonnet 5 can occasionally do this.
ClaudeChat and Cowork❌❌
Cursor—✅✅
OpenClaw—✅✅Retrieve support has not yet been verified.
Hermes Agent—✅✅
WorkBuddy—✅✅
Windows
AgentModeMemorizeRetrieveUser note
ChatGPTChatGPT(Work mode), codex and VS Code extension✅✅
ChatGPTChat❌❌Chat mode is not currently supported. Please use Work mode.
Claude CodeDesktop and CLI✅✅If the selected model declines the setup steps, retry with Opus or another model. Sonnet 5 can occasionally do this.
ClaudeChat and Cowork❌❌
Cursor—✅✅
OpenClaw—✅✅
Hermes Agent—✅⚠️Use a memU version with Windows HERMES_HOME support; older versions may retrieve from the wrong files.
WorkBuddy—✅✅With Hy3, retrieval may fail. Retry with another model if this happens.
Linux
AgentModeMemorizeRetrieveUser note
CodexVS Code extension❌✅
Claude CodeCLI✅✅
OpenClaw4.23 / 7.1✅✅

Support status reflects the current release and may change as host integrations evolve.

How it works

Image: memU memory system architecture

Automatic skill extraction

Once the scheduled bridging task is installed, memU can turn useful agent history into reusable Markdown skills automatically.

Image: How memU turns agent history into reusable skills

  1. Capture new sessions. The host adapter reads new session history, including messages and tool calls.

  2. Prepare self-evolve jobs. prepare slices each session into a self-contained job with the paths and context the agent needs.

  3. Let the agent decide. The agent reads related existing skills, then chooses to do nothing, patch an existing skill, or create a new one.

  4. Write readable skill Markdown. Each skill has a name, description, and reusable workflow, including useful branches, edge cases, and pitfalls.

  5. Commit and index. commit submits changed skill files through commit_results; memU embeds the skill name and description and stores it under the skill track.

  6. Retrieve it later. On a similar future task, memU returns the relevant skill so any connected agent can use the learned workflow.

The judgment and synthesis stay inside the agent. MemoryService makes no LLM or chat calls; it stores, embeds, and retrieves the skill Markdown the agent prepared.

Self-hosted

Private · Single-device · Embedding key required

To run memU locally with your own storage and embedding provider, send this message to your agent:

Read https://raw.githubusercontent.com/NevaMind-AI/MemU/main/SKILL.md and follow it to install memU.

Uninstall

To uninstall memU, send this message to your agent:

Read https://memu.pro/SKILL.md and follow its instructions to uninstall memU.

By default, uninstalling removes the host integration and tooling while keeping your memory store and ~/.memu/config.env, so a later reinstall can resume where you left off. Memory is erased only when you explicitly ask for it.

Host adapters: memory for desktop coding agents

memU runs as a sidecar to a desktop agent, one binary per host. Each binds two seams:

  • record — a scheduled bridging task slices new session logs into self-contained job files; the agent itself distills them into memory/skill Markdown; commit submits whatever the agent left on disk back through commit_results.

  • inject — a standing instruction in the host's instruction file tells the agent to run <binary> retrieve (→ progressive_retrieve) before answering.

HostBinarySession log it minesInstruction file it patches
Codexmemu-codex~/.codex/sessions/**/*.jsonl~/.codex/AGENTS.md
Claude Codememu-claude-code~/.claude/projects/<project>/<session>.jsonl~/.claude/CLAUDE.md
Cursor (Agent/CLI)memu-cursor~/.cursor/projects/<project>/agent-transcripts/**.jsonl./AGENTS.md (per project)
OpenClawmemu-openclaw~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite (SQLite, read-only) + legacy <agentId>/sessions/*.jsonl~/.openclaw/workspace/AGENTS.md
Hermes Agentmemu-hermes~/.hermes/state.db (SQLite, read-only)~/.hermes/SOUL.md
WorkBuddymemu-workbuddy~/.workbuddy/projects/<project>/<session>.jsonl~/.workbuddy/SOUL.md
Colamemu-cola~/.cola/sessions/<scope>/<session>.jsonl~/.cola/memory-bank/MEMORY.md
pimemu-pi~/.pi/agent/sessions/<encoded-cwd>/<session>.jsonl~/.pi/agent/AGENTS.md
any other agentmemu-agentfound by memu-agent detect (JSONL dialect sniffed)found by detect (AGENTS.md / CLAUDE.md / SOUL.md / …)

For agents without a dedicated binary, memu-agent detect probes the machine and reports per agent whether memorization works (a recognizable session log exists) and whether retrieval works (an instruction file exists to patch) — then the same verbs run against what it found.

All hosts share one configured memory backend via ~/.memu/config.env — local or MemU Cloud. What one host's sessions taught memU, another host retrieves.

Installation is the one-message setup in Quick start or Self-hosted. SKILL.md is the routing skill it hands your agent: install the package, identify which host you are (falling back to memu-agent detect for anything without a dedicated adapter), print that host's packaged install guide (<binary> docs install), and follow it — configure the memory backend, register the scheduled bridging task, patch the instruction file, each step behind a verify gate — then report which seams (memorization / retrieval) are now active.

Afterwards <binary> doctor proves the whole loop resolves: config, selected mode, and a live retrieval.

Adding another host means implementing one TranscriptSource (where its session logs live, how its records are shaped) plus a HostSpec-sized CLI — the pipeline, verbs, and instruction text are shared.

Developer integration

Use memu memorize to turn application-owned conversations into memory and skills.

CLI

With memU Cloud, sign in at memu.so to view your memory files. With a local installation, memory lives in the shared store configured by MEMU_DB in ~/.memu/config.env — typically ~/.memu/memu.sqlite3 for local SQLite, or a Postgres DSN.

Once installed, your agent retrieves relevant memory automatically before answering. To retrieve manually, run the adapter for your host:

memu-codex retrieve "What should I remember about this project?"
# or: memu-claude-code / memu-cursor / memu-openclaw / memu-hermes / memu-workbuddy / memu-cola / memu-pi / memu-agent

For pi, run memu-pi install to configure the memory backend and install the extension, then run /reload or open a new session. Submitted prompts start retrieval in the background; results enter the model context and resume an idle agent. After the user turn and pending retrieval settle, a background worker processes the saved conversation into memory using the active session's model. Workers share a lock and a 30-minute cooldown. Long prompts use an isolated, tool-free pi request to extract a search query with the active provider/model; extraction has a 12-second timeout and falls back to the original prefix. The installer registers and verifies the extension. Run memu-pi uninstall and reload to remove it.

Host retrieval returns compact JSON with at most five self-contained hits plus independent resources. Each hit combines matched text with its source's description, track, and local mirror path (or inline content when no mirror is available). Its score describes the matched segment; created_at and updated_at describe the source file when available. Hits retain segment order, including excerpts whose source is missing; sources without matched excerpts remain source-only hits. Resources contain path, caption, and available scores/timestamps. Database IDs and scope metadata are omitted from the agent-facing output.

Install or invoke the CLI directly:

pip install memu-cli         # library + memu + memu-codex CLIs
npx memu-cli --help          # CLI via npm launcher (engine: PyPI package memu-cli)
uvx --from memu-cli memu     # CLI via uv, no install

Configuration

Values resolve in order: process env → ~/.memu/config.env → default. memU supports Local and Cloud memory backends, selected by MEMU_MEMORY_MODE; an unset mode remains Local for backward compatibility.

For Local / self-hosted installations, every CLI flag has a matching variable:

SettingEnv varDefault
StoreMEMU_DB./data/memu.sqlite3 (CLI); required for host adapters
Embedding providerMEMU_EMBED_PROVIDERopenai (also: jina, voyage, doubao, openrouter); legacy MEMU_LLM_PROVIDER still read
API keyMEMU_API_KEYthe provider's env var, e.g. OPENAI_API_KEY
Embedding modelMEMU_EMBED_MODELthe provider's default
Base URLMEMU_BASE_URLthe provider's default

Run <binary> doctor to display the resolved mode and verify the same retrieval path the host uses.

Storage backends
ProviderDSNVector searchUse for
inmemory—brute-force cosinetests, throwaway sessions
sqlitesqlite:///path.sqlite3brute-force cosinelocal/default, single writer
postgrespostgresql://...pgvectorconcurrent access, large stores (pip install "memu-cli[postgres]")
service = MemoryService(
    database_config={"metadata_store": {"provider": "postgres", "dsn": "postgresql://..."}},
    embedding_profiles={"default": {"provider": "jina"}},
)

Community contributions

Explore the community tasks (English / 简体中文) and claim a task in issue #790. Each task has a stable link, a difficulty rating, and acceptance criteria. See CONTRIBUTING.md for development and PR guidelines.

License

Apache-2.0

<sub>Partnership Community: <a href="https://linux.do">LINUX DO</a></sub>

SKILL.md


name: install-memu description: Install or uninstall memU for whatever agent you are — identify your host, print its packaged guide, and follow it to wire (or unwire) both seams (record and inject). Use when the user asks to install, set up, integrate, remove, or uninstall memU.

Install memU

Audience: the agent. A user has pointed you at this file ("read SKILL.md and follow it to install memU"). This skill does not contain the install steps — it routes you to the right guide, which ships inside the memU package and is always in sync with the installed code. Do not install from memory or from blog posts; print the guide and follow it to the letter.

memU integrates with a host agent through two seams: record saves session information into durable memory, and inject retrieves relevant memory before answering. Each supported host has its own adapter binary carrying its own install guide. Your job here is three steps: install the package, pick your binary, print and follow its guide.

Before installing with Codex

If you are Codex, check the session's effective sandbox mode before Step 1. Continue only with danger-full-access; approval policy alone is not sufficient. If restricted or unknown, pause and show both ways to continue: enable Full access in Codex Desktop, or restart Codex CLI with codex --dangerously-bypass-approvals-and-sandbox. Recheck the effective mode before proceeding. After installation, remind the user to restore their previous permission mode.

Step 1 — install the package

pip install --upgrade memu-cli

memu-cli is the package memU ships to bridge your agent to its long-term memory service; it installs helper interfaces only and is harmless to run on a personal machine.

Keep the --upgrade. A machine that already has an older memu-cli would otherwise keep it, and the steps below name subcommands that older builds do not have — the symptom is invalid choice. If you meet that error at any point, you are on a stale build: upgrade, then re-run the command that failed.

This puts memu and every host-adapter binary on PATH. If pip is not the right tool for this machine (managed Python, uv-only), use the equivalent — what matters is that the binaries below resolve from a bare, non-interactive shell. With uv this means uv tool install --upgrade memu-cli, not uv pip install: however it is installed, memu-cli is a cross-session bridging tool and must be callable everywhere, not scoped to one project venv.

Step 2 — pick your host binary

Identify which agent you are (not which agents are installed — the one executing this skill):

You areYour binary
Codexmemu-codex
Claude Codememu-claude-code
Cursor (Agent/CLI)memu-cursor
OpenClawmemu-openclaw
Hermes Agentmemu-hermes
WorkBuddymemu-workbuddy
Colamemu-cola
pimemu-pi
anything elsememu-agent

Unsure, or not in the table? You are memu-agent. Run:

memu-agent detect

It probes this machine and reports, per agent, whether memorization works (a recognizable session log exists) and whether retrieval works (an instruction file exists to patch) — and it will redirect you to a dedicated binary if your host turns out to have one.

For Codex, Claude Code, and pi, continue directly to Step 3: their installers handle backend configuration and verification in one invocation. Pass any user-supplied backend inputs to that installer when the guide requests them.

For other hosts, holding your binary, finish this step by creating memU's configuration file.

<your-binary> init --cloud-api-key <the user's memU key>

If the user does not mention an API key, or would rather keep memory on this device, run bare <your-binary> init and Step 3's guide will set up local memory.

Step 3 — print your guide and follow it

<your-binary> docs install

Read what it prints, top to bottom, and follow it exactly. The host guide defines how to configure the backend and enable automatic recording and retrieval. Follow its verification gates and final report.

Three rules that hold for every host:

  • Install in one pass; don't stop for confirmation. Most users want a silent, full install set up for them in a single call. Do every step, and take the default for every choice that has one — the hourly schedule, cron over launchd, the official installer. Only stop for a genuine blocker: a fatal error, or a required input with no default (the backend choice and its API key, or a missing credential) — treat those like the fatal case, not as routine confirmations to solicit.

  • One backend. If <your-binary> config show reports a mode with a backend behind it (another agent on this machine is already integrated), reuse it as is. A second mode or local store would split record and retrieval so the two installs no longer share memory.

  • Report the outcome — with the exact template below. If the host guide specifies its own final report, use that report instead. Otherwise, after installation, run:

    <your-binary> retrieve "When did the user register for memU?"

    Then send the user this report. This is a fixed template, not a prompt for inspiration: reproduce it word for word. Do not paraphrase it, reorder its sentences, summarize it, translate it, or "improve" the wording — a correct install ends with these exact words. The only things you change are the <...> placeholders, each replaced by its concrete value:

    memU is ready for `<host>` with `<mode>` memory.
    
    Welcome to memU. memU says the user registered on `<registration time>`.
    
    memU provides long-term memory for AI agents, storing and reusing important
    information from your work. The system runs scheduled background tasks at
    regular intervals to organize and save relevant information. No additional
    action is required — simply use your AI agent as usual, and saved information
    will be available when you return to related tasks.
    
    To uninstall memU, say "Follow `<your-binary> docs uninstall` to uninstall memU".

    Placeholders, each filled with its concrete value before you send:

    • <host> — the agent you are (e.g. Claude Code).

    • <mode> — the memory backend you configured in ~/.memu/config.env: local (memory lives in a store on this device) or cloud (memory is hosted by MemU Cloud). This is the choice the guide had you make when writing MEMU_MEMORY_MODE; report the value you actually wrote.

    • <registration time> — the time returned by the retrieve call above. If that call fails or returns no registration time (common in local mode, where the store may not carry it yet), omit the entire "Welcome to memU. memU says the user registered on ..." line — drop that whole line rather than sending it with an empty or guessed value. Never invent a time.

    • <your-binary> — the binary you picked in Step 2 (e.g. memu-claude-code).

    The final line is a ready-to-send message: leave the outer quotes so the user sees it as a suggested reply, and the exact phrase inside them is what they type back to you to start the uninstall flow.

    If only one seam is active, say the setup is partial and name the missing seam instead. For memu-agent, use the detect report to decide which seams are active.

Uninstall

Same routing, in reverse. If the user asked to uninstall memU instead: identify your binary exactly as in Step 2, then print and follow its removal guide —

<your-binary> docs uninstall

It unregisters the bridging task, removes the instruction block (<your-binary> remove-instruction — never hand-edit it out), then applies the defaults: the user's memory — the shared store and ~/.memu/config.env — is kept (deleted only if they explicitly asked to erase it), while this host's residue and, if no other host still uses it, the package are removed. Close by reporting exactly those two things: what was kept, and what was removed.

339 files · 329 not served here

Advantages

  • Automatically distills reusable skills from agent history without manual intervention. evidence: README.md
  • Supports multiple storage backends including SQLite and Postgres for different deployment needs. evidence: README.md

Limitations

  • Some agents require specific modes (e.g., Work mode) and do not support memory features in standard chat modes. evidence: README.md
  • Certain models may decline setup steps, requiring a retry with a different model like Opus. evidence: README.md

Security

Risk level: Medium risk

This brain runs

Git hooks (2)

  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/pre-commit/pre-commit-hooks at v6.0.0 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/astral-sh/ruff-pre-commit at v0.14.3 (contributor tooling: runs only after pre-commit install) · uses the network

Agent instructions that run or fetch something (14)

  • AGENTS.md: Setup: `make install`
  • AGENTS.md: Run all tests: `make test`
  • AGENTS.md: Run focused tests: `uv run python -m pytest tests/<target_test>.py`
  • AGENTS.md: Full quality checks: `make check`
  • SKILL.md: Each supported host has its own adapter binary carrying its own install guide.
  • SKILL.md: Your job here is three steps: install the package, pick your binary, print and follow its guide.
  • SKILL.md: it installs helper interfaces only and is harmless to run on a personal machine.
  • SKILL.md: If you meet that error at any point, you are on a stale build: upgrade, then re-run the command that failed.
  • SKILL.md: With uv this means `uv tool install --upgrade memu-cli`, **not** `uv pip install`: however it is installed, `memu-cli` is a cross-session bridging tool and must be callable everywhere, not scoped to one project venv.
  • SKILL.md: Run:
  • SKILL.md: If the user does not mention an API key, or would rather keep memory on this device, run bare `<your-binary> init` and Step 3's guide will set up local memory.
  • SKILL.md: <your-binary> docs install
  • SKILL.md: **Install in one pass;
  • SKILL.md: Otherwise, after installation, run:

Install scripts (4)

  • Makefile (make install): echo "🚀 Creating virtual environment using uv"; uv sync; uv run pre-commit install
  • src/memu/hosts/claude_code/install.py: python src/memu/hosts/claude_code/install.py
  • src/memu/hosts/codex/install.py: python src/memu/hosts/codex/install.py
  • src/memu/hosts/pi/install.py: python src/memu/hosts/pi/install.py
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:2)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:15)
  • Low risk: network-instructions (SKILL.md:33)
  • Low risk: scripts-present (src/memu/hosts/claude_code/install.py)
  • Low risk: scripts-present (src/memu/hosts/codex/install.py)
  • Low risk: scripts-present (src/memu/hosts/pi/install.py)

Attribution and licence

First committed by
GitHub avatar of evan-akevan-ak
Declared authors
  • MemU Team (declared in pyproject.toml)
Publisher
NevaMind AI (Community)
Source
NevaMind-AI/memU · commit fd86e38
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
sairin1202, xnne-bot, evan-ak, nevamind-agent, wutongyuonce

AutoGineer is not affiliated with or endorsed by evan-ak or NevaMind AI.

Install from source

329 of its files are not served here, so there is no ZIP. NevaMind-AI/memU at fd86e38