convmemory 0.4.0__tar.gz → 0.5.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 (28) hide show
  1. {convmemory-0.4.0 → convmemory-0.5.0}/PKG-INFO +72 -2
  2. {convmemory-0.4.0 → convmemory-0.5.0}/README.md +559 -489
  3. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/__init__.py +38 -32
  4. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/api.py +815 -509
  5. convmemory-0.5.0/convmemory/evidence_reranker.py +174 -0
  6. convmemory-0.5.0/convmemory/memory_mla.py +638 -0
  7. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory.egg-info/PKG-INFO +72 -2
  8. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory.egg-info/SOURCES.txt +4 -0
  9. {convmemory-0.4.0 → convmemory-0.5.0}/pyproject.toml +1 -1
  10. convmemory-0.5.0/tests/test_evidence_reranker.py +153 -0
  11. convmemory-0.5.0/tests/test_memory_mla.py +182 -0
  12. {convmemory-0.4.0 → convmemory-0.5.0}/LICENSE +0 -0
  13. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/ccge.py +0 -0
  14. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/encoder.py +0 -0
  15. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/hub.py +0 -0
  16. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/metrics.py +0 -0
  17. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/models.py +0 -0
  18. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/reranker.py +0 -0
  19. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/routing.py +0 -0
  20. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory/scoring.py +0 -0
  21. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory.egg-info/dependency_links.txt +0 -0
  22. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory.egg-info/requires.txt +0 -0
  23. {convmemory-0.4.0 → convmemory-0.5.0}/convmemory.egg-info/top_level.txt +0 -0
  24. {convmemory-0.4.0 → convmemory-0.5.0}/setup.cfg +0 -0
  25. {convmemory-0.4.0 → convmemory-0.5.0}/tests/test_api_smoke.py +0 -0
  26. {convmemory-0.4.0 → convmemory-0.5.0}/tests/test_ccge.py +0 -0
  27. {convmemory-0.4.0 → convmemory-0.5.0}/tests/test_hub_loading.py +0 -0
  28. {convmemory-0.4.0 → convmemory-0.5.0}/tests/test_reranker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: convmemory
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Lightweight temporal memory reranking for long-term conversational memory.
5
5
  Author: ConvMemory contributors
6
6
  License: MIT
@@ -28,6 +28,14 @@ Requires-Dist: huggingface_hub>=0.20; extra == "hub"
28
28
 
29
29
  # ConvMemory
30
30
 
31
+ ## Technical Report
32
+
33
+ [ConvMemory: A Lightweight Learned Memory Reranker, a Negative Attribution Result, and a Research-Preview Conflict Editor](paper/convmemory_report.pdf) (May 2026)
34
+
35
+ **Headline finding**: The temporal-window mechanism originally claimed for ConvMemory is refuted by a 5-seed paired-bootstrap attribution study. The engineering value of the reranker (10-100× cheaper than cross-encoder baselines on conversational memory retrieval) survives the negative attribution.
36
+
37
+ ---
38
+
31
39
  [![CI](https://github.com/pth2002/ConvMemory/actions/workflows/ci.yml/badge.svg)](https://github.com/pth2002/ConvMemory/actions/workflows/ci.yml)
32
40
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
33
41
  [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
@@ -46,7 +54,7 @@ reranker. Its intended use is recall-oriented memory selection for structured
46
54
  memory streams: conversations, user histories, agent traces, task logs, and
47
55
  session-level notes.
48
56
 
49
- Current package version: `0.4.0`
57
+ Current package version: `0.5.0`
50
58
 
51
59
  ## When To Use It
52
60
 
@@ -278,6 +286,68 @@ ranked = memory_reranker.retrieve(
278
286
  The checkpoint and embeddings must use the same embedding model family and
279
287
  embedding dimension.
280
288
 
289
+ ### ConvMemory v2: Evidence Reranker (recall-preserving top-10 cross-encoder)
290
+
291
+ ConvMemory v2 is an opt-in evidence reranker that runs after v1. It preserves
292
+ the exact v1 top-10 candidate set, then uses token-level query/memory evidence
293
+ to reorder only that protected prefix. This improves precision and MRR without
294
+ changing v1 Recall@10; if v1 did not retrieve the gold memory into top-10, v2
295
+ cannot rescue it. The v0.5.0 evidence checkpoint is published on Hugging Face,
296
+ but loading remains explicit.
297
+
298
+ ```python
299
+ from convmemory import ConvMemory
300
+
301
+ model = ConvMemory.from_pretrained("Purdy0228/ConvMemory-LoCoMo-MPNet")
302
+ model.load_evidence_reranker("Purdy0228/ConvMemory-v2-Evidence-Reranker")
303
+
304
+ ranked = model.retrieve(
305
+ query=query,
306
+ memories=candidates,
307
+ evidence_reranker="v2",
308
+ top_k=10,
309
+ )
310
+ ```
311
+
312
+ See [Evidence Reranker](docs/EVIDENCE_RERANKER.md) for the v363 headline
313
+ numbers, v364 load-bearing ablations, anti-leak guards, and limitations.
314
+
315
+ ### Experimental Memory-MLA Recall Expander
316
+
317
+ This is **not** the v0.5.0 evidence reranker. See "ConvMemory v2: Evidence
318
+ Reranker" above for the v2 release.
319
+
320
+ Memory-MLA is an opt-in prefix-protected recall expander. It is not a
321
+ replacement for v1, and it is off by default: `retrieve(query, memories)` remains
322
+ the pure v1 ConvMemory path.
323
+
324
+ The expander runs after the base ConvMemory ranking. It preserves the top
325
+ `protect_top_k` results exactly, then uses compressed memory latent codes to
326
+ reorder a small suffix window for extra recall. The verified v320 configuration
327
+ is `latent_count=12`, `code_dim=64`, `protect_top_k=7`, and
328
+ `expand_window=16`. It mainly targets Recall@10 / hard-recall improvements; it
329
+ does not claim SOTA.
330
+
331
+ ```python
332
+ from convmemory import ConvMemory
333
+
334
+ model = ConvMemory.from_pretrained("Purdy0228/ConvMemory-LoCoMo-MPNet")
335
+ model.load_expander("path-or-hub-id-for-memory-mla")
336
+
337
+ ranked = model.retrieve(
338
+ query=query,
339
+ memories=candidates,
340
+ expander="memory_mla",
341
+ protect_top_k=7,
342
+ expand_window=16,
343
+ top_k=20,
344
+ )
345
+ ```
346
+
347
+ The API is experimental and follows the CCGE-LA opt-in pattern. See
348
+ [Memory-MLA](docs/MEMORY_MLA.md) for mechanism notes, training discipline, and
349
+ the v320 verification numbers.
350
+
281
351
  ## Results
282
352
 
283
353
  These are retrieval-stage evaluations. They measure whether annotated evidence