Skip to main content

memman

Persistent memory for Claude Code and Codex.

memman saves decisions, preferences, and project knowledge so the agent can find them in later sessions. The agent chooses what to remember and when to recall it. memman handles storage, search, and background processing.

Storing and recalling 1,000 memories costs under $1 on the default models (Cost).

CI License: MIT

Install

memman needs Python 3.11+ on Linux, macOS, or Windows under WSL2. The default setup uses SQLite for storage, and one OpenRouter endpoint and key for summaries, embeddings, and reranking, so the install asks for one key.

pipx install memman
memman install

In a terminal, memman install runs a wizard that configures the providers, saves every setting in ~/.memman/env, and installs a background worker. When it detects Claude Code, it also installs the hooks and the agent's instructions. A new Claude Code session loads them.

For Codex, installation adds a memory skill at ~/.agents/skills/memman and a rules file that lets Codex run the memory commands without a prompt. memman install --codex selects Codex explicitly. In Codex, $memman invokes the skill. Codex gets no lifecycle hooks, so the skill alone tells the agent when to recall and save. Codex setup covers detection and permissions.

The worker runs as a systemd timer on Linux or a launchd agent on macOS. On a host with neither, the operator sets MEMMAN_SCHEDULER_KIND=serve and runs memman scheduler serve. Installation covers headless installs and the optional Postgres backend, and Provider setup covers other providers.

On Windows, pipx installs memman inside a WSL2 distribution, and Claude Code or Codex runs in that same distribution. The worker needs systemd, which the distribution turns on with systemd=true under [boot] in /etc/wsl.conf. The data directory stays on the Linux filesystem, because SQLite file locking is unreliable on a /mnt/c path. WSL shuts an idle distribution down after the instanceIdleTimeout in %UserProfile%\.wslconfig, which stops the worker. Queued writes then wait until the next session starts it, and instanceIdleTimeout=-1 under [general] keeps the distribution running.

Usage

The agent runs these commands through its shell tool. They behave the same in an interactive shell:

memman remember "The billing service retries failed requests at most three times."
# The background worker stores the write on its next run, every 60 seconds by default.
memman recall "billing service retry limit"

remember prints the memory id immediately. recall returns the memory after the worker has stored it. The inspection and correction commands take the id that remember or recall prints:

memman insights show <id>
memman replace <id> "The billing service retries batch requests four times and other requests three times."
memman insights show <id> --history

Each memory holds one self-contained claim, on one line, within 1,000 UTF-8 bytes.

Memory commands lists the input rules and output formats.

How it works

  1. The agent decides. Claude Code's five lifecycle hooks remind the agent to recall context and save its conclusions. Codex uses the memory skill's guidance. The agent runs every memory command itself. No hook writes a memory.
  2. Writes enter a queue. remember and replace queue the text and return without waiting for a model response. A background worker adds a short summary, creates an embedding, and stores the memory. The text is stored as written.
  3. Recall searches stored memories. It combines keyword matches, vector similarity, and recency, then reranks the best candidates. recall --basic matches words in the text instead.

A memory stays until the agent replaces or forgets it, and nothing expires on its own. A replaced memory leaves recall, and insights show --history still lists it. A forgotten memory leaves recall too.

The design guide explains the architecture and the reasons behind it.

Separate stores

Named stores hold separate sets of memories:

memman store create work
memman --store work recall "deployment decisions"  # for one command
memman store use work                             # the default for every process

MEMMAN_STORE=work in a process's environment selects the store for that process, so two agent sessions on one host can use different stores. --store takes precedence over MEMMAN_STORE, and MEMMAN_STORE takes precedence over the default set by memman store use. Store management covers per-directory selection and moving a store between SQLite and Postgres.

Cost

On the default models, summaries for 1,000 stored memories cost $0.17. MongoDB Atlas bills the embedding and rerank calls that OpenRouter forwards, so this table states no price for them.

Step Default model Cost
Summaries for 1,000 memories ~anthropic/claude-haiku-latest $0.17
Embeddings for 1,000 memories and 1,000 queries voyageai/voyage-4-lite billed by Atlas
Reranking for 1,000 recalls voyageai/rerank-3-lite billed by Atlas

