Local Codex memory manager with an official Python SDK-based MCP server.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file breathing_memory-0.7.1.tar.gz.
File metadata
- Download URL: breathing_memory-0.7.1.tar.gz
- Upload date:
- Size: 74.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f75dae359f75777f93e911784da37311b3096ad5f33859b73653f5311b055344
|
|
| MD5 |
35138f9dcb807404e566cdb7bb4f9111
|
|
| BLAKE2b-256 |
db5a567deb7c4b8e113c99a5c46551802aa9534741acee29547ca424bf311714
|
Provenance
The following attestation bundles were made for breathing_memory-0.7.1.tar.gz:
Publisher:
publish.yml on KazinaG/breathing_memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breathing_memory-0.7.1.tar.gz -
Subject digest:
f75dae359f75777f93e911784da37311b3096ad5f33859b73653f5311b055344 - Sigstore transparency entry: 1237263049
- Sigstore integration time:
-
Permalink:
KazinaG/breathing_memory@71c18c6cf1607512d4ceb5033295304e4b23def7 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/KazinaG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@71c18c6cf1607512d4ceb5033295304e4b23def7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file breathing_memory-0.7.1-py3-none-any.whl.
File metadata
- Download URL: breathing_memory-0.7.1-py3-none-any.whl
- Upload date:
- Size: 52.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c6c50e401355441e8e10c49b6e705bd7c133f433363d28fc6dcd3e05cd6eaec
|
|
| MD5 |
eef499425549763bfdcd2bef3c787f94
|
|
| BLAKE2b-256 |
ffbaf3ade08b85c8e53372d59859f7a50000baf611b45239c4e4707642f20c74
|
Provenance
The following attestation bundles were made for breathing_memory-0.7.1-py3-none-any.whl:
Publisher:
publish.yml on KazinaG/breathing_memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breathing_memory-0.7.1-py3-none-any.whl -
Subject digest:
3c6c50e401355441e8e10c49b6e705bd7c133f433363d28fc6dcd3e05cd6eaec - Sigstore transparency entry: 1237263071
- Sigstore integration time:
-
Permalink:
KazinaG/breathing_memory@71c18c6cf1607512d4ceb5033295304e4b23def7 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/KazinaG
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@71c18c6cf1607512d4ceb5033295304e4b23def7 -
Trigger Event:
push
-
Statement type: