memfg 6.0.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.
Files changed (84) hide show
  1. memfg-6.0.0.dist-info/METADATA +322 -0
  2. memfg-6.0.0.dist-info/RECORD +84 -0
  3. memfg-6.0.0.dist-info/WHEEL +4 -0
  4. memfg-6.0.0.dist-info/entry_points.txt +3 -0
  5. memfg-6.0.0.dist-info/licenses/LICENSE +21 -0
  6. memoryforge/__init__.py +31 -0
  7. memoryforge/_core.py +391 -0
  8. memoryforge/agents/__init__.py +27 -0
  9. memoryforge/agents/codex_sync.py +132 -0
  10. memoryforge/agents/operators.py +285 -0
  11. memoryforge/agents/runners.py +513 -0
  12. memoryforge/agents/subagents.py +36 -0
  13. memoryforge/api/__init__.py +6 -0
  14. memoryforge/api/active_recall.py +214 -0
  15. memoryforge/api/app.py +110 -0
  16. memoryforge/api/context_assembly.py +144 -0
  17. memoryforge/api/context_builder.py +659 -0
  18. memoryforge/api/context_bundle.py +48 -0
  19. memoryforge/api/lcm_facade.py +208 -0
  20. memoryforge/api/lifecycle.py +433 -0
  21. memoryforge/api/memory_io.py +267 -0
  22. memoryforge/api/rlm_facade.py +378 -0
  23. memoryforge/benchmark/__init__.py +16 -0
  24. memoryforge/benchmark/adapter.py +102 -0
  25. memoryforge/benchmark/locomo.py +174 -0
  26. memoryforge/benchmark/longmemeval.py +97 -0
  27. memoryforge/benchmark/secondbrain.py +673 -0
  28. memoryforge/cli/__init__.py +5 -0
  29. memoryforge/cli/commands.py +366 -0
  30. memoryforge/cli/main.py +14 -0
  31. memoryforge/cli/parser.py +293 -0
  32. memoryforge/db/__init__.py +5 -0
  33. memoryforge/db/schema.py +284 -0
  34. memoryforge/init/__init__.py +6 -0
  35. memoryforge/init/bootstrap.py +141 -0
  36. memoryforge/init/codex.py +341 -0
  37. memoryforge/init/hooks.py +268 -0
  38. memoryforge/lcm/__init__.py +52 -0
  39. memoryforge/lcm/compaction/__init__.py +22 -0
  40. memoryforge/lcm/compaction/compactor.py +479 -0
  41. memoryforge/lcm/compaction/engine.py +595 -0
  42. memoryforge/lcm/compaction/file_ids.py +233 -0
  43. memoryforge/lcm/compaction/pruner.py +78 -0
  44. memoryforge/lcm/compaction/subagent_provider.py +60 -0
  45. memoryforge/lcm/context/__init__.py +5 -0
  46. memoryforge/lcm/context/builder.py +352 -0
  47. memoryforge/lcm/conversation/__init__.py +9 -0
  48. memoryforge/lcm/conversation/store.py +242 -0
  49. memoryforge/lcm/events/__init__.py +5 -0
  50. memoryforge/lcm/events/bus.py +101 -0
  51. memoryforge/lcm/refs/__init__.py +5 -0
  52. memoryforge/lcm/refs/hash_ref.py +29 -0
  53. memoryforge/lcm/store/__init__.py +5 -0
  54. memoryforge/lcm/store/immutable.py +454 -0
  55. memoryforge/lcm/summary/__init__.py +5 -0
  56. memoryforge/lcm/summary/dag.py +359 -0
  57. memoryforge/lcm/tokens/__init__.py +5 -0
  58. memoryforge/lcm/tokens/estimator.py +96 -0
  59. memoryforge/mcp/__init__.py +5 -0
  60. memoryforge/mcp/server.py +417 -0
  61. memoryforge/mcp/tools.py +349 -0
  62. memoryforge/memory/__init__.py +22 -0
  63. memoryforge/memory/longterm/__init__.py +26 -0
  64. memoryforge/memory/longterm/indexing.py +621 -0
  65. memoryforge/memory/longterm/models.py +99 -0
  66. memoryforge/memory/longterm/retrieval.py +483 -0
  67. memoryforge/memory/longterm/store.py +46 -0
  68. memoryforge/memory/longterm/utils.py +43 -0
  69. memoryforge/py.typed +1 -0
  70. memoryforge/rlm/__init__.py +11 -0
  71. memoryforge/rlm/chunking.py +581 -0
  72. memoryforge/rlm/common.py +61 -0
  73. memoryforge/rlm/engine.py +36 -0
  74. memoryforge/rlm/records.py +314 -0
  75. memoryforge/rlm/runner.py +766 -0
  76. memoryforge/rlm/schema.py +56 -0
  77. memoryforge/rlm/search.py +200 -0
  78. memoryforge/rlm/storage.py +99 -0
  79. memoryforge/rlm/types.py +21 -0
  80. memoryforge/runtime.py +213 -0
  81. memoryforge/search/__init__.py +18 -0
  82. memoryforge/search/fts.py +56 -0
  83. memoryforge/search/router.py +28 -0
  84. memoryforge/search/vector.py +551 -0
@@ -0,0 +1,322 @@
1
+ Metadata-Version: 2.4
2
+ Name: memfg
3
+ Version: 6.0.0
4
+ Summary: Lossless Context Management for Recursive Language Model
5
+ Author: MemoryForge Contributors
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: Implementation :: CPython
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: anyio>=4.0
14
+ Requires-Dist: mcp>=1.0.0
15
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
16
+ Provides-Extra: all
17
+ Requires-Dist: fastembed>=0.5.0; extra == 'all'
18
+ Requires-Dist: matplotlib>=3.7; extra == 'all'
19
+ Requires-Dist: mypy>=1.10; extra == 'all'
20
+ Requires-Dist: pandas>=2.0; extra == 'all'
21
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'all'
22
+ Requires-Dist: pytest-cov>=5.0; extra == 'all'
23
+ Requires-Dist: pytest>=8.0; extra == 'all'
24
+ Requires-Dist: ruff>=0.9; extra == 'all'
25
+ Requires-Dist: tqdm>=4.0; extra == 'all'
26
+ Requires-Dist: twine>=5.0; extra == 'all'
27
+ Provides-Extra: benchmark
28
+ Requires-Dist: matplotlib>=3.7; extra == 'benchmark'
29
+ Requires-Dist: pandas>=2.0; extra == 'benchmark'
30
+ Requires-Dist: tqdm>=4.0; extra == 'benchmark'
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.10; extra == 'dev'
33
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
35
+ Requires-Dist: pytest>=8.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.9; extra == 'dev'
37
+ Requires-Dist: twine>=5.0; extra == 'dev'
38
+ Provides-Extra: embeddings
39
+ Requires-Dist: fastembed>=0.5.0; extra == 'embeddings'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # MemoryForge
43
+
44
+ MemoryForge is a local-first memory layer for Codex CLI workflows.
45
+
46
+ It stores durable project evidence in SQLite, keeps live context bounded, and
47
+ returns source-backed context bundles to the model the user is already running.
48
+ MemoryForge is not a separate answering agent and it is not a codebase AST graph
49
+ engine. The host model answers; MemoryForge supplies memory, references, and
50
+ provenance.
51
+
52
+ ```text
53
+ User -> Codex CLI -> MemoryForge MCP -> SQLite memory.db
54
+ |
55
+ +-> bounded CoreContextBundle
56
+ +-> optional RLM/LCM worker runs
57
+ ```
58
+
59
+ ## What It Is For
60
+
61
+ MemoryForge focuses on long-form project evidence that is common in real coding
62
+ workflows but too large or noisy to paste into every prompt:
63
+
64
+ - design notes and architecture documents
65
+ - requirements and implementation plans
66
+ - setup guides and decision records
67
+ - benchmark descriptions and experiment logs
68
+ - large Markdown files used while "vibe coding" or building a project over many sessions
69
+
70
+ These sources are ingested through RLM, stored as durable LTM evidence, and
71
+ recalled as bounded context when Codex needs them.
72
+
73
+ MemoryForge intentionally avoids a large AST/code graph schema in the core
74
+ release. Source files can still be stored as RLM/LTM evidence, but dedicated
75
+ code indexing is future work rather than part of the current SQLite schema.
76
+
77
+ ## Memory Layers
78
+
79
+ | Layer | Role | Model worker use |
80
+ | --- | --- | --- |
81
+ | RLM | Raw Large Memory. Chunks large files/prompts and indexes them into durable memory. | Optional, for batch analysis. |
82
+ | LTM | Long-Term Memory. Recalls durable evidence across sessions and sources. | No model call. |
83
+ | LCM | Lossless Context Management Keeps the active session view bounded with summaries and refs. | Optional, for compaction. |
84
+
85
+ Important boundary: LCM compacts MemoryForge's SQLite-backed active context. It
86
+ does not directly erase Codex's own context window. Codex manages its live
87
+ thread and can compact it with `/compact`; MemoryForge hooks and MCP tools then
88
+ help preserve and rehydrate the evidence needed after compaction.
89
+
90
+ ## Install
91
+
92
+ From PyPI in a project that uses `uv`:
93
+
94
+ ```bash
95
+ uv add memfg
96
+ ```
97
+
98
+ With optional local embeddings:
99
+
100
+ ```bash
101
+ uv add "memfg[embeddings]"
102
+ ```
103
+
104
+ For local development from this repository:
105
+
106
+ ```bash
107
+ uv sync --extra dev --extra benchmark
108
+ ```
109
+
110
+ ## Initialize A Codex Project
111
+
112
+ Run this at the project root:
113
+
114
+ ```bash
115
+ uv run memoryforge init . --agent-id default --force
116
+ ```
117
+
118
+ This creates:
119
+
120
+ ```text
121
+ .memoryforge/memory.db
122
+ .memoryforge/config.json
123
+ .memoryforge/hooks/memoryforge-hook.sh
124
+ .codex/config.toml
125
+ .codex/hooks.json
126
+ ```
127
+
128
+ The Codex config registers the MemoryForge MCP server:
129
+
130
+ ```toml
131
+ [mcp_servers.memoryforge]
132
+ command = "uv"
133
+ args = ["run", "memoryforge-mcp"]
134
+
135
+ [mcp_servers.memoryforge.env]
136
+ MEMORYFORGE_DB = "/absolute/path/.memoryforge/memory.db"
137
+ ```
138
+
139
+ The hook file records prompt and compaction lifecycle events. Project-local
140
+ Codex hooks only run after the project `.codex/` layer is trusted by Codex.
141
+ Inspect and trust them in the CLI with `/hooks` if Codex asks.
142
+
143
+ ## Prompt Submit, Cancel, And Retract
144
+
145
+ MemoryForge uses a two-phase hook flow for user prompts:
146
+
147
+ - `UserPromptSubmit` writes the latest prompt for the session to
148
+ `.memoryforge/pending/`.
149
+ - `Stop` commits that pending prompt into SQLite, then RLM/LTM/LCM processing
150
+ can run.
151
+ - `SessionStart` removes stale pending prompts after the local TTL.
152
+
153
+ This keeps interrupted turns out of durable memory when the Codex turn is
154
+ cancelled before `Stop` runs. MemoryForge does not infer cancellation from
155
+ free-form hook payload fields such as status or reason strings; that is too
156
+ fragile across Codex versions and locales. Explicit retract integrations should
157
+ call the internal `discard-pending` hook event for the matching session before a
158
+ later `Stop` can commit it.
159
+
160
+ ## Basic Usage
161
+
162
+ Ingest a long Markdown file or project document:
163
+
164
+ ```bash
165
+ uv run memoryforge --db .memoryforge/memory.db ingest-file docs/notes.md \
166
+ --agent-id default
167
+ ```
168
+
169
+ Load a large source through RLM:
170
+
171
+ ```bash
172
+ uv run memoryforge --db .memoryforge/memory.db rlm-load docs/design.md \
173
+ --agent-id default \
174
+ --name design-notes
175
+ ```
176
+
177
+ Recall durable evidence:
178
+
179
+ ```bash
180
+ uv run memoryforge --db .memoryforge/memory.db recall-memory \
181
+ --agent-id default \
182
+ --query "why did we choose sqlite"
183
+ ```
184
+
185
+ Build a runtime context bundle for the active Codex project:
186
+
187
+ ```bash
188
+ uv run memoryforge --db .memoryforge/memory.db runtime-context \
189
+ --agent-id default \
190
+ --session-id session-1 \
191
+ --query "what context should Codex use now" \
192
+ --project-root .
193
+ ```
194
+
195
+ Run LCM compaction over MemoryForge's stored active context:
196
+
197
+ ```bash
198
+ uv run memoryforge --db .memoryforge/memory.db lcm-compact \
199
+ --agent-id default \
200
+ --session-id session-1 \
201
+ --project-root . \
202
+ --force
203
+ ```
204
+
205
+ Run the MCP server directly:
206
+
207
+ ```bash
208
+ uv run memoryforge-mcp
209
+ ```
210
+
211
+ ## Optional Vector Recall
212
+
213
+ MemoryForge works without embeddings by using lexical/FTS retrieval. To enable
214
+ semantic recall, install the embeddings extra and choose FastEmbed:
215
+
216
+ ```bash
217
+ uv add "memfg[embeddings]"
218
+
219
+ export MEMORYFORGE_VECTOR_BACKEND=fastembed
220
+ export MEMORYFORGE_VECTOR_MODEL=BAAI/bge-small-en-v1.5
221
+ export MEMORYFORGE_REQUIRE_VECTOR_MODEL=1
222
+ ```
223
+
224
+ The project intentionally keeps one vector cache table, `vec_index`, and avoids
225
+ SQLite extension backends such as `sqlite-vec` in the core release. This keeps
226
+ the package easier to install, test, and publish.
227
+
228
+ ## CLI Surface
229
+
230
+ Public commands:
231
+
232
+ - Project/runtime: `init`, `mcp-server`, `runtime-context`
233
+ - Conversation memory: `store-session`, `search`, `recall-memory`, `active-recall`, `long-term-source`
234
+ - Contradictions: `record-contradiction`, `find-contradictions`
235
+ - LCM: `lcm-context`, `lcm-compact`, `lcm-maintain`
236
+ - RLM/source loading: `ingest-file`, `rlm-load`, `rlm-search`, `rlm-chunk-get`, `dispatch`, `context-get`, `rlm-record`, `aggregate`, `rlm-run`
237
+ - Diagnostics: `chunk`, `benchmark`
238
+
239
+ `memoryforge hook` is an internal Codex hook endpoint created by `memoryforge init`.
240
+ RLM/LCM sub-agents are internal MemoryForge workers. For real worker runs,
241
+ MemoryForge uses Codex CLI through `codex exec` when configured. Development-time
242
+ Codex host subagents are separate review/triage helpers and are not the
243
+ MemoryForge runtime worker API.
244
+
245
+ ## Benchmarks
246
+
247
+ The current benchmark focus is long-memory behavior, not static code indexing:
248
+
249
+ - LoCoMo
250
+ - LongMemEval
251
+ - deterministic multi-session stress benchmark
252
+ - synthetic smoke benchmark
253
+
254
+ Example smoke check:
255
+
256
+ ```bash
257
+ uv run python benchmarks/synthetic_test.py
258
+ ```
259
+
260
+ Stress check for many real SQLite sessions:
261
+
262
+ ```bash
263
+ uv run python benchmarks/stress_sessions.py \
264
+ --sessions 100 \
265
+ --turns-per-session 12 \
266
+ --output benchmarks/results/stress_sessions_100x12.json
267
+ ```
268
+
269
+ Real LoCoMo and LongMemEval runs require their datasets and model credentials.
270
+ See [docs/BENCHMARKS.md](docs/BENCHMARKS.md) for run modes and result fields.
271
+
272
+ ## Development
273
+
274
+ Run the normal quality gate on Unix-like shells:
275
+
276
+ ```bash
277
+ make check
278
+ ```
279
+
280
+ Equivalent commands:
281
+
282
+ ```bash
283
+ uv run ruff check memoryforge tests benchmarks
284
+ PYTHONDONTWRITEBYTECODE=1 uv run mypy memoryforge
285
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. uv run pytest --ignore=tests/test_real_subagents.py --cov=memoryforge --cov-report=term-missing --cov-fail-under=77
286
+ MEMORYFORGE_REAL_SUBAGENT=1 MEMORYFORGE_REAL_PROJECT_ROOT="$PWD" MEMORYFORGE_SUBAGENT_RUNNER=codex MEMORYFORGE_MODEL=gpt-5.4 uv run pytest tests/test_real_subagents.py -vv
287
+ uv build
288
+ uv run twine check dist/*
289
+ ```
290
+
291
+ On Windows PowerShell, keep pytest temp/cache paths in writable directories:
292
+
293
+ ```powershell
294
+ $env:TMP='C:\tmp'; $env:TEMP='C:\tmp'
295
+ Remove-Item Env:\MEMORYFORGE_SUBAGENT_RUNNER -ErrorAction SilentlyContinue
296
+ Remove-Item Env:\MEMORYFORGE_MODEL -ErrorAction SilentlyContinue
297
+ uv run pytest --ignore=tests/test_real_subagents.py --basetemp=C:\tmp\memoryforge-pytest-basetemp -o cache_dir=.tmp\pytest-cache
298
+
299
+ $env:MEMORYFORGE_REAL_SUBAGENT='1'; $env:MEMORYFORGE_REAL_PROJECT_ROOT=(Get-Location).Path
300
+ $env:MEMORYFORGE_SUBAGENT_RUNNER='codex'; $env:MEMORYFORGE_MODEL='gpt-5.4'
301
+ uv run pytest tests/test_real_subagents.py -vv --basetemp=C:\tmp\memoryforge-pytest-basetemp-real -o cache_dir=.tmp\pytest-cache-real
302
+ ```
303
+
304
+ The real Codex sub-agent smoke tests are local-only. Run them on a machine with the Codex CLI installed and authenticated if you want to verify `runner="codex"`; they are not part of CI/CD. Mock runners are only for targeted unit tests that verify MemoryForge's own control flow.
305
+
306
+ ## Release Notes For Maintainers
307
+
308
+ Before pushing or publishing:
309
+
310
+ 1. Keep generated data out of the release: `.venv/`, caches, `.coverage`, `.memoryforge/`, `.codebase-memory/`, `dist/`, and `benchmarks/results/`.
311
+ 2. Run the full gate on Python 3.10, 3.11, and 3.12 through CI.
312
+ 3. Build the wheel and sdist with `uv build`.
313
+ 4. Check distributions with `twine check`.
314
+ 5. Prefer the `Publish` GitHub workflow with PyPI trusted publishing. Direct maintainer uploads may use `twine upload` with `TWINE_USERNAME=__token__` and `TWINE_PASSWORD` supplied from the shell environment, never from a committed config file.
315
+
316
+ ## Documentation
317
+
318
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
319
+ - [docs/BENCHMARKS.md](docs/BENCHMARKS.md)
320
+ - [docs/API.md](docs/API.md)
321
+ - [docs/RLM.md](docs/RLM.md)
322
+ - [docs/SECOND_BRAIN_ROADMAP.md](docs/SECOND_BRAIN_ROADMAP.md)
@@ -0,0 +1,84 @@
1
+ memoryforge/__init__.py,sha256=Y2N-7jndH6PECyEoxwMMjeD-fegxmIlOik9uUrqhwYE,1030
2
+ memoryforge/_core.py,sha256=jnWFg3KrmiRaWQO7zPzNtk5GzMNaRjtSDjizD0RK54c,13893
3
+ memoryforge/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
4
+ memoryforge/runtime.py,sha256=WwO9zk5moAdd5DINOpk5tNQ9_UXXnHaIJlj5Hq6BPxw,7820
5
+ memoryforge/agents/__init__.py,sha256=25f50mWL3iYK8oiDTyxMF_hy-Pxp6K-XntYtb1H2zDQ,748
6
+ memoryforge/agents/codex_sync.py,sha256=elvZR2QZur31hZ7dEy5GkqQCESG4XUycAUzS54YU6KA,4609
7
+ memoryforge/agents/operators.py,sha256=zrybrpTs5t_D8mZlECL21NnbkJSj_25CF5iRpg3DlEE,10034
8
+ memoryforge/agents/runners.py,sha256=QaCHZhwdcqJG-mJRCiI3MxrhT6IUpjPo7lv94DvYxp4,18548
9
+ memoryforge/agents/subagents.py,sha256=OoxihEUkLqV8NL4-syYE-ILT11FssnXerUK3gykD1rk,876
10
+ memoryforge/api/__init__.py,sha256=Cvtz83cvGpLzs7JVStaDPar6dY2Tw0j3Pkz2yYxzzac,190
11
+ memoryforge/api/active_recall.py,sha256=LgtDpsrGZbIPtvR-eZiS4T1gsCsAkqmC9WJcHdeo58s,7617
12
+ memoryforge/api/app.py,sha256=5VkqXWR5ieZXImTsmUT0e9cEF-4UxqqXzQ2L0ncW3tU,3481
13
+ memoryforge/api/context_assembly.py,sha256=5TLM3mrJ284tiILamO59yGpgPoc7qBq0WIEQyQk2QaM,4719
14
+ memoryforge/api/context_builder.py,sha256=rjVz-D2xkJmusOsUeQPcA0JGpIW6V9YnIcTeHsiSwI4,26508
15
+ memoryforge/api/context_bundle.py,sha256=GftUPQZvu_tYbNh6UDgTDic7hVReJ2No2tQH3opATZM,1568
16
+ memoryforge/api/lcm_facade.py,sha256=pWrdX3zLUCu5zPMm0isEeljvSUznQytrHM1l25sXOfE,7038
17
+ memoryforge/api/lifecycle.py,sha256=Hhid44Ib6tY1-fJb75F55KH8acNiTuhrcSATTlsc4OI,15943
18
+ memoryforge/api/memory_io.py,sha256=1z3aYLB-xpDubG8Oc2U5XUbnlJERwESDl91mHUX5nio,9150
19
+ memoryforge/api/rlm_facade.py,sha256=8olxDARN_wB0al_BBqwApqAg89Fun1nytmOZpwSxmig,13826
20
+ memoryforge/benchmark/__init__.py,sha256=rf2oMdrFRyXMRj8vsZW-LZVXffxFt0wzOp9zha51GNI,540
21
+ memoryforge/benchmark/adapter.py,sha256=jDjnoeWtHbxjP1PuiSgOT0AOF9JtBz9dSrFMfKc5isk,3009
22
+ memoryforge/benchmark/locomo.py,sha256=eKAjcBfwBzzdHX7fvpxJ8JV0EEuPAwABlLNhZ_qoGX4,6739
23
+ memoryforge/benchmark/longmemeval.py,sha256=exk6WbPiTNxUGlRQET00qv_AzouolnOhOqNlHBjf4No,4239
24
+ memoryforge/benchmark/secondbrain.py,sha256=-dUd1hqrviIWvvrtSZElLzzn0K2ZVdK2aE9kt_ZbiVY,24311
25
+ memoryforge/cli/__init__.py,sha256=2x33Pu-eWhi68PWsnfV04YImluZGjY6hA6K3h3ZkTbA,125
26
+ memoryforge/cli/commands.py,sha256=MWbWay2h9LurlUF_3KMfRSt0sJmkQQzkXIZlAvxC7ZI,14563
27
+ memoryforge/cli/main.py,sha256=ouzJzeVjyhQ541Iywa3_URZOaSrNHimcmamYn5T_Gws,346
28
+ memoryforge/cli/parser.py,sha256=5b9ckm3fReDTSZNYg0b_cQWeSHBlZIOBVAxYDgvh7DU,13663
29
+ memoryforge/db/__init__.py,sha256=_HbRHIcsJy4tLQSvJnjL0nFXQcIFiV5l06jXnFLT8eo,184
30
+ memoryforge/db/schema.py,sha256=DSHoKezOqv4WkRWil-Y2tTXZIzgP6-GYto3X_DY7fP4,9926
31
+ memoryforge/init/__init__.py,sha256=1OwGbZQeDG3cHHfN352gyH6ZnuH-ZpdXZUe2WH7kOos,205
32
+ memoryforge/init/bootstrap.py,sha256=cY-6TpfweC7Ye4Mg5QNztrcrL5LkLrXke7poLW6Cmrg,4372
33
+ memoryforge/init/codex.py,sha256=NWemoGQ0_vZD23Iphspbuwwinfcb0e9WZ8AFklPQ_7Q,11858
34
+ memoryforge/init/hooks.py,sha256=pTX65QInrlbzRommqrKnQA6S7rAfBlXZZEXvjzCnZbE,8332
35
+ memoryforge/lcm/__init__.py,sha256=zIUz71DZ0XgYRpApoMGoqJDkpreJdcHMLXNFihjWL7A,1505
36
+ memoryforge/lcm/compaction/__init__.py,sha256=aQWBmjLPrxvaRdqhy_ufdeUzJNDQVaYbqxu1-Iet97M,644
37
+ memoryforge/lcm/compaction/compactor.py,sha256=CflOHezlAe00SSo2oOML0wpwtNwA0C99lms1rc9PWFo,16619
38
+ memoryforge/lcm/compaction/engine.py,sha256=ZP3jHZIO4EogbuA5B-Zvi-XnS0HkLofV2GXXoSVpg90,23124
39
+ memoryforge/lcm/compaction/file_ids.py,sha256=DkZN1f9dImAGgMUttpSQfCiLBJSlTII3tzT8pL4q0xk,8416
40
+ memoryforge/lcm/compaction/pruner.py,sha256=L55fgBxwqirtOLpqdEDCd-G1WLl3pgKA7x5QyMUFiRU,2627
41
+ memoryforge/lcm/compaction/subagent_provider.py,sha256=Wnlsv9-0oarVuQsq9QA4gW_tTCPOioUQqwLV-Wh143U,1775
42
+ memoryforge/lcm/context/__init__.py,sha256=2mGSu_WdO5y0CB27gkpQdxp0beNunZqLPzA6Hg5q7yc,221
43
+ memoryforge/lcm/context/builder.py,sha256=wQknhRPcJZyBRkbtbAcvmMz__2y7bQ-Ao35dB8GjYW8,13466
44
+ memoryforge/lcm/conversation/__init__.py,sha256=q62XKOGzayA0zrCySl5lo60DeTB-RNb-lJpU_U77BHQ,263
45
+ memoryforge/lcm/conversation/store.py,sha256=zpao5yUSB39dNRQIGyzHFfU3phyOa7gY-Kih_VepzLY,9061
46
+ memoryforge/lcm/events/__init__.py,sha256=QlH-WTP0g3MYUgfYMwdGrNSuRJiwBBxXRucDukuqcbY,127
47
+ memoryforge/lcm/events/bus.py,sha256=IO89wrLc3Jm2Dw44EKBH6BpnniwTgEnlwURSCyyes4Y,3262
48
+ memoryforge/lcm/refs/__init__.py,sha256=gGUkwO5OVkWica6Yt1DU81v_zm-LfcpPFtw2K1E6_7I,150
49
+ memoryforge/lcm/refs/hash_ref.py,sha256=eCn_o9zYvzJYQQOxURRE7fTcbfI_qU3vSb0eBtlKB-0,851
50
+ memoryforge/lcm/store/__init__.py,sha256=wRlgi_uFbCRiwe0zrzqSIfUX7UO-EA7IswJSGqnhwek,211
51
+ memoryforge/lcm/store/immutable.py,sha256=t0S9jkY4mUvAWD0dQnF3Of7XSpHjSq5KbBwcQjKeXPg,16627
52
+ memoryforge/lcm/summary/__init__.py,sha256=u5AJ8RAarw_eJx7CxO2ZuPKPB8QVCy7FBpFt1-FbnJc,158
53
+ memoryforge/lcm/summary/dag.py,sha256=lcOEou5jlkBXk-SvQwogws9FhQqNYIWX4NMRbbO9828,12409
54
+ memoryforge/lcm/tokens/__init__.py,sha256=6s5kMZnuQUw2P88f-G_N5FUfs1MORKwKMbOnQH7yC0E,130
55
+ memoryforge/lcm/tokens/estimator.py,sha256=padkvacY6jMXaRceZxr_9XC5OUmvTCmBrndE0EEmzIc,3652
56
+ memoryforge/mcp/__init__.py,sha256=NRaLrCzbDqSpkrqp5UsQCQYWSyg-4Mdg0ACFjMLWGiE,108
57
+ memoryforge/mcp/server.py,sha256=xv-nW46MV8JTi3C07k8oBzg5gRgeHN3l2bfISds2LLQ,19854
58
+ memoryforge/mcp/tools.py,sha256=KWt14u8hP-X5lcJPggYo9pDpSU3C-i6m3RprfmCO0uU,13977
59
+ memoryforge/memory/__init__.py,sha256=Bbnn2CLoIJ3k8XYkHbAwV75Cyc8ilH6V2KOvkY4OUXw,691
60
+ memoryforge/memory/longterm/__init__.py,sha256=lHMzgqVhfMn_WDTpmxqdBwDemon6l8V504uQn8cOl8w,887
61
+ memoryforge/memory/longterm/indexing.py,sha256=0h_QnQkAhjWRTYXo0O6zci0USgrJCtQmisfiEWkpIB0,23388
62
+ memoryforge/memory/longterm/models.py,sha256=olLb6Em2OuiZZt-95Gn_PGl0z7E67wUtfR7v5qflbZM,3201
63
+ memoryforge/memory/longterm/retrieval.py,sha256=RNtjxK1Mb2mtrcn8YlCeYW0o2YhZQZwLOf9A3-UJSZc,18816
64
+ memoryforge/memory/longterm/store.py,sha256=skhnMjQ6kF_Zp38GWhSWkzaazUqJ9lBOEK1pGy65xv8,1698
65
+ memoryforge/memory/longterm/utils.py,sha256=_ddc1wmAslxLnVSXCuMW0rgDoN2qGYKQ9SBbqco1wDY,1193
66
+ memoryforge/rlm/__init__.py,sha256=IXeZIBiNH9YKYCL8EhhNlIQYCuovNbUrF0yEvlZG4l8,260
67
+ memoryforge/rlm/chunking.py,sha256=I7OyUN4pKbTU9r6Yb2sELJtyem83kbmnW6et72pmzH8,20545
68
+ memoryforge/rlm/common.py,sha256=o0ZuL1nFU5mUYIVacDFbfk5ZEWy-5N8QMPV-vItMt-I,1618
69
+ memoryforge/rlm/engine.py,sha256=z8-N2cf60HZYjD6C5YWpobe0JKRMvHsyX6QHpads-rE,1238
70
+ memoryforge/rlm/records.py,sha256=OBEhTyQw7pRaCHLy8mTfVJNlK8--2-lo7T6NHveXNWU,11595
71
+ memoryforge/rlm/runner.py,sha256=GS2fPCuzan7N4wFVmTBXpnTyDLlYGvy-51D6MWm1D_o,29266
72
+ memoryforge/rlm/schema.py,sha256=kZ5wDXHP73DVZZZcd6iL1l0M1xUYM4-jo5CE7Ug2xEI,1713
73
+ memoryforge/rlm/search.py,sha256=aDiO3ZyN0VLxr9yrQpRWBptexB2ZrTxk6BC_1Gbs5Q8,6837
74
+ memoryforge/rlm/storage.py,sha256=th0qbYNBKUXplmEksdU6TgyugWysQL7OGSes5lxkzGQ,3541
75
+ memoryforge/rlm/types.py,sha256=LIagtW7OPXbyneRz9i1IUidBfa8qgCdjYw2ZIYH-V7U,438
76
+ memoryforge/search/__init__.py,sha256=YCXnqOdvNmeDbrfw19xMim3fJR-dI5pdKNTWYNil2CA,433
77
+ memoryforge/search/fts.py,sha256=SMG7WrPP9yyg600-4tnaR8u96Ke3VorZgnd_A4R6sFE,1783
78
+ memoryforge/search/router.py,sha256=Ww56M4HBkbuKFJDdQ5DuVRFD7qIhh6fvA0wNcmsMBm8,893
79
+ memoryforge/search/vector.py,sha256=vEHho0Ry3KDc73kdL5d60FwTf3pDdmEm6rpkRryOxfc,21456
80
+ memfg-6.0.0.dist-info/METADATA,sha256=vS3SI_muzdF9SjQJit2cl7kCxdq48OUiWrvAj9AIlZE,10944
81
+ memfg-6.0.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
82
+ memfg-6.0.0.dist-info/entry_points.txt,sha256=ZB-N7ArydAd2c2reSXog0PnrsdSDtNqvtYbKSrPar6U,105
83
+ memfg-6.0.0.dist-info/licenses/LICENSE,sha256=qdAta9Rng7wL1L3wEVDrnewqmiD7gDyoF2OCBynWceQ,1102
84
+ memfg-6.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ memoryforge = memoryforge.cli:main
3
+ memoryforge-mcp = memoryforge.mcp.server:run_server
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MemoryForge Contributors
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,31 @@
1
+ """MemoryForge v6.0 - Lossless Context Management for Recursive Language Model.
2
+
3
+ Recursive Language Model substrate:
4
+ - LCM Pipeline: active conversation context with recursive compaction
5
+ - LTM Pipeline: durable file/conversation knowledge with BM25 and vector recall
6
+ - Search Pipeline: BM25/vector fusion for pass-by-reference context recall
7
+ """
8
+
9
+ __version__ = "6.0.0"
10
+
11
+ from memoryforge._core import BM25Index, ContentHashTable, rrf_fusion
12
+ from memoryforge.agents import create_subagent_runner
13
+ from memoryforge.api import CoreContextBundle, MemoryForge
14
+ from memoryforge.lcm import LCMCompactor, SummaryDAG
15
+ from memoryforge.rlm import RLMEngine
16
+ from memoryforge.search.router import UnifiedQueryRouter
17
+ from memoryforge.search.vector import VectorIndex
18
+
19
+ __all__ = [
20
+ "ContentHashTable",
21
+ "BM25Index",
22
+ "rrf_fusion",
23
+ "LCMCompactor",
24
+ "SummaryDAG",
25
+ "UnifiedQueryRouter",
26
+ "VectorIndex",
27
+ "MemoryForge",
28
+ "CoreContextBundle",
29
+ "RLMEngine",
30
+ "create_subagent_runner",
31
+ ]