bench: add benchmark runners, results docs, and test suite

Benchmarks: LongMemEval, LoCoMo, ConvoMem, MemBench runners with
methodology docs and hybrid retrieval analysis.

Tests: config, miner, convo_miner, normalize — 9 tests, all passing.
This commit is contained in:
bensig
2026-04-04 18:33:42 -07:00
parent 068dbd9a7b
commit 0f8fa8c7d5
11 changed files with 6815 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import os
import json
import tempfile
from mempalace.normalize import normalize
def test_plain_text():
f = tempfile.NamedTemporaryFile(mode="w", suffix=".txt", delete=False)
f.write("Hello world\nSecond line\n")
f.close()
result = normalize(f.name)
assert "Hello world" in result
os.unlink(f.name)
def test_claude_json():
data = [{"role": "user", "content": "Hi"}, {"role": "assistant", "content": "Hello"}]
f = tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False)
json.dump(data, f)
f.close()
result = normalize(f.name)
assert "Hi" in result
os.unlink(f.name)
def test_empty():
f = tempfile.NamedTemporaryFile(mode="w", suffix=".txt", delete=False)
f.close()
result = normalize(f.name)
assert result.strip() == ""
os.unlink(f.name)