The summary figure rests on these assumptions:

  • Summaries. 1,200 input and 100 output tokens per memory, at $0.10 in and $0.50 out per million tokens (OpenRouter pricing).
  • Embeddings. Memories of 150 - 250 tokens and short queries.
  • Reranking. Up to 100 candidates per recall, 150 - 250 tokens per query and memory pair. A query of two words or fewer skips reranking.

Longer memories, retries, and other models change the total. memman calls the endpoint with its own API key, and a Claude Pro or Max subscription does not cover those charges. Provider setup lists the key each step uses and explains how to turn reranking off.

Operations and upgrades

memman status                  # memory counts for the selected store
memman scheduler status        # worker state and last run
memman doctor --text           # health checks, including live provider probes

The usage guide covers backups, failed writes, model changes, and configuration. While the scheduler is stopped, memman refuses remember, replace, and forget. recall continues to work.

After a package upgrade, memman install refreshes the installed hooks, scheduler unit, and settings:

pipx upgrade memman
memman install

Two commands remove the integration and the package:

memman uninstall
pipx uninstall memman

memman uninstall keeps the stored memories, the queue, and the logs. Uninstall lists the settings it removes.

Documentation

License

MIT

Metadata

Release files for memman 0.49.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memman 0.49.7
File Size Uploaded
memman-0.49.7.tar.gz 214.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memman 0.49.7
File Interpreter ABI Platform
memman-0.49.7-py3-none-any.whl Python 3 none any Details

Total release size: 464.5 kB

Release files / memman-0.49.7.tar.gz

Download URL memman-0.49.7.tar.gz
Size 214.6 kB
Tags Source
SHA-256 checksum
How to use checksums
de4431f543d8b41e0d4ab65e1a4cca186b0a47ccb675b96b661c473982beddaa
BLAKE2b-256 checksum
How to use checksums
a13eda43414f14cdccf5f6472b7e4da604674313fed67369499e904900ad52f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / memman-0.49.7-py3-none-any.whl

Download URL memman-0.49.7-py3-none-any.whl
Size 249.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6edc09d0af0b7c115ef450f44b20ae0e6178bb330920f68fe83d6ff5fb03cc9
BLAKE2b-256 checksum
How to use checksums
2d08716d76c8f1e1268b704e7927f95f419892b8eb580ad0e9d4f49f6eaddfee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.50.0

2 release files

This release

0.49.7 This release

2 release files

0.46.0

2 release files

0.45.5

2 release files

0.45.4

2 release files

0.45.3

2 release files

0.45.2

2 release files

0.45.1

2 release files

0.45.0

2 release files

0.44.9

2 release files

0.44.8

2 release files

0.44.7

2 release files

0.44.6

2 release files

0.44.5

2 release files

0.44.4

2 release files

0.44.3

2 release files

0.44.2

2 release files

0.43.9

2 release files

0.43.8

2 release files

0.43.7

2 release files

0.43.6

2 release files

0.43.5

2 release files

0.43.4

2 release files

0.43.3

2 release files

0.43.2

2 release files

0.43.1

2 release files

0.43.0

2 release files

0.42.9

2 release files

0.42.8

2 release files

0.42.6

2 release files

0.42.3

2 release files

0.42.0

2 release files

0.41.5

2 release files

0.41.4

2 release files

0.41.3

2 release files

0.41.2

2 release files

0.41.1

2 release files

0.41.0

2 release files

0.40.1

2 release files

0.40.0

2 release files

0.39.2

2 release files

0.39.1

2 release files

0.39.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.4

2 release files

0.36.3

2 release files

0.36.2

2 release files

0.36.1

2 release files

0.36.0

2 release files

0.35.1

2 release files

0.35.0

2 release files

0.26.1

2 release files

0.26.0

2 release files

0.25.6

2 release files

0.25.5

2 release files

0.25.4

2 release files

0.25.3

2 release files

0.25.2

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.6

2 release files

0.20.5

2 release files

0.20.4

2 release files

0.20.3

2 release files

0.20.2

2 release files

0.20.1

2 release files

0.17.3

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page