memorykit 0.6.0__py3-none-any.whl

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.
@@ -0,0 +1,292 @@
1
+ Metadata-Version: 2.4
2
+ Name: memorykit
3
+ Version: 0.6.0
4
+ Summary: Provenance-bound durable memory: an immutable record contract, a validator, append-only review state, and a standard-library stdio MCP server. No Python dependencies; requires git on PATH.
5
+ Project-URL: Homepage, https://github.com/mbeacom/context-kit
6
+ Project-URL: Repository, https://github.com/mbeacom/context-kit
7
+ Project-URL: Changelog, https://github.com/mbeacom/context-kit/blob/main/plugins/memory/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/mbeacom/context-kit/issues
9
+ Author: Mark Beacom
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 Mark Beacom
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: agent-memory,context-engineering,continuity,durable-memory,mcp,memory,model-context-protocol,provenance,validator
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Environment :: Console
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3 :: Only
39
+ Classifier: Topic :: Software Development :: Libraries
40
+ Classifier: Topic :: Text Processing :: Indexing
41
+ Requires-Python: >=3.10
42
+ Description-Content-Type: text/markdown
43
+
44
+ # memory
45
+
46
+ Durable, provenance-bound memory for project decisions, constraints, procedures,
47
+ facts, and bounded episodes. The plugin adds a portable memory contract,
48
+ capture/recall/review commands, a standard-library provider adapter, and
49
+ opt-in Claude lifecycle hooks.
50
+
51
+ The bundled `rag` provider gives offline semantic recall using `indexkit`,
52
+ which is a hard dependency. MemPalace remains optional and is installed
53
+ separately. `indexkit` is also the general corpus RAG engine;
54
+ `context-handoff` remains the authoritative current-task artifact.
55
+
56
+ ## Install
57
+
58
+ ```bash
59
+ # GitHub Copilot
60
+ copilot plugin marketplace add mbeacom/context-kit
61
+ copilot plugin install memory@context-kit
62
+
63
+ # APM
64
+ apm marketplace add mbeacom/context-kit
65
+ apm install memory@context-kit
66
+
67
+ # Claude Code
68
+ /plugin marketplace add mbeacom/context-kit
69
+ /plugin install memory@context-kit
70
+ ```
71
+
72
+ Installing `memory` also installs `context-handoff`, `verify`, and
73
+ `retrieval-core`.
74
+
75
+ ### Without a plugin host: the `memorykit` package
76
+
77
+ The contract, validator, and MCP server are also packaged as **`memorykit`**, a
78
+ pure-standard-library Python package (ADR-0002, ADR-0009).
79
+
80
+ > **Not on PyPI yet.** The package is publish-ready but the name has not been
81
+ > claimed, so `pip install memorykit` does **not** currently install this — it
82
+ > will fail, or, if someone else claims the name first, install something else
83
+ > entirely. Until the release workflow runs, install from a clone.
84
+
85
+ ```bash
86
+ # From a clone of https://github.com/mbeacom/context-kit
87
+ pip install ./plugins/memory # or: uv tool install ./plugins/memory
88
+ ```
89
+
90
+ Once published, that becomes:
91
+
92
+ ```bash
93
+ pip install memorykit # or: uv tool install memorykit
94
+ ```
95
+
96
+ Either way that is the whole install: no bootstrap step, no plugin runtime, no
97
+ Claude-specific paths.
98
+
99
+ ```bash
100
+ export CONTEXT_KIT_MEMORY_PROJECT=owner/repository
101
+
102
+ memorykit validate record.md
103
+ memorykit capture record.md
104
+ memorykit search "why did we change retry policy"
105
+ memorykit-mcp # stdio MCP server, for an MCP client to spawn
106
+ ```
107
+
108
+ **Requirements: Python 3.10+ and `git` on `PATH`.** The package has no Python
109
+ package dependencies — `pip install` pulls in nothing else, and the test suite
110
+ enforces that, because being importable with an empty `site-packages` is what
111
+ makes this separable from the plugin at all. It is not, however, free of *system*
112
+ dependencies: `validate` and `capture` shell out to `git check-ref-format` to
113
+ check the `branch` field, so both refuse on a machine with no `git`. That is
114
+ deliberate. Reimplementing Git's refname rules in Python would be a fresh,
115
+ unreviewed reimplementation of a validation the contract depends on, and skipping
116
+ the check when `git` is missing would silently weaken provenance exactly where a
117
+ mistake benefits from it. Records describe a Git checkout — they carry
118
+ `repository`, `branch`, and `head` — so requiring Git to validate one is close to
119
+ tautological.
120
+
121
+ What the package does **not** include is the plugin — the `memory-workflows`
122
+ skill, the `/capture-memory`, `/recall-memory`, `/review-memory`, and
123
+ `/archive-handoff` commands, and the lifecycle hooks are agent-host content, not
124
+ a Python package, and remain plugin-only. The package is the engine; the plugin
125
+ is the engine plus the workflow that drives it.
126
+
127
+ The plugin bundles this same code and prefers its **bundled** copy over any
128
+ installed `memorykit`, so plugin version X always runs provider version X. That
129
+ is the reverse of the `indexkit` launcher's preference, and deliberate.
130
+
131
+ ## Local-only reviewed records
132
+
133
+ Python 3 is the only requirement. Configure an explicit project and plugin root:
134
+
135
+ ```bash
136
+ export CONTEXT_KIT_MEMORY_PROJECT=owner/repository
137
+ export CONTEXT_KIT_MEMORY_ROOT="/path/to/context-kit/plugins/memory"
138
+
139
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" validate record.md
140
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
141
+ capture record.md --provider none
142
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
143
+ search "why did we change retry policy" --provider none
144
+ ```
145
+
146
+ Records default to `~/.local/share/context-kit/memory`; override with
147
+ `CONTEXT_KIT_MEMORY_HOME`. Local recall searches reviewed primary memories and
148
+ cue anchors without requiring an external provider. Active recall uses only
149
+ effective `accepted/current` records. Captured record files never change:
150
+ `record-state <id> --reason ...` appends reviewed state transitions instead.
151
+ Use `search --include-inactive` for a local audit of inactive history.
152
+
153
+ ## Semantic recall with the bundled `rag` provider
154
+
155
+ Local recall is lexical. For meaning-based recall, use the first-party `rag`
156
+ provider — this repository's `indexkit` plugin, installed automatically as a
157
+ dependency, so **no external memory provider is required**. It still needs a
158
+ running Ollama for embeddings, plus a usable `indexkit` runtime:
159
+
160
+ ```bash
161
+ pip install indexkit # or: bash plugins/indexkit/scripts/bootstrap.sh
162
+ ollama pull nomic-embed-text
163
+ export CONTEXT_KIT_MEMORY_PROVIDER=rag
164
+
165
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" doctor
166
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" sync-provider --apply
167
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
168
+ search "why did we change retry policy"
169
+ ```
170
+
171
+ `doctor` resolves the `indexkit` executable and reports `ready` for either a
172
+ packaged install or the plugin's bootstrapped venv. When neither is usable it
173
+ refuses with the exact bootstrap command; `doctor --bootstrap` builds the venv
174
+ in place, which needs `uv`. Claude Code and GitHub Copilot CLI both run the
175
+ `indexkit` `SessionStart` hook, so this matters most on APM, which does not
176
+ deploy hooks, and after an upgrade leaves a stale venv.
177
+
178
+ Records stay the system of record: the index is a rebuildable projection of
179
+ accepted/current records, and hits are bound back to those records before being
180
+ returned. If the provider is unreachable, `search` falls back to lexical local
181
+ search and labels the result `degraded_from` rather than passing lexical hits
182
+ off as semantic recall. A stale index refuses instead of degrading.
183
+
184
+ See [`references/provider-rag.md`](skills/memory-workflows/references/provider-rag.md).
185
+
186
+ ## Optional MemPalace provider
187
+
188
+ ```bash
189
+ uv tool install mempalace
190
+ export CONTEXT_KIT_MEMORY_PROVIDER=mempalace
191
+
192
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" doctor
193
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
194
+ search "why did we change retry policy"
195
+ ```
196
+
197
+ Each configured project gets an isolated MemPalace palace. The adapter uses
198
+ exact argv with no shell, preserves records locally, and never installs or
199
+ imports MemPalace itself. Only `sync-provider --apply` writes or rebuilds the
200
+ provider store. Eligible capture records a pending-sync receipt; run an
201
+ explicit sync after eligible captures or state changes before provider-backed
202
+ recall. Reconciliation preserves the immediately previous store before replacement and
203
+ removes older generated backups after the success receipt is durable.
204
+
205
+ ## Mine past Copilot sessions
206
+
207
+ `propose-from-session` extracts the human-visible conversation from GitHub
208
+ Copilot CLI logs into reviewable candidates. It proposes; it never captures:
209
+
210
+ ```bash
211
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
212
+ propose-from-session ~/.copilot/session-state # dry run, writes nothing
213
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/scripts/memory-provider.py" \
214
+ propose-from-session ~/.copilot/session-state --write
215
+ ```
216
+
217
+ Only top-level human and assistant turns are retained. Subagent task prompts,
218
+ generated skill/agent/command context, tool-nested messages, and model reasoning
219
+ are excluded by construction — across a real 115-session corpus only 24 of 729
220
+ `user.message` events were actually human-authored. Detected credentials block
221
+ the write unless `--redact` is passed. A transcript is not an atomic memory, so
222
+ authoring a `memory-v1` record from a candidate stays an explicit judgment step.
223
+
224
+ See [`references/session-mining.md`](skills/memory-workflows/references/session-mining.md).
225
+
226
+ ## MCP surface for non-plugin hosts
227
+
228
+ An optional stdio MCP server exposes `memory_recall`, `memory_capture`, and
229
+ `memory_review` so hosts that consume skills plus MCP can use durable memory
230
+ without a plugin runtime. It is standard library only and shells out to the
231
+ same provider, so the CLI and MCP paths cannot drift.
232
+
233
+ ```bash
234
+ # From the plugin:
235
+ CONTEXT_KIT_MEMORY_PROJECT=owner/repository \
236
+ python3 "$CONTEXT_KIT_MEMORY_ROOT/mcp/server.py"
237
+
238
+ # From the package, with no plugin at all:
239
+ CONTEXT_KIT_MEMORY_PROJECT=owner/repository memorykit-mcp
240
+ ```
241
+
242
+ The surface can propose memory but **cannot activate it**: a record whose
243
+ frontmatter is not `review: proposed` is refused, and proposals stay out of
244
+ active recall until promoted with the append-only `record-state` CLI.
245
+ `sync-provider`, promotion, mining, and destructive operations are not exposed.
246
+
247
+ See [`references/mcp-server.md`](skills/memory-workflows/references/mcp-server.md).
248
+
249
+ ## Opt-in lifecycle queue
250
+
251
+ Claude hooks are inert until enabled:
252
+
253
+ ```bash
254
+ export CONTEXT_KIT_MEMORY_PROJECT=owner/repository
255
+ export CONTEXT_KIT_MEMORY_AUTO_CAPTURE=true
256
+ ```
257
+
258
+ Enabled hooks queue exact payloads locally for explicit review; they never create
259
+ memory records or mutate a provider store. Claude Code and GitHub Copilot CLI
260
+ both load `hooks/hooks.json`; APM does not deploy hooks, so capture stays an
261
+ explicit command there.
262
+
263
+ ## Components
264
+
265
+ | Component | Purpose |
266
+ | --- | --- |
267
+ | `memory-workflows` skill | Capture, recall, freshness, cue, and consolidation policy. |
268
+ | `/capture-memory` | Build and validate one reviewed durable record. |
269
+ | `/recall-memory` | Search memory, then pin current evidence. |
270
+ | `/review-memory` | Review freshness, conflicts, and consolidation proposals. |
271
+ | `/archive-handoff` | Explicitly preserve a validated handoff as historical memory. |
272
+ | `memory-provider.py` | Launcher for the `memorykit` provider: stdlib validator, local store, MemPalace adapter, and hook dispatcher. |
273
+ | `src/memorykit/` | The packaged engine (`memorykit`, not yet on PyPI): contract, validator, provider, MCP server. |
274
+
275
+ ## Safety boundaries
276
+
277
+ - New records start proposed and retain immutable evidence.
278
+ - Recall results are leads, not proof.
279
+ - Consolidation creates supersession history; it does not erase evidence.
280
+ - Lifecycle payload queuing is disabled by default.
281
+ - Project data never falls back to a global provider store.
282
+ - MemPalace and Memora informed the design; this implementation is independent.
283
+
284
+ ## Supported providers
285
+
286
+ Three provider modes are supported: `none` (lexical, no dependencies), `rag`
287
+ (first-party offline semantic recall via the bundled `indexkit` dependency),
288
+ and `mempalace` (optional, installed separately). Memora informed the memory
289
+ contract design but is not a runtime provider today.
290
+ See [`skills/memory-workflows/references/provider-qualification.md`](skills/memory-workflows/references/provider-qualification.md)
291
+ for the full qualification policy and the current decision table with revisit
292
+ triggers for Memora.
@@ -0,0 +1,9 @@
1
+ memorykit/__init__.py,sha256=w4WydsLBq_QkkH-fUMyfoXAoEOdDCL2hj1kTXHr1QI8,894
2
+ memorykit/__main__.py,sha256=l68DytMjiCBoyL1JppTD2Jn-cuKB9Cn95q1Ou9KxAtU,446
3
+ memorykit/mcp.py,sha256=J5y9uZP18ZhJZNXsj2bRsim2Vas6l_17fwt9oJ1s3kk,13848
4
+ memorykit/provider.py,sha256=DKswbolhn4lQGoYXoH2Lm-8iqZHwZG7iPFwVj1rJHh0,107797
5
+ memorykit-0.6.0.dist-info/METADATA,sha256=n94GF2_zafZl5ucHBfQao2ajUEjddwCVd-7ojPimrAQ,13480
6
+ memorykit-0.6.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
7
+ memorykit-0.6.0.dist-info/entry_points.txt,sha256=5p341udqexOYK8yOODymNndAkIwjHG84H8LzdVQyhvA,89
8
+ memorykit-0.6.0.dist-info/licenses/LICENSE,sha256=sLvsg7EyOxwJXCWXNmVGhZWyu5lfNCxJjktQoVW7cNk,1068
9
+ memorykit-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ memorykit = memorykit.provider:main
3
+ memorykit-mcp = memorykit.mcp:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mark Beacom
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.