Skip to main content

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 runs as a stdio MCP server through the official Python MCP SDK, 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 anchor and fragment
  • text-first retrieval today, with a public search surface already aligned for later semantic retrieval work
  • dynamic working / holding maintenance with a compression backend that uses a supported coding agent without polluting normal conversation history

Supported Clients

  • Codex

Installation

The intended long-term user path is:

pip install breathing-memory
breathing-memory install-codex

breathing-memory install-codex registers the breathing-memory MCP server with the currently supported client and creates or updates the managed Breathing Memory block in the current repository's AGENTS.md.

This repository is configured for tag-based PyPI publishing through GitHub Actions. Until the first public release is published, install from Git or from a local clone:

pip install git+https://github.com/KazinaG/breathing_memory.git
# or inside a clone:
pip install -e .
breathing-memory install-codex

Release notes:

  • PyPI publish runs from .github/workflows/publish.yml
  • pushing a tag such as v0.1.0 triggers the build and PyPI publish workflow

Quickstart

Recommended first run:

python3 -m venv .venv
. .venv/bin/activate
pip install -e .
breathing-memory doctor
breathing-memory install-codex

Useful commands:

  • breathing-memory doctor: inspect installation, active project identity, DB path selection, and client registration state
  • breathing-memory serve: start the stdio MCP server
  • breathing-memory inspect-memory --json: inspect current memory state

How Memory Works

Breathing Memory does not auto-capture the full client conversation by itself. The supported operating path is explicit MCP use by the calling agent.

The basic flow is:

  1. If there is an unremembered final agent answer from the previous turn, save it first with memory_remember(actor="agent")
  2. Save the current user message with memory_remember(actor="user")
  3. Search before an answer with memory_search
  4. Record feedback with memory_feedback when the user clearly confirms or corrects remembered information

Key points:

  • one user utterance becomes one fragment
  • one final user-facing agent answer is normally remembered on the next user turn
  • commentary is not remembered
  • if the final answer materially used remembered fragments, pass those ids in source_fragment_ids
  • edits are modeled as forks rather than overwrites
  • duplicate deferred agent capture for the same reply target and content is suppressed
  • archived runtime files such as archived_sessions/*.jsonl are not the primary capture path
  • if no later user turn arrives, the final agent answer may remain unremembered

Current MCP tools:

  • memory_remember
  • memory_search
  • memory_fetch
  • memory_feedback
  • memory_stats

Runtime Notes

Breathing Memory stores data under the user app-data directory resolved by platformdirs, then separates memory by project identity. The exact SQLite path can be inspected with breathing-memory doctor.

The current implementation is text-only. Runtime auto resolves to super_lite, which performs lexical retrieval only. The public search surface is already aligned for later semantic retrieval work, but explicit lite and default modes are not supported in this slice.

The current compression backend invokes a supported coding agent without leaving normal conversation history. In the current supported setup, that path uses Codex through codex exec --ephemeral.

Further Reading

Project details


Download files

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

Source Distribution

breathing_memory-0.1.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

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

breathing_memory-0.1.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file breathing_memory-0.1.0.tar.gz.

File metadata

  • Download URL: breathing_memory-0.1.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for breathing_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42e9d67de73752b5dc473535deb55a37e4a0025a7cad5d7512afeb7b55de5ed1
MD5 52e5a275ada903cdc086fb9f0573055d
BLAKE2b-256 763a23cf19bc0f5ad22d511efd79c9b14e11f789a46208e3f35e44d9e52d4810

See more details on using hashes here.

Provenance

The following attestation bundles were made for breathing_memory-0.1.0.tar.gz:

Publisher: publish.yml on KazinaG/breathing_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 breathing_memory-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for breathing_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fbd0658a3c1335e6dd37a4a2706e1eee9e4b7b4d85e260e119693e164cce18d
MD5 4e65c7827e8b2a6cd3093c2701b0dad3
BLAKE2b-256 91d096101901555beadb0a5c39d3f1f413bdc5a2f9a144b2ccbeb9a928de50e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for breathing_memory-0.1.0-py3-none-any.whl:

Publisher: publish.yml on KazinaG/breathing_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