Reference

Benchmarks

Both benchmarks are synthetic, so they show behaviour, not real-world accuracy. Both are deterministic and need no model.

Does memory help?

python examples/memory_benchmark.py writes results/memory/. 20 users chat with an assistant over 8, 32, or 64 sessions each. Facts come up in passing, one is a request to remember, 40% of users move cities later, and the rest is chatter with distractors. Half the statements are in forms the built-in extractor is built for and half are paraphrases it cannot parse. Each user is then asked their current city, dog, drink, and locker code. A recency-aware reader answers from whatever each configuration retrieves: right if the latest-mentioned value the user ever gave is the current one. Means over 3 seeds.

Configuration8 sessions32 sessions64 sessionsContext words at 64
none0.0000.0000.0000
full history in context1.0001.0001.0001,358
episodic search only0.9580.9580.95820
notes from dreaming only0.4920.5120.48715
episodic + notes0.9420.9710.95835
notes from dreaming, oracle extractor1.0001.0001.00012
episodic + notes, oracle extractor1.0001.0001.00033

What it shows:

Warning

The paraphrases were written to share a stem with the questions, which favours lexical search, and the first version of this benchmark gave the extractor text written to match it and scored 1.000, which was circular. Both are stated in results/memory/README.md.

Which eviction policy?

python examples/policy_benchmark.py writes results/policies/. A synthetic agent-shaped workload (60 tasks writing 6 trace steps each, then 472 skewed reuses) is replayed through the real store under each policy, and the hit rate of working memory is measured at capacities 16, 32, and 64, with the cost in log records and replay time.

PolicyHit rate, cap 16cap 32cap 64
FIFO0.5060.5510.602
LRU0.6420.7440.828
LFU0.3540.4600.606
Forgetting curve0.6480.7710.867
ARC0.5510.6630.763
Learned (online logistic)0.6270.7420.803

The forgetting curve does best under the cap and also writes the fewest log records, since every miss is a page-in and an eviction. LFU and 2Q do poorly because this workload reuses fresh trace steps often, and both evict memories used only once first. Which policy wins depends on the workload, which is why policies are pluggable and the benchmark can replay a recorded one (AccessLog(record=True), then bench.from_access_log).