|
| 1 | +# basic-memory-benchmarks |
| 2 | + |
| 3 | +Standalone, reproducible benchmark suite for comparing Basic Memory against competitor memory systems. |
| 4 | + |
| 5 | +## Goals |
| 6 | + |
| 7 | +- Deterministic retrieval benchmarks (Recall@5/10, MRR, Precision@5, content-hit, latency) |
| 8 | +- Optional LLM-as-judge scoring (Pydantic Evals) |
| 9 | +- Public artifacts with provenance and reproducibility metadata |
| 10 | +- Clean dependency isolation from the core `basic-memory` repository |
| 11 | + |
| 12 | +## Current v1 Scope |
| 13 | + |
| 14 | +- Providers: |
| 15 | + - `bm-local` |
| 16 | + - `bm-cloud` (optional, credential-gated) |
| 17 | + - `mem0-local` |
| 18 | + - `zep-reference` (reference-only in v1) |
| 19 | +- Datasets: |
| 20 | + - LoCoMo (primary) |
| 21 | + - LongMemEval scaffold (placeholder) |
| 22 | + - Built-in synthetic smoke corpus |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +```bash |
| 27 | +uv sync --group dev |
| 28 | +``` |
| 29 | + |
| 30 | +Optional judge dependencies: |
| 31 | + |
| 32 | +```bash |
| 33 | +uv sync --group dev --extra judge |
| 34 | +``` |
| 35 | + |
| 36 | +## Quickstart |
| 37 | + |
| 38 | +### 1) Fetch LoCoMo dataset |
| 39 | + |
| 40 | +```bash |
| 41 | +uv run bm-bench datasets fetch --dataset locomo |
| 42 | +``` |
| 43 | + |
| 44 | +### 2) Convert LoCoMo into benchmark corpus |
| 45 | + |
| 46 | +```bash |
| 47 | +uv run bm-bench convert locomo |
| 48 | +``` |
| 49 | + |
| 50 | +### 3) Run retrieval benchmark |
| 51 | + |
| 52 | +```bash |
| 53 | +uv run bm-bench run retrieval \ |
| 54 | + --providers bm-local,mem0-local \ |
| 55 | + --corpus-dir benchmarks/generated/locomo/docs \ |
| 56 | + --queries-path benchmarks/generated/locomo/queries.json |
| 57 | +``` |
| 58 | + |
| 59 | +### 4) Optional judge benchmark |
| 60 | + |
| 61 | +```bash |
| 62 | +uv run bm-bench run judge --run-dir benchmarks/runs/<run-id> |
| 63 | +``` |
| 64 | + |
| 65 | +### 5) Publish run artifacts |
| 66 | + |
| 67 | +```bash |
| 68 | +uv run bm-bench publish --run-dir benchmarks/runs/<run-id> |
| 69 | +``` |
| 70 | + |
| 71 | +## Basic Memory source policy |
| 72 | + |
| 73 | +By default this project tracks Basic Memory from `main`. |
| 74 | + |
| 75 | +Each run manifest stores: |
| 76 | +- BM source (`github main` or local path override) |
| 77 | +- resolved BM commit SHA |
| 78 | + |
| 79 | +Local override: |
| 80 | + |
| 81 | +```bash |
| 82 | +uv run bm-bench run retrieval \ |
| 83 | + --bm-local-path /Users/phernandez/dev/basicmachines/basic-memory |
| 84 | +``` |
| 85 | + |
| 86 | +## Mem0 local requirements |
| 87 | + |
| 88 | +`mem0-local` requires model credentials available in environment. |
| 89 | + |
| 90 | +At minimum, set: |
| 91 | + |
| 92 | +```bash |
| 93 | +export OPENAI_API_KEY=... |
| 94 | +``` |
| 95 | + |
| 96 | +If unavailable, provider status will be recorded as `SKIPPED(reason)`. |
| 97 | + |
| 98 | +## Run Artifacts |
| 99 | + |
| 100 | +Per run (`benchmarks/runs/<run-id>/`): |
| 101 | + |
| 102 | +- `manifest.json` |
| 103 | +- `provider-status.json` |
| 104 | +- `per-query-retrieval.jsonl` |
| 105 | +- `retrieval-summary.json` |
| 106 | +- `per-query-judge.jsonl` (optional) |
| 107 | +- `judge-summary.json` (optional) |
| 108 | +- `summary.md` |
| 109 | + |
| 110 | +## Just commands |
| 111 | + |
| 112 | +```bash |
| 113 | +just bench-smoke |
| 114 | +just bench-fetch-locomo |
| 115 | +just bench-convert-locomo |
| 116 | +just bench-run-bm-local |
| 117 | +just bench-run-mem0-local |
| 118 | +just bench-run-full |
| 119 | +just bench-judge |
| 120 | +just bench-publish RUN_DIR=benchmarks/runs/<run-id> |
| 121 | +``` |
| 122 | + |
| 123 | +## Notes on dataset publication |
| 124 | + |
| 125 | +Dataset publication follows licensing constraints: |
| 126 | +- If redistribution is permitted: snapshot + checksum may be published. |
| 127 | +- If not: canonical source links + downloader + checksum verification are published. |
| 128 | + |
0 commit comments