Skip to content

Commit 46bdcd6

Browse files
committed
docs(eval): add reproducible memory evaluation guide
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
1 parent a21ef3f commit 46bdcd6

3 files changed

Lines changed: 142 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ When integrated with OpenClaw, it cuts token usage by up to **61.38%**, improves
4242

4343
> These results are measured over continuous long-horizon sessions, not isolated turns. For example, SWE-bench runs 50 consecutive tasks per session to simulate the context-accumulation pressure of real-world long-horizon agents.
4444
45+
For benchmark reproductions or new evaluation integrations, see the
46+
[Reproducible Memory Evaluation Guide](./docs/reproducible-memory-evaluation.md).
47+
4548
---
4649

4750
## Overview
@@ -504,6 +507,7 @@ Debugging no longer means probing an opaque database — it becomes a determinis
504507

505508
| Document | Contents |
506509
| :--- | :--- |
510+
| [`docs/reproducible-memory-evaluation.md`](./docs/reproducible-memory-evaluation.md) | Benchmark run metadata, layer checks, and result template |
507511
| [`scripts/README.memory-tencentdb-ctl.md`](./scripts/README.memory-tencentdb-ctl.md) | Operations & management tooling |
508512
| [`CHANGELOG.md`](./CHANGELOG.md) | Release notes and version history |
509513
| [`openclaw.plugin.json`](./openclaw.plugin.json) | OpenClaw plugin manifest and configuration schema |

README_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343

4444
> 超长 Session 评测不是单题清空上下文,而是把多个任务拼接到同一个 Session 中连续执行。例如 SWE-bench 每个 Session 连续执行 50 个任务,用来模拟真实长程 Agent 的上下文累积压力。
4545
46+
如需复现 benchmark 或接入新的评测框架,请参考
47+
[可复现实验评测指南](./docs/reproducible-memory-evaluation.md)
48+
4649
---
4750

4851
## 项目简介
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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

Comments
 (0)