Breathing Memory
Breathing Memory is a local memory support system for coding agents. It exposes a stable stdio MCP server for agent clients, also exposes a typed in-process core API for non-MCP consumers, stores memory in SQLite, and isolates memory by project so one installation can be reused across repositories without mixing contexts.
Overview
Breathing Memory keeps collaboration context that an agent should remember but a repository should not need to encode everywhere.
- local stdio MCP server
- SQLite storage under user app-data, isolated by project
- fragment-centric public model built around
anchorandfragment - text-first retrieval today, with a public search surface already aligned for later semantic retrieval work
- dynamic
working / holdingmaintenance with a compression backend that uses a supported coding agent without polluting normal conversation history
Supported Clients
- Codex
- Python in-process consumers through
breathing_memory.core
Installation
The intended long-term user path is:
pip install 'breathing-memory[semantic]'
breathing-memory install-codex
breathing-memory install-codex registers the breathing-memory MCP server with the currently supported client, pins that registration to a stable project identity for the current repository, and creates or updates the managed Breathing Memory block in the current repository's AGENTS.md.
The default path is the user-level Codex config. If you want repository-local Codex config instead, choose it explicitly with breathing-memory install-codex --codex-config repo.
After upgrading the package, rerun breathing-memory install-codex to refresh the managed Breathing Memory block in AGENTS.md.
Published package:
- recommended:
pip install 'breathing-memory[semantic]' - minimal
super_liteinstall:pip install breathing-memory - contributor setup and unreleased local work: docs/dev-guide.md
Quickstart
Recommended first run:
python3 -m venv .venv
. .venv/bin/activate
pip install 'breathing-memory[semantic]'
breathing-memory doctor
breathing-memory install-codex
Useful commands:
breathing-memory doctor: inspect installation, active project identity, DB path selection, Codex registration state, and effective retrieval modebreathing-memory serve: start the stdio MCP serverbreathing-memory warmup: eagerly load the semantic embedding backend for the current environmentbreathing-memory inspect-memory --json: inspect current memory state- after
pip install -U ..., rerunbreathing-memory install-codexto refresh the managedAGENTS.mdguidance
Codex registration targets:
breathing-memory install-codex: write to the user-level Codex configbreathing-memory install-codex --codex-config repo: write to.codex/config.tomlin the current repository
Environment-specific setup:
- normal local environment
pip install 'breathing-memory[semantic]'breathing-memory doctorbreathing-memory install-codex
- repository-local Codex config, including DevContainer workflows that track
.codex/config.tomlpip install 'breathing-memory[semantic]'breathing-memory doctorbreathing-memory install-codex --codex-config repo
- slim containers where native build dependencies may be missing
- install Python headers and compiler toolchain first
- then run
pip install 'breathing-memory[semantic]' - confirm the effective mode with
breathing-memory doctor
- minimal lexical-only install
pip install breathing-memorybreathing-memory install-codex
- environments where you want to preload the semantic model before a session
pip install 'breathing-memory[semantic]'breathing-memory warmup
Usage Surfaces
Breathing Memory keeps the MCP surface stable while also supporting direct in-process use.
Use MCP when your agent runtime expects tools over stdio:
breathing-memory serve
Use the typed core API when your runtime wants to call memory directly in Python:
from breathing_memory.core import (
ReadActiveCollaborationPolicyRequest,
RememberRequest,
SearchRequest,
create_engine,
)
engine = create_engine()
engine.remember(RememberRequest(content="hello", actor="user"))
engine.search(SearchRequest(query="hello"))
engine.read_active_collaboration_policy(ReadActiveCollaborationPolicyRequest())
engine.close()
If you need to inspect or override the resolved project-scoped config first, call breathing_memory.core.resolve_memory_config(...) and pass the result to create_engine(...).
How Memory Works
Breathing Memory does not auto-capture the full client conversation by itself. The consuming runtime must call it explicitly, either through the MCP tools or through the typed core API.
At a high level:
- save turns explicitly
- search before answering
- record references and feedback only when they materially apply
The detailed MCP caller flow, duplicate-handling rules, and attribution rules live in docs/user-guide.md and docs/spec.md.
Current MCP tools:
memory_remembermemory_searchmemory_read_active_collaboration_policymemory_fetchmemory_recentmemory_feedbackmemory_stats
memory_search keeps the default response compact. When debugging retrieval, callers can opt in to per-result diagnostics with include_diagnostics=true.
Runtime Notes
Breathing Memory stores data under the user app-data directory resolved by platformdirs, then separates memory by project identity. The exact active path, retrieval mode, and Codex registration state can be inspected with breathing-memory doctor.
For Codex installs, install-codex pins the MCP registration to a stable project identity derived from the repository at install time, so the live MCP server does not drift with editor-side working directories. Older unpinned databases are not auto-migrated.
Runtime setup is intentionally framed as super_lite and default. Semantic warmup, HNSW readiness, and other operational details are documented in docs/user-guide.md. Normative runtime behavior lives in docs/spec.md.
Documentation Map
| Document | Primary role | Read this when |
|---|---|---|
README.md |
product entrypoint and public surface overview | you need the fastest overview of installation paths, usage surfaces, and the current supported clients |
docs/user-guide.md |
user-facing operation details | you are installing, registering, inspecting, or operating Breathing Memory as a runtime |
docs/dev-guide.md |
contributor-oriented setup and codebase orientation | you are editing this repository or integrating against the typed core API during development |
docs/spec.md |
normative behavior and implementation contract | you need the source of truth for runtime semantics, storage rules, and public behavior |
docs/design-rationale.md |
adopted design decisions and tradeoffs | you need to understand why the current boundaries and policies exist |
Further Reading
- docs/user-guide.md: installation, runtime operation, storage behavior, and MCP tool usage
- docs/dev-guide.md: contributor-oriented setup and repository layout
- docs/spec.md: normative behavior and implementation-facing rules
- docs/design-rationale.md: adopted design choices and the reasons behind them
Metadata
Release files for breathing-memory 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| breathing_memory-0.7.1.tar.gz | 74.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| breathing_memory-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 126.3 kB
Release files / breathing_memory-0.7.1.tar.gz
| Download URL | breathing_memory-0.7.1.tar.gz |
|---|---|
| Size | 74.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f75dae359f75777f93e911784da37311b3096ad5f33859b73653f5311b055344
|
|
BLAKE2b-256 checksum How to use checksums |
db5a567deb7c4b8e113c99a5c46551802aa9534741acee29547ca424bf311714
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 4, 2026.
Transparency logRelease files / breathing_memory-0.7.1-py3-none-any.whl
| Download URL | breathing_memory-0.7.1-py3-none-any.whl |
|---|---|
| Size | 52.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c6c50e401355441e8e10c49b6e705bd7c133f433363d28fc6dcd3e05cd6eaec
|
|
BLAKE2b-256 checksum How to use checksums |
ffbaf3ade08b85c8e53372d59859f7a50000baf611b45239c4e4707642f20c74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 4, 2026.
Transparency logSecurity for breathing-memory 0.7.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for breathing_memory-0.7.1.tar.gz
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 Apr 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.