agent-memory-cli 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 (75) hide show
  1. agent_memory_cli-0.1.0/.gitignore +22 -0
  2. agent_memory_cli-0.1.0/CHANGELOG.md +23 -0
  3. agent_memory_cli-0.1.0/LICENSE +201 -0
  4. agent_memory_cli-0.1.0/Makefile +21 -0
  5. agent_memory_cli-0.1.0/PKG-INFO +261 -0
  6. agent_memory_cli-0.1.0/README.md +231 -0
  7. agent_memory_cli-0.1.0/pyproject.toml +73 -0
  8. agent_memory_cli-0.1.0/scripts/check_installed_wheel.py +210 -0
  9. agent_memory_cli-0.1.0/src/agent_memory/__init__.py +9 -0
  10. agent_memory_cli-0.1.0/src/agent_memory/__main__.py +9 -0
  11. agent_memory_cli-0.1.0/src/agent_memory/archive.py +359 -0
  12. agent_memory_cli-0.1.0/src/agent_memory/cli.py +437 -0
  13. agent_memory_cli-0.1.0/src/agent_memory/debrief.py +336 -0
  14. agent_memory_cli-0.1.0/src/agent_memory/doctor.py +710 -0
  15. agent_memory_cli-0.1.0/src/agent_memory/git_runner.py +68 -0
  16. agent_memory_cli-0.1.0/src/agent_memory/home.py +246 -0
  17. agent_memory_cli-0.1.0/src/agent_memory/layout.py +198 -0
  18. agent_memory_cli-0.1.0/src/agent_memory/org.py +218 -0
  19. agent_memory_cli-0.1.0/src/agent_memory/publication.py +433 -0
  20. agent_memory_cli-0.1.0/src/agent_memory/setup/__init__.py +53 -0
  21. agent_memory_cli-0.1.0/src/agent_memory/setup/claude.py +34 -0
  22. agent_memory_cli-0.1.0/src/agent_memory/setup/codex.py +39 -0
  23. agent_memory_cli-0.1.0/src/agent_memory/setup/common.py +1015 -0
  24. agent_memory_cli-0.1.0/src/agent_memory/setup/legacy.py +67 -0
  25. agent_memory_cli-0.1.0/src/agent_memory/startup.py +254 -0
  26. agent_memory_cli-0.1.0/src/agent_memory/status.py +137 -0
  27. agent_memory_cli-0.1.0/src/agent_memory/sync.py +649 -0
  28. agent_memory_cli-0.1.0/src/agent_memory/templates/org-memory/decisions.md +5 -0
  29. agent_memory_cli-0.1.0/src/agent_memory/templates/org-memory/recent.md +16 -0
  30. agent_memory_cli-0.1.0/src/agent_memory/templates/org-memory/rules.md +5 -0
  31. agent_memory_cli-0.1.0/src/agent_memory/templates/project-memory/decision_log.md +3 -0
  32. agent_memory_cli-0.1.0/src/agent_memory/templates/project-memory/known_debt.md +8 -0
  33. agent_memory_cli-0.1.0/src/agent_memory/templates/project-memory/open_threads.md +3 -0
  34. agent_memory_cli-0.1.0/src/agent_memory/templates/project-memory/project_facts.md +4 -0
  35. agent_memory_cli-0.1.0/src/agent_memory/templates/workflow/SKILL.md +42 -0
  36. agent_memory_cli-0.1.0/src/agent_memory/workflow.py +287 -0
  37. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/expected.json +10 -0
  38. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/.hidden/2026/08/20260825-alice-abc12345.md +14 -0
  39. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/demo-project/2026/08/20260825-alice-1f3a9c2b.md +14 -0
  40. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/demo-project/2026/08/20260825-alice-ABCD.md +14 -0
  41. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/demo-project/2026/08/20260825_alice_abc12345.md +14 -0
  42. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/demo-project/2026/09/20260825-alice-def12345.md +14 -0
  43. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/bad_layout/org-memory/debriefs/demo-project/20260825-alice-abc12345.md +14 -0
  44. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/empty_store/expected.json +4 -0
  45. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/empty_store/org-memory/debriefs/.gitkeep +0 -0
  46. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/missing_debriefs_dir/expected.json +10 -0
  47. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/missing_debriefs_dir/org-memory/recent.md +1 -0
  48. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/staging_artifact/expected.json +10 -0
  49. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/staging_artifact/org-memory/debriefs/demo-project/2026/08/.stage.20260825-alice-77xx88yy.md.a1b2c3 +1 -0
  50. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/staging_artifact/org-memory/debriefs/demo-project/2026/08/20260825-alice-1f3a9c2b.md +14 -0
  51. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/expected.json +4 -0
  52. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/org-memory/debriefs/.gitkeep +0 -0
  53. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/org-memory/debriefs/Demo_Project/2026/08/20260825-bob-ops-9f00aa11.md +14 -0
  54. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/org-memory/debriefs/demo-project/2026/08/20260825-alice-1f3a9c2b.md +14 -0
  55. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/org-memory/debriefs/demo.project/2026/07/20260701-Alice_2.dev-00aa11bb.md +14 -0
  56. agent_memory_cli-0.1.0/tests/conformance/org_memory/cases/valid_store/org-memory/debriefs/other-project/2026/12/20261203-bob-9e0d44aa.md +14 -0
  57. agent_memory_cli-0.1.0/tests/conftest.py +60 -0
  58. agent_memory_cli-0.1.0/tests/fixtures/setup/claude_settings_fleet.json +40 -0
  59. agent_memory_cli-0.1.0/tests/fixtures/setup/codex_hooks_kernel.json +29 -0
  60. agent_memory_cli-0.1.0/tests/golden/canonical_memory_gitignore.txt +9 -0
  61. agent_memory_cli-0.1.0/tests/golden/debrief_record.md +14 -0
  62. agent_memory_cli-0.1.0/tests/golden/doctor_memory_0.4.5.json +125 -0
  63. agent_memory_cli-0.1.0/tests/golden/doctor_memory_0.4.5.txt +28 -0
  64. agent_memory_cli-0.1.0/tests/test_archive.py +650 -0
  65. agent_memory_cli-0.1.0/tests/test_cli.py +300 -0
  66. agent_memory_cli-0.1.0/tests/test_debrief.py +1051 -0
  67. agent_memory_cli-0.1.0/tests/test_doctor.py +742 -0
  68. agent_memory_cli-0.1.0/tests/test_home.py +286 -0
  69. agent_memory_cli-0.1.0/tests/test_layout.py +222 -0
  70. agent_memory_cli-0.1.0/tests/test_org.py +404 -0
  71. agent_memory_cli-0.1.0/tests/test_setup.py +852 -0
  72. agent_memory_cli-0.1.0/tests/test_startup.py +384 -0
  73. agent_memory_cli-0.1.0/tests/test_status.py +181 -0
  74. agent_memory_cli-0.1.0/tests/test_sync.py +854 -0
  75. agent_memory_cli-0.1.0/tests/test_workflow.py +359 -0
