跳到主要内容

DeepSeek Harness 本地聊天记忆:按来源保存聊天原文,关键词 + 向量检索,可选大模型重排与检索摘要。源码公开,仅限非商用

浏览文件
main

分支

eval.test.js

15 行 · 955 B历史下载
1import test from 'node:test';
2import assert from 'node:assert/strict';
3import { evaluate } from './eval/run.js';
4
5// Floors for the lexical (no embedding) pipeline on the synthetic chat corpus. Raise them when
6// retrieval improves; a drop means a change made memory worse. Run `node test/eval/run.js` for the report.
7test('retrieval quality does not regress', async () => {
8 const { byKind, newerLast, leaks } = await evaluate();
9 assert.equal(leaks, 0, 'another person\'s private chat must never surface');
10 assert.ok(byKind.exact.hit3 >= 1, 'exact: every record in the top 3');
11 assert.ok(byKind.context.answer >= 1, 'context: the neighbouring turn carries the answer into the evidence');
12 assert.ok(newerLast, 'changed facts: the newer statement is shown, after the older one');
13 assert.ok(byKind.all.hit3 >= 0.75, `top-3 hit rate ${byKind.all.hit3}`);
14 assert.ok(byKind.all.answer >= 0.75, `answer-in-evidence rate ${byKind.all.answer}`);
15});