breathing-memory 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. breathing_memory-0.1.0/LICENSE +21 -0
  2. breathing_memory-0.1.0/PKG-INFO +128 -0
  3. breathing_memory-0.1.0/README.md +105 -0
  4. breathing_memory-0.1.0/pyproject.toml +37 -0
  5. breathing_memory-0.1.0/setup.cfg +4 -0
  6. breathing_memory-0.1.0/src/breathing_memory/__init__.py +23 -0
  7. breathing_memory-0.1.0/src/breathing_memory/__main__.py +7 -0
  8. breathing_memory-0.1.0/src/breathing_memory/cli.py +571 -0
  9. breathing_memory-0.1.0/src/breathing_memory/compression.py +100 -0
  10. breathing_memory-0.1.0/src/breathing_memory/config.py +25 -0
  11. breathing_memory-0.1.0/src/breathing_memory/engine.py +546 -0
  12. breathing_memory-0.1.0/src/breathing_memory/mcp_server.py +209 -0
  13. breathing_memory-0.1.0/src/breathing_memory/models.py +48 -0
  14. breathing_memory-0.1.0/src/breathing_memory/runtime.py +89 -0
  15. breathing_memory-0.1.0/src/breathing_memory/store.py +519 -0
  16. breathing_memory-0.1.0/src/breathing_memory.egg-info/PKG-INFO +128 -0
  17. breathing_memory-0.1.0/src/breathing_memory.egg-info/SOURCES.txt +24 -0
  18. breathing_memory-0.1.0/src/breathing_memory.egg-info/dependency_links.txt +1 -0
  19. breathing_memory-0.1.0/src/breathing_memory.egg-info/entry_points.txt +2 -0
  20. breathing_memory-0.1.0/src/breathing_memory.egg-info/requires.txt +2 -0
  21. breathing_memory-0.1.0/src/breathing_memory.egg-info/top_level.txt +1 -0
  22. breathing_memory-0.1.0/tests/test_cli.py +403 -0
  23. breathing_memory-0.1.0/tests/test_compression.py +42 -0
  24. breathing_memory-0.1.0/tests/test_engine.py +330 -0
  25. breathing_memory-0.1.0/tests/test_mcp.py +176 -0
  26. breathing_memory-0.1.0/tests/test_runtime.py +183 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KazinaG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: breathing-memory
3
+ Version: 0.1.0
4
+ Summary: Local Codex memory manager with an official Python SDK-based MCP server.
5
+ Author: OpenAI Codex
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/KazinaG/breathing_memory
8
+ Project-URL: Repository, https://github.com/KazinaG/breathing_memory
9
+ Keywords: codex,mcp,memory,sqlite,agent
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: mcp<2,>=1.26
21
+ Requires-Dist: platformdirs<5,>=4
22
+ Dynamic: license-file
23
+
24
+ # Breathing Memory
25
+
26
+ 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.
27
+
28
+ ## Overview
29
+
30
+ Breathing Memory keeps collaboration context that an agent should remember but a repository should not need to encode everywhere.
31
+
32
+ - local stdio MCP server
33
+ - SQLite storage under user app-data, isolated by project
34
+ - fragment-centric public model built around `anchor` and `fragment`
35
+ - text-first retrieval today, with a public search surface already aligned for later semantic retrieval work
36
+ - dynamic `working / holding` maintenance with a compression backend that uses a supported coding agent without polluting normal conversation history
37
+
38
+ ## Supported Clients
39
+
40
+ - Codex
41
+
42
+ ## Installation
43
+
44
+ The intended long-term user path is:
45
+
46
+ ```bash
47
+ pip install breathing-memory
48
+ breathing-memory install-codex
49
+ ```
50
+
51
+ `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`.
52
+
53
+ 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:
54
+
55
+ ```bash
56
+ pip install git+https://github.com/KazinaG/breathing_memory.git
57
+ # or inside a clone:
58
+ pip install -e .
59
+ breathing-memory install-codex
60
+ ```
61
+
62
+ Release notes:
63
+
64
+ - PyPI publish runs from `.github/workflows/publish.yml`
65
+ - pushing a tag such as `v0.1.0` triggers the build and PyPI publish workflow
66
+
67
+ ## Quickstart
68
+
69
+ Recommended first run:
70
+
71
+ ```bash
72
+ python3 -m venv .venv
73
+ . .venv/bin/activate
74
+ pip install -e .
75
+ breathing-memory doctor
76
+ breathing-memory install-codex
77
+ ```
78
+
79
+ Useful commands:
80
+
81
+ - `breathing-memory doctor`: inspect installation, active project identity, DB path selection, and client registration state
82
+ - `breathing-memory serve`: start the stdio MCP server
83
+ - `breathing-memory inspect-memory --json`: inspect current memory state
84
+
85
+ ## How Memory Works
86
+
87
+ Breathing Memory does not auto-capture the full client conversation by itself. The supported operating path is explicit MCP use by the calling agent.
88
+
89
+ The basic flow is:
90
+
91
+ 1. If there is an unremembered final agent answer from the previous turn, save it first with `memory_remember(actor="agent")`
92
+ 2. Save the current user message with `memory_remember(actor="user")`
93
+ 3. Search before an answer with `memory_search`
94
+ 4. Record feedback with `memory_feedback` when the user clearly confirms or corrects remembered information
95
+
96
+ Key points:
97
+
98
+ - one user utterance becomes one fragment
99
+ - one final user-facing agent answer is normally remembered on the next user turn
100
+ - commentary is not remembered
101
+ - if the final answer materially used remembered fragments, pass those ids in `source_fragment_ids`
102
+ - edits are modeled as forks rather than overwrites
103
+ - duplicate deferred agent capture for the same reply target and content is suppressed
104
+ - archived runtime files such as `archived_sessions/*.jsonl` are not the primary capture path
105
+ - if no later user turn arrives, the final agent answer may remain unremembered
106
+
107
+ Current MCP tools:
108
+
109
+ - `memory_remember`
110
+ - `memory_search`
111
+ - `memory_fetch`
112
+ - `memory_feedback`
113
+ - `memory_stats`
114
+
115
+ ## Runtime Notes
116
+
117
+ 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`.
118
+
119
+ 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.
120
+
121
+ 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`.
122
+
123
+ ## Further Reading
124
+
125
+ - [docs/user-guide.md](docs/user-guide.md): installation, runtime operation, storage behavior, and MCP tool usage
126
+ - [docs/dev-guide.md](docs/dev-guide.md): contributor-oriented setup and repository layout
127
+ - [docs/spec.md](docs/spec.md): normative behavior and implementation-facing rules
128
+ - [docs/design-rationale.md](docs/design-rationale.md): adopted design choices and the reasons behind them
@@ -0,0 +1,105 @@
1
+ # Breathing Memory
2
+
3
+ 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.
4
+
5
+ ## Overview
6
+
7
+ Breathing Memory keeps collaboration context that an agent should remember but a repository should not need to encode everywhere.
8
+
9
+ - local stdio MCP server
10
+ - SQLite storage under user app-data, isolated by project
11
+ - fragment-centric public model built around `anchor` and `fragment`
12
+ - text-first retrieval today, with a public search surface already aligned for later semantic retrieval work
13
+ - dynamic `working / holding` maintenance with a compression backend that uses a supported coding agent without polluting normal conversation history
14
+
15
+ ## Supported Clients
16
+
17
+ - Codex
18
+
19
+ ## Installation
20
+
21
+ The intended long-term user path is:
22
+
23
+ ```bash
24
+ pip install breathing-memory
25
+ breathing-memory install-codex
26
+ ```
27
+
28
+ `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`.
29
+
30
+ 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:
31
+
32
+ ```bash
33
+ pip install git+https://github.com/KazinaG/breathing_memory.git
34
+ # or inside a clone:
35
+ pip install -e .
36
+ breathing-memory install-codex
37
+ ```
38
+
39
+ Release notes:
40
+
41
+ - PyPI publish runs from `.github/workflows/publish.yml`
42
+ - pushing a tag such as `v0.1.0` triggers the build and PyPI publish workflow
43
+
44
+ ## Quickstart
45
+
46
+ Recommended first run:
47
+
48
+ ```bash
49
+ python3 -m venv .venv
50
+ . .venv/bin/activate
51
+ pip install -e .
52
+ breathing-memory doctor
53
+ breathing-memory install-codex
54
+ ```
55
+
56
+ Useful commands:
57
+
58
+ - `breathing-memory doctor`: inspect installation, active project identity, DB path selection, and client registration state
59
+ - `breathing-memory serve`: start the stdio MCP server
60
+ - `breathing-memory inspect-memory --json`: inspect current memory state
61
+
62
+ ## How Memory Works
63
+
64
+ Breathing Memory does not auto-capture the full client conversation by itself. The supported operating path is explicit MCP use by the calling agent.
65
+
66
+ The basic flow is:
67
+
68
+ 1. If there is an unremembered final agent answer from the previous turn, save it first with `memory_remember(actor="agent")`
69
+ 2. Save the current user message with `memory_remember(actor="user")`
70
+ 3. Search before an answer with `memory_search`
71
+ 4. Record feedback with `memory_feedback` when the user clearly confirms or corrects remembered information
72
+
73
+ Key points:
74
+
75
+ - one user utterance becomes one fragment
76
+ - one final user-facing agent answer is normally remembered on the next user turn
77
+ - commentary is not remembered
78
+ - if the final answer materially used remembered fragments, pass those ids in `source_fragment_ids`
79
+ - edits are modeled as forks rather than overwrites
80
+ - duplicate deferred agent capture for the same reply target and content is suppressed
81
+ - archived runtime files such as `archived_sessions/*.jsonl` are not the primary capture path
82
+ - if no later user turn arrives, the final agent answer may remain unremembered
83
+
84
+ Current MCP tools:
85
+
86
+ - `memory_remember`
87
+ - `memory_search`
88
+ - `memory_fetch`
89
+ - `memory_feedback`
90
+ - `memory_stats`
91
+
92
+ ## Runtime Notes
93
+
94
+ 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`.
95
+
96
+ 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.
97
+
98
+ 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`.
99
+
100
+ ## Further Reading
101
+
102
+ - [docs/user-guide.md](docs/user-guide.md): installation, runtime operation, storage behavior, and MCP tool usage
103
+ - [docs/dev-guide.md](docs/dev-guide.md): contributor-oriented setup and repository layout
104
+ - [docs/spec.md](docs/spec.md): normative behavior and implementation-facing rules
105
+ - [docs/design-rationale.md](docs/design-rationale.md): adopted design choices and the reasons behind them
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "breathing-memory"
7
+ version = "0.1.0"
8
+ description = "Local Codex memory manager with an official Python SDK-based MCP server."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "OpenAI Codex" }]
12
+ license = "MIT"
13
+ license-files = ["LICENSE"]
14
+ dependencies = ["mcp>=1.26,<2", "platformdirs>=4,<5"]
15
+ keywords = ["codex", "mcp", "memory", "sqlite", "agent"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Software Development",
24
+ ]
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/KazinaG/breathing_memory"
28
+ Repository = "https://github.com/KazinaG/breathing_memory"
29
+
30
+ [project.scripts]
31
+ breathing-memory = "breathing_memory.__main__:main"
32
+
33
+ [tool.setuptools]
34
+ package-dir = {"" = "src"}
35
+
36
+ [tool.setuptools.packages.find]
37
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ from .cli import main
2
+ from .compression import CodexExecCompressionBackend, CompressionBackend, StubCompressionBackend
3
+ from .config import EngineTuning, MemoryConfig
4
+ from .engine import BreathingMemoryEngine
5
+ from .mcp_server import create_mcp_server, serve_stdio, serve_stdio_server
6
+ from .runtime import resolve_db_path, resolve_project_identity
7
+ from .store import SQLiteStore
8
+
9
+ __all__ = [
10
+ "BreathingMemoryEngine",
11
+ "CodexExecCompressionBackend",
12
+ "CompressionBackend",
13
+ "EngineTuning",
14
+ "MemoryConfig",
15
+ "SQLiteStore",
16
+ "StubCompressionBackend",
17
+ "create_mcp_server",
18
+ "main",
19
+ "resolve_db_path",
20
+ "resolve_project_identity",
21
+ "serve_stdio",
22
+ "serve_stdio_server",
23
+ ]
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from .cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())