@@ -0,0 +1,22 @@
1
+ /.venv/
2
+ /build/
3
+ /dist/
4
+ /.pytest_cache/
5
+ /.ruff_cache/
6
+ *.egg-info/
7
+ __pycache__/
8
+ *.py[cod]
9
+
10
+ # Signing material never belongs in a memory home or its tooling
11
+ keys/
12
+ *.pem
13
+ *.key
14
+
15
+ # Coding-agent tooling: instruction files, per-agent configuration, workspace
16
+ # markers and worktrees. Local to a checkout, never part of the package.
17
+ .claude/
18
+ .codex/
19
+ CLAUDE.md
20
+ AGENTS.md
21
+ .oacp
22
+ .worktrees/
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to agent-memory are documented in this file. The format
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the
5
+ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 0.1.0 - 2026-09-06
8
+
9
+ ### Added
10
+
11
+ - The `agent-memory-cli` distribution installs the `agent-memory` command, with no runtime dependencies ([Quick Start](README.md#quick-start)).
12
+ - `agent-memory init` builds the two-tier memory home from bundled templates and binds a repository ([init](docs/commands.md#init)).
13
+ - Home resolution follows a fixed precedence; an ancestor it cannot inspect is an error, not a fall-through ([status](docs/commands.md#status)).
14
+ - `agent-memory setup claude|codex` installs the runtime's session-start hook and memory workflow file ([setup](docs/commands.md#setup)).
15
+ - `agent-memory startup` prints the session-start read manifest: the memory files in order, never their content ([startup](docs/commands.md#startup)).
16
+ - `capture` records one decision; `recall` prints the manifest's files, cut at a character budget ([recall](docs/commands.md#capture-and-recall)).
17
+ - `debrief write` publishes a session debrief atomically, never replacing a published record ([debrief](docs/commands.md#debrief-write)).
18
+ - `archive` and `restore` move a memory file in and out of `memory/archive/`, following no symlink ([archive](docs/commands.md#archive-and-restore)).
19
+ - `enable`, `clone`, `pull`, `push` and `disable` operate a memory home as its own git repository ([sync](docs/commands.md#sync)).
20
+ - A memory commit carries only the paths the sync allowlist selects; `keys/` is refused at any depth ([sync](docs/commands.md#sync)).
21
+ - `status` reports which home resolved, whether its layout is in place and where sync stands ([status](docs/commands.md#status)).
22
+ - `doctor` checks the debrief store and the sync repository; it reads no memory content and repairs nothing ([doctor](docs/commands.md#doctor)).
23
+ - A `v*` tag publishes the distribution to PyPI with build attestations ([PyPI](https://pypi.org/project/agent-memory-cli/)).
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 kiloloop
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ PYTHON ?= python3
2
+
3
+ .PHONY: build lint preflight test wheel-check
4
+
5
+ lint:
6
+ $(PYTHON) -m ruff check .
7
+
8
+ test:
9
+ $(PYTHON) -m pytest -q
10
+
11
+ build:
12
+ $(PYTHON) -m build
13
+ $(PYTHON) -m twine check dist/*
14
+
15
+ preflight: lint test build
16
+
17
+ # Installs the freshly built wheel in a throwaway venv (no extras, no kernel) and
18
+ # proves it scaffolds and reads a memory home; add HOME_PATH=<path> to also run
19
+ # `status` against a live home.
20
+ wheel-check:
21
+ $(PYTHON) scripts/check_installed_wheel.py $(if $(HOME_PATH),--home $(HOME_PATH),)
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-memory-cli
3
+ Version: 0.1.0
4
+ Summary: Cross-session memory for coding agents: plain files, git-native, no server
5
+ Project-URL: Homepage, https://github.com/kiloloop/agent-memory
6
+ Project-URL: Source, https://github.com/kiloloop/agent-memory
7
+ Project-URL: Changelog, https://github.com/kiloloop/agent-memory/blob/main/CHANGELOG.md
8
+ Author: Kiloloop
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agents,git,markdown,memory
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development
23
+ Requires-Python: >=3.10
24
+ Provides-Extra: dev
25
+ Requires-Dist: build<2,>=1.2; extra == 'dev'
26
+ Requires-Dist: pytest<10,>=8; extra == 'dev'
27
+ Requires-Dist: ruff<1,>=0.11; extra == 'dev'
28
+ Requires-Dist: twine<8,>=7; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # agent-memory
32
+
33
+ Cross-session memory for coding agents — plain files, git-native, no server.
34
+
35
+ ## Why
36
+
37
+ Agents start sessions blank. Keep facts, decisions, and unfinished work in
38
+ Markdown you can read and edit.
39
+
40
+ Memory travels **between agents** via project files, **between projects** via
41
+ org rules, and **between machines** via optional git sync. Claude Code and Codex
42
+ share the store. No database, daemon, server, or runtime Python dependencies.
43
+
44
+ ## Quick Start
45
+
46
+ First time: install and bind. Every session after: recall context, capture decisions.
47
+
48
+ ### With your coding agent
49
+
50
+ Paste this into Claude Code or Codex from your repository:
51
+
52
+ ```text
53
+ Set up cross-session memory with agent-memory-cli from
54
+ https://pypi.org/project/agent-memory-cli/ and its source,
55
+ https://github.com/kiloloop/agent-memory.
56
+
57
+ Install with Python 3.10+. Ask for my home and project name, initialize and
58
+ bind this repository, and git-ignore the binding. Set up my runtime's hook
59
+ and workflow; report conflicts.
60
+
61
+ Capture a decision I provide, with its reason and runtime. Show status and
62
+ doctor. Next session here, recall context and report any truncation or sync
63
+ warning. Ask for my remote before enabling optional sync; keep pushing explicit.
64
+ ```
65
+
66
+ ### Manually
67
+
68
+ Python 3.10+ is required; sync needs git 2.25+, hooks use Bash, and
69
+ `archive`/`restore` are POSIX-only.
70
+
71
+ 1. **Install** with `uv tool install agent-memory-cli` or
72
+ `python -m pip install agent-memory-cli`. The distribution and the command
73
+ differ: installing `agent-memory-cli` gives you `agent-memory`. Put it on
74
+ your agent's PATH.
75
+ 2. **Bind**, from your repository root:
76
+
77
+ ```bash
78
+ agent-memory init --home "$HOME/agent-memory" --project my-app --repo .
79
+ ```
80
+
81
+ Git-ignore `.agent-memory.json`. Stay here; unset `AGENT_MEMORY_HOME`/`OACP_HOME` or point them at this
82
+ home: they precede the binding.
83
+ 3. **Set up** the runtime you use, then enable the hook there if required:
84
+
85
+ ```bash
86
+ agent-memory setup claude
87
+ # Or:
88
+ agent-memory setup codex
89
+ ```
90
+
91
+ 4. **Record now; recall next session** in this repository:
92
+
93
+ ```bash
94
+ agent-memory capture "Use SQLite for the cache." --why "no daemon" --agent codex
95
+ agent-memory recall
96
+ agent-memory status
97
+ agent-memory doctor
98
+ ```
99
+
100
+ Use `--agent claude` if appropriate; recall also works now for inspection.
101
+ 5. **Optionally sync.** Use an empty private remote. `enable --remote` pushes
102
+ the initial commit; substitute its URL:
103
+
104
+ ```bash
105
+ agent-memory enable --remote git@github.com:YOUR_ORG/agent-memory-store.git
106
+ agent-memory push --agent codex
107
+ # After another machine pushes, with a clean local tree:
108
+ agent-memory pull
109
+ ```
110
+
111
+ Elsewhere, `agent-memory clone <remote-url> --home <local-home>`, then repeat
112
+ binding and setup. Bind each machine separately; push explicitly.
113
+
114
+ ## How It Works
115
+
116
+ ![Four project memory files with sample Markdown](https://raw.githubusercontent.com/kiloloop/agent-memory/main/docs/images/project-memory.jpg)
117
+
118
+ *Illustrative files; not a bundled application UI.*
119
+
120
+ OACP defines the layout; this tool implements it. The four active files in
121
+ `projects/<name>/memory/` hold notes such as these trimmed samples:
122
+
123
+ | File | Purpose and sample |
124
+ | --- | --- |
125
+ | `project_facts.md` | Stable facts: FastAPI backend; Postgres; no PII in logs. |
126
+ | `decision_log.md` | Choices: 2026-05-09 — retry 5xx three times, with backoff and jitter. |
127
+ | `open_threads.md` | Work and owners: OAuth refresh race — waiting on Codex. |
128
+ | `known_debt.md` | Problems: replace the hard-coded session TTL with a setting. |
129
+
130
+ Date entries; supersede decisions by adding new ones. Close or pause threads,
131
+ write for humans, and distill transcripts. Edit other files directly; promote
132
+ debt to a thread when work starts.
133
+
134
+ `org-memory/` sits beside `projects/`: `recent.md`, `decisions.md`, and
135
+ `rules.md` carry shared context; `events/` and `debriefs/` hold records.
136
+ Most notes belong to a project. Use org memory only across repositories.
137
+
138
+ Home resolution: `--home` → `AGENT_MEMORY_HOME` → `OACP_HOME` → nearest ancestor
139
+ `.agent-memory.json` → workspace marker → `~/agent-memory`. A workspace marker
140
+ points into a home's `projects/` tree. Project selection uses `--project` or a
141
+ matching binding/marker. OACP is not required.
142
+
143
+ Sync makes the home a git repository with an allowlist and `.oacp-memory-repo`
144
+ marker. `push` commits selected paths; `pull` fast-forwards a clean tree that
145
+ is not ahead or diverged. No merges; keys and setup receipts stay local.
146
+ Network verbs time out after 30 seconds.
147
+
148
+ `setup` installs a SessionStart hook and memory workflow. `startup` lists
149
+ metadata for the four project files, then the three curated org files; it
150
+ injects no content. `--pull` refreshes first, warning on failure. The workflow
151
+ tells the agent to run `recall` for an 8,000-character bounded read. Raise
152
+ `--max-chars` or read remaining files directly when cut. `capture` records
153
+ decisions during work. At the end, update threads and debt, optionally publish
154
+ a summary with `debrief write`, and explicitly `push`; no push hook is installed.
155
+
156
+ Startup and recall exclude `archive/`, `events/`, and `debriefs/`. This is not
157
+ a vector database, RAG pipeline, or chat-history store: no embeddings,
158
+ similarity queries, synthesis, or indexing. Recall reads a fixed file set.
159
+
160
+ ### Commands
161
+
162
+ | Command | Purpose |
163
+ | --- | --- |
164
+ | [`status`][status] | Inspect home and sync. |
165
+ | [`doctor`][doctor] | Check health; repair nothing. |
166
+ | [`init`][init] | Scaffold and bind. |
167
+ | [`org init`][init] | Scaffold org memory. |
168
+ | [`enable`][sync] | Enable git sync. |
169
+ | [`clone`][sync] | Clone a memory remote. |
170
+ | [`pull`][sync] | Fast-forward from upstream. |
171
+ | [`push`][sync] | Commit selected files and push. |
172
+ | [`disable`][sync] | Disable sync. |
173
+ | [`archive`][archive-and-restore] | Archive a supplementary file. |
174
+ | [`restore`][archive-and-restore] | Restore to an empty slot. |
175
+ | [`setup`][setup] | Install runtime integration. |
176
+ | [`startup`][startup] | Print the metadata manifest. |
177
+ | [`capture`][capture-and-recall] | Record a decision. |
178
+ | [`recall`][capture-and-recall] | Read bounded context. |
179
+ | [`debrief write`][debrief-write] | Publish a session summary. |
180
+
181
+ [status]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#status
182
+ [doctor]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#doctor
183
+ [init]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#init
184
+ [sync]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#sync
185
+ [archive-and-restore]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#archive-and-restore
186
+ [setup]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#setup
187
+ [startup]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#startup
188
+ [capture-and-recall]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#capture-and-recall
189
+ [debrief-write]: https://github.com/kiloloop/agent-memory/blob/main/docs/commands.md#debrief-write
190
+
191
+ ## Examples
192
+
193
+ Scratch run in `/private/tmp/am-readme-demo`: init/startup/recall excerpts;
194
+ other outputs complete.
195
+
196
+ ```console
197
+ $ agent-memory init --home memory --project demo
198
+ Initialized memory home: /private/tmp/am-readme-demo/memory
199
+ ```
200
+
201
+ ```console
202
+ $ agent-memory startup --home memory --project demo --runtime claude --max-chars 420
203
+ agent-memory startup (claude): home /private/tmp/am-readme-demo/memory (flag), project demo (flag)
204
+ Project memory, read in this order (states are readability only; no content is injected):
205
+ ```
206
+
207
+ ```console
208
+ $ agent-memory capture 'Use SQLite for the cache.' --why 'no daemon' --agent codex --home memory --project demo
209
+ captured: /private/tmp/am-readme-demo/memory/projects/demo/memory/decision_log.md (## 2026-09-07)
210
+ - **Use SQLite for the cache.** Why: no daemon (codex, 2026-09-07T01:53:42Z)
211
+ ```
212
+
213
+ ```console
214
+ $ agent-memory recall --home memory --project demo --max-chars 850
215
+ ## 2026-09-07
216
+
217
+ - **Use SQLite for the cache.** Why: no daemon (codex, 2026-09-07T01:53:42Z)
218
+ ```
219
+
220
+ ```console
221
+ $ agent-memory status --home memory
222
+ home: memory
223
+ source: flag
224
+ exists: yes
225
+ marker: absent
226
+ gitignore: canonical
227
+ org-memory: present
228
+ projects: 1 with a memory dir
229
+ sync: not configured
230
+ ```
231
+
232
+ ```console
233
+ $ agent-memory doctor --home memory
234
+ [+] Org Memory
235
+ [+] org-memory/debriefs/ — present
236
+ [+] debriefs/ — empty store, nothing to validate
237
+
238
+ [-] Memory Sync
239
+ [-] .oacp-memory-repo — not configured; memory sync hooks are disabled
240
+ Run: agent-memory enable [--remote URL]
241
+
242
+ No issues found.
243
+ ```
244
+
245
+ ## Project
246
+
247
+ - [PyPI package: agent-memory-cli](https://pypi.org/project/agent-memory-cli/)
248
+ - [Source](https://github.com/kiloloop/agent-memory)
249
+ - [OACP](https://github.com/kiloloop/oacp)
250
+
251
+ ## License
252
+
253
+ Apache-2.0. See [LICENSE](https://github.com/kiloloop/agent-memory/blob/main/LICENSE).
254
+
255
+ ## Development
256
+
257
+ Activate `.venv` before running the two `make` commands.
258
+
259
+ python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
260
+ make preflight # lint, test, build
261
+ make wheel-check # install the built wheel in a throwaway venv and prove it operates a home