|
| 1 | +# Reproducible Memory Evaluation Guide |
| 2 | + |
| 3 | +This guide defines a lightweight record format for memory benchmark runs. It is |
| 4 | +framework-neutral: use it with public benchmarks, internal long-horizon tasks, |
| 5 | +or generated memory test databases. |
| 6 | + |
| 7 | +## Goals |
| 8 | + |
| 9 | +A useful TencentDB Agent Memory evaluation should report more than final task |
| 10 | +accuracy. Record enough context to answer: |
| 11 | + |
| 12 | +- Did the system store the right evidence in L0? |
| 13 | +- Did L1 extract atomic, current, and correctly typed memories? |
| 14 | +- Did L2/L3 summarize the right scenes and persona traits? |
| 15 | +- Did recall inject the right layer at the right time without excessive tokens? |
| 16 | +- Did token savings or recall gains come from memory behavior rather than a |
| 17 | + changed model, prompt, dataset split, or session layout? |
| 18 | + |
| 19 | +## Run Metadata |
| 20 | + |
| 21 | +Capture these fields for each run: |
| 22 | + |
| 23 | +| Field | Example | |
| 24 | +| :--- | :--- | |
| 25 | +| Git commit | `a21ef3f` | |
| 26 | +| Package version | `0.3.6` | |
| 27 | +| Host | `OpenClaw 2026.6.x` / `Hermes` | |
| 28 | +| Node.js | `v24.15.0` | |
| 29 | +| Main model | provider and model id | |
| 30 | +| Extraction model | provider and model id, if different | |
| 31 | +| Embedding config | provider, model, dimensions, BM25 on/off | |
| 32 | +| Store backend | `sqlite` / `tcvdb` | |
| 33 | +| Recall config | strategy, `maxResults`, score threshold, budgets | |
| 34 | +| Dataset | benchmark name, split, seed, task count | |
| 35 | +| Session layout | isolated turns, multi-turn sessions, or N tasks per session | |
| 36 | + |
| 37 | +Keep the resolved plugin config with secrets redacted. Small config changes can |
| 38 | +materially affect recall behavior. |
| 39 | + |
| 40 | +## Dataset And Session Design |
| 41 | + |
| 42 | +Use a session design that matches the claim being tested: |
| 43 | + |
| 44 | +- **Short-term offload**: run long tool-heavy tasks in continuous sessions and |
| 45 | + measure token use, compression ratio, and task success. |
| 46 | +- **Long-term personalization**: seed multiple sessions, allow L1/L2/L3 |
| 47 | + generation to complete, then ask held-out queries. |
| 48 | +- **Layer stress tests**: include queries that should be answered from different |
| 49 | + layers: exact L0 evidence, L1 atomic facts, L2 scene summaries, and L3 persona. |
| 50 | +- **Temporal drift tests**: include stale facts, updates, and superseding events |
| 51 | + to check whether recall mixes old and current state. |
| 52 | + |
| 53 | +Avoid reporting only isolated one-turn results when the feature under test is |
| 54 | +designed for long-horizon sessions. |
| 55 | + |
| 56 | +## Layer Checks |
| 57 | + |
| 58 | +Record representative artifacts for a small audited subset: |
| 59 | + |
| 60 | +| Layer | What to inspect | |
| 61 | +| :--- | :--- | |
| 62 | +| L0 Conversation | Raw messages are present, scoped to the right session, and free of injected recall tags. | |
| 63 | +| L1 Atom | Extracted memories are atomic, typed correctly, current, and not overlong incident summaries. | |
| 64 | +| L2 Scenario | Scene blocks group related memories without losing important qualifiers. | |
| 65 | +| L3 Persona | Persona claims are stable preferences, not one-off task instructions. | |
| 66 | +| Recall | Injected context is relevant, bounded, and points to deeper search when snippets are insufficient. | |
| 67 | + |
| 68 | +For failed answers, attach the recalled L1 snippets, scene navigation, persona |
| 69 | +excerpt, and source L0 messages when possible. |
| 70 | + |
| 71 | +## Metrics |
| 72 | + |
| 73 | +Recommended metrics: |
| 74 | + |
| 75 | +- Task success or answer accuracy. |
| 76 | +- Total input/output tokens and relative token change. |
| 77 | +- Recall precision: fraction of injected memories that support the answer. |
| 78 | +- Recall miss rate: queries where supporting memory exists but was not recalled. |
| 79 | +- Layer attribution: L0, L1, L2, or L3 source used for each correct answer. |
| 80 | +- Context budget usage: injected L1 count, injected characters/tokens, and drops |
| 81 | + caused by configured recall budgets. |
| 82 | +- Latency for recall, capture, L1 extraction, L2 scene generation, and L3 persona |
| 83 | + generation. |
| 84 | + |
| 85 | +When using an external benchmark framework, map its native metrics onto these |
| 86 | +fields instead of replacing them. |
| 87 | + |
| 88 | +## Result Template |
| 89 | + |
| 90 | +```md |
| 91 | +## Evaluation Summary |
| 92 | + |
| 93 | +- Commit: |
| 94 | +- Host / model: |
| 95 | +- Dataset / split: |
| 96 | +- Session layout: |
| 97 | +- Tasks / queries: |
| 98 | +- Config file: |
| 99 | + |
| 100 | +| Metric | Baseline | TencentDB Agent Memory | Delta | |
| 101 | +| :--- | ---: | ---: | ---: | |
| 102 | +| Success / accuracy | | | | |
| 103 | +| Input tokens | | | | |
| 104 | +| Output tokens | | | | |
| 105 | +| Recall precision | | | | |
| 106 | +| Recall miss rate | | | | |
| 107 | +| Median recall latency | | | | |
| 108 | + |
| 109 | +## Layer Audit |
| 110 | + |
| 111 | +- L0 evidence quality: |
| 112 | +- L1 atom quality: |
| 113 | +- L2 scene quality: |
| 114 | +- L3 persona quality: |
| 115 | +- Recall relevance and budget behavior: |
| 116 | + |
| 117 | +## Known Limitations |
| 118 | + |
| 119 | +- Dataset coverage: |
| 120 | +- Model variance: |
| 121 | +- Manual audit sample size: |
| 122 | +- Uncontrolled environment differences: |
| 123 | +``` |
| 124 | + |
| 125 | +## Notes For Future Integrations |
| 126 | + |
| 127 | +Benchmark runners should be additive and optional. Prefer a small adapter that: |
| 128 | + |
| 129 | +- loads or seeds conversations through public capture/seed paths, |
| 130 | +- waits for configured L1/L2/L3 processing when the benchmark needs long-term |
| 131 | + memory, |
| 132 | +- stores run metadata and resolved config next to results, |
| 133 | +- redacts secrets from exported artifacts, |
| 134 | +- keeps benchmark dependencies out of the runtime package unless explicitly |
| 135 | + required. |
0 commit comments