Skip to main content

multi-agent-memory

Local-first, shared long-term memory for Codex, Pi, OpenCode, Claude Code, and other agent CLIs.

All agents can use the same human-readable Markdown Vault, including global preferences, project decisions, and reusable learnings. The SQLite index is only a rebuildable local search cache. There is no hosted service, telemetry, or automatic upload.

中文文档:README.zh-CN.md

Install

Requires Python 3.11+. The recommended installation uses uv:

uv tool install multi-agent-memory
mam init
mam status

For one-off commands:

uvx --from multi-agent-memory mam status

Install an agent adapter

Install one adapter, all adapters, or choose interactively:

mam install --agent pi
mam install --all
mam install

You can also ask the current agent:

Install and configure multi-agent-memory for the current agent. Use uv tool install multi-agent-memory, preserve existing configuration, run mam init, install only the current agent's adapter with mam install --agent ..., run mam status, and tell me whether a restart is needed. Do not use sudo, overwrite unmanaged files, or read and upload complete transcripts, credentials, tokens, cookies, or private keys.

Supported adapters:

Agent Installation
Codex mam install --agent codex
Pi mam install --agent pi
OpenCode mam install --agent opencode
Claude Code mam install --agent claude

Restart the agent after installing or upgrading its adapter. Hermes and OpenClaw are not supported yet.

Everyday use

Ask a connected agent in natural language:

帮我总结这轮记忆
记住:使用中文沟通,回答先给结论
确认刚才那条记忆
忘掉关于部署方式的记忆
回忆关于这个项目的决策

Or use the CLI directly:

mam context
mam propose --type preferences --text "Use Chinese and lead with the conclusion."
mam search "deployment" --include-candidates
mam confirm MEMORY_ID
mam forget MEMORY_ID

New memories are candidates and do not affect recall until confirmed. mam forget marks a memory deprecated; it remains auditable.

Global and project memory

Global memories apply everywhere. Project memories apply when the agent is inside the matching Git checkout:

mam propose --type project \
  --text "Batch jobs must report resolved and unresolved items."

mam propose --type project --project my-app \
  --text "Database migrations must include a rollback plan."

mam context combines global memories with memories for the current project.

Vault and privacy

The Markdown Vault is the source of truth and can be opened in Obsidian. Set its location with environment variables:

export AGENT_MEMORY_VAULT="$HOME/Documents/Obsidian/AgentMemory"
export AGENT_MEMORY_STATE_DIR="$HOME/.local/share/multi-agent-memory"
mam init

Adapters recall confirmed memories automatically. They do not silently summarize arbitrary transcripts. Ask the agent to summarize a meaningful work cycle, or provide a summary file:

mam session-summary --file summary.md

Do not store or commit credentials, API keys, cookies, private keys, complete transcripts, the Vault, or the SQLite index. For permanent deletion, remove the Markdown note and rebuild the index:

mam rebuild-index

Upgrade

uv tool upgrade multi-agent-memory
mam status

After an upgrade, the next Agent startup automatically synchronizes adapters that were previously installed by mam. Run mam install --agent NAME only for a new agent or to repair a reported conflict. Automatic synchronization can be disabled with AGENT_MEMORY_AUTO_SYNC_ADAPTERS=false.

If the tool was installed with an exact version pin, use:

uv tool install --force multi-agent-memory@latest

Upgrading does not delete the Vault or memories. Managed adapter files are backed up when replaced; unrelated configuration is preserved.

Development

uv sync
uv run pytest
python -m compileall src
node --check adapters/pi/agent-memory.js
node --check adapters/opencode/agent-memory.js

MIT License. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multi_agent_memory-0.2.1.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multi_agent_memory-0.2.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file multi_agent_memory-0.2.1.tar.gz.

File metadata

  • Download URL: multi_agent_memory-0.2.1.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for multi_agent_memory-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a23850a5f8923109ff273baab0b97b1c700bfb86f819ed75807dbfde37359691
MD5 fa1cf5eaf6cf89454c59535a9b988e10
BLAKE2b-256 7b6da9a0b2116093f4ac69f9057cea1f554bf651dfca98cd74579cb40c88f589

See more details on using hashes here.

Provenance

The following attestation bundles were made for multi_agent_memory-0.2.1.tar.gz:

Publisher: release.yml on mic1on/multi-agent-memory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file multi_agent_memory-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multi_agent_memory-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d80298dd9a68e6a75770ea7823d6a212dcbe62f8239b75272952e2e11e4c180
MD5 2291c8b9d9269543c1ccb11a157e25e5
BLAKE2b-256 2f4b2505160f889cf8486931c89fd0cda482529cf35bcab5146e96f863071f53

See more details on using hashes here.

Provenance

The following attestation bundles were made for multi_agent_memory-0.2.1-py3-none-any.whl:

Publisher: release.yml on mic1on/multi-agent-memory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page