Add ConvMemory LoCoMo MPNet checkpoint
Browse files- LICENSE +21 -0
- README.md +118 -0
- config.json +22 -0
- manifest.json +31 -0
- model.pt +3 -0
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 ConvMemory 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.
|
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: convmemory
|
| 4 |
+
tags:
|
| 5 |
+
- retrieval
|
| 6 |
+
- memory
|
| 7 |
+
- reranking
|
| 8 |
+
- agents
|
| 9 |
+
- convmemory
|
| 10 |
+
- locomo
|
| 11 |
+
pipeline_tag: feature-extraction
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# ConvMemory LoCoMo MPNet
|
| 15 |
+
|
| 16 |
+
This repository contains the public ConvMemory LoCoMo/MPNet checkpoint.
|
| 17 |
+
|
| 18 |
+
ConvMemory is a lightweight learned memory reranker for long-term conversational and agent memory. It runs after vector search and before prompt construction:
|
| 19 |
+
|
| 20 |
+
```text
|
| 21 |
+
user query -> vector search top-k -> ConvMemory -> memory context
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
|
| 26 |
+
- `model.pt`: ConvMemory checkpoint weights.
|
| 27 |
+
- `config.json`: ConvMemory model and rerank configuration.
|
| 28 |
+
- `manifest.json`: checksum and configuration manifest.
|
| 29 |
+
- `LICENSE`: MIT license.
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
Install ConvMemory from GitHub, or from PyPI after the next package release:
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
pip install git+https://github.com/pth2002/ConvMemory.git
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Load directly from Hugging Face Hub:
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from convmemory import ConvMemory
|
| 43 |
+
|
| 44 |
+
model = ConvMemory.from_pretrained("Purdy0228/ConvMemory-LoCoMo-MPNet")
|
| 45 |
+
|
| 46 |
+
results = model.retrieve(
|
| 47 |
+
query="When is the hiking trip?",
|
| 48 |
+
memories=memories,
|
| 49 |
+
top_k=10,
|
| 50 |
+
)
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
Use with the CCGE-LA conflict editor:
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
from convmemory import ConvMemory
|
| 57 |
+
|
| 58 |
+
model = ConvMemory.from_pretrained("Purdy0228/ConvMemory-LoCoMo-MPNet")
|
| 59 |
+
model.load_ccge_editor("Purdy0228/ConvMemory-CCGE-LA")
|
| 60 |
+
|
| 61 |
+
results = model.retrieve(
|
| 62 |
+
query=query,
|
| 63 |
+
memories=memories,
|
| 64 |
+
editor="ccge_la",
|
| 65 |
+
top_k=10,
|
| 66 |
+
)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
For systems with precomputed embeddings, skip encoder loading and pass embeddings directly:
|
| 70 |
+
|
| 71 |
+
```python
|
| 72 |
+
model = ConvMemory.from_pretrained("Purdy0228/ConvMemory-LoCoMo-MPNet", embedding_model=False)
|
| 73 |
+
ranked = model.rerank_embeddings(
|
| 74 |
+
query_embedding=query_embedding,
|
| 75 |
+
memory_embeddings=memory_embeddings,
|
| 76 |
+
memory_ids=memory_ids,
|
| 77 |
+
memory_texts=memory_texts,
|
| 78 |
+
query=query,
|
| 79 |
+
)
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Checkpoint Configuration
|
| 83 |
+
|
| 84 |
+
| Field | Value |
|
| 85 |
+
|---|---:|
|
| 86 |
+
| Embedding backbone | `sentence-transformers/all-mpnet-base-v2` |
|
| 87 |
+
| Embedding dimension | 768 |
|
| 88 |
+
| Window size | 5 |
|
| 89 |
+
| Stride | 1 |
|
| 90 |
+
| Kernel size | 3 |
|
| 91 |
+
| Hidden dimension | 256 |
|
| 92 |
+
| Token MLP dimension | 32 |
|
| 93 |
+
| Channel MLP dimension | 512 |
|
| 94 |
+
| Candidate top-n | 500 |
|
| 95 |
+
| Raw score fusion weight | 0.025 |
|
| 96 |
+
|
| 97 |
+
## Intended Use
|
| 98 |
+
|
| 99 |
+
- Retrieval-stage reranking for long-term conversational memory.
|
| 100 |
+
- Agent memory selection after vector search.
|
| 101 |
+
- Memory streams where missing relevant evidence is costly.
|
| 102 |
+
|
| 103 |
+
## Limitations
|
| 104 |
+
|
| 105 |
+
- This is not a vector database or end-to-end QA model.
|
| 106 |
+
- It is not intended as a general web/document reranker.
|
| 107 |
+
- The checkpoint is optimized for the MPNet embedding space; other embedding backbones require retraining or validation.
|
| 108 |
+
- Scores are not calibrated by default.
|
| 109 |
+
- No inference widget is provided; use the `convmemory` Python library.
|
| 110 |
+
|
| 111 |
+
## Citation
|
| 112 |
+
|
| 113 |
+
A formal citation will be added when a technical report is available.
|
| 114 |
+
|
| 115 |
+
## Links
|
| 116 |
+
|
| 117 |
+
- GitHub: https://github.com/pth2002/ConvMemory
|
| 118 |
+
- CCGE-LA checkpoint: https://huggingface.co/Purdy0228/ConvMemory-CCGE-LA
|
config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"embedding_model": "sentence-transformers/all-mpnet-base-v2",
|
| 3 |
+
"format": "convmemory",
|
| 4 |
+
"model_config": {
|
| 5 |
+
"channel_mlp_dim": 512,
|
| 6 |
+
"embedding_dim": 768,
|
| 7 |
+
"extra_scalar_features": 5,
|
| 8 |
+
"hidden_dim": 256,
|
| 9 |
+
"kernel_size": 3,
|
| 10 |
+
"token_mlp_dim": 32,
|
| 11 |
+
"window_size": 5
|
| 12 |
+
},
|
| 13 |
+
"rerank_config": {
|
| 14 |
+
"candidate_top_n": 500,
|
| 15 |
+
"dca_router_block_size": 32,
|
| 16 |
+
"lexical_features": true,
|
| 17 |
+
"raw_weight": 0.025,
|
| 18 |
+
"stride": 1,
|
| 19 |
+
"window_size": 5
|
| 20 |
+
},
|
| 21 |
+
"version": 1
|
| 22 |
+
}
|
manifest.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config_sha256": "8e02e303568177d3e45eab552e8b5eb2ff373da2ba86643235522e61e85e7bb5",
|
| 3 |
+
"embedding_model": "sentence-transformers/all-mpnet-base-v2",
|
| 4 |
+
"format": "convmemory",
|
| 5 |
+
"model_config": {
|
| 6 |
+
"channel_mlp_dim": 512,
|
| 7 |
+
"embedding_dim": 768,
|
| 8 |
+
"extra_scalar_features": 5,
|
| 9 |
+
"hidden_dim": 256,
|
| 10 |
+
"kernel_size": 3,
|
| 11 |
+
"token_mlp_dim": 32,
|
| 12 |
+
"window_size": 5
|
| 13 |
+
},
|
| 14 |
+
"model_pt_sha256": "2f96f5faf7f0cdbdb61df8bf511e5ebd276e57e84801a402fbce0dd522c05b4d",
|
| 15 |
+
"name": "convmemory-locomo-mpnet",
|
| 16 |
+
"notes": [
|
| 17 |
+
"Use with the convmemory Python package.",
|
| 18 |
+
"This checkpoint is trained for the MPNet embedding family.",
|
| 19 |
+
"LoCoMo-style results are in-domain for this checkpoint; do not treat them as broad OOD claims."
|
| 20 |
+
],
|
| 21 |
+
"rerank_config": {
|
| 22 |
+
"candidate_top_n": 500,
|
| 23 |
+
"dca_router_block_size": 32,
|
| 24 |
+
"lexical_features": true,
|
| 25 |
+
"raw_weight": 0.025,
|
| 26 |
+
"stride": 1,
|
| 27 |
+
"window_size": 5
|
| 28 |
+
},
|
| 29 |
+
"status": "public ConvMemory LoCoMo/MPNet checkpoint",
|
| 30 |
+
"version": 1
|
| 31 |
+
}
|
model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f96f5faf7f0cdbdb61df8bf511e5ebd276e57e84801a402fbce0dd522c05b4d
|
| 3 |
+
size 14605150
|