run
Benchmark agent-memory backends with a reproducible JSON report. Run MemPalace, Mem0, Zep/Graphiti, or OpenViking against evals like LongMemEval and LoCoMo. Get per-backend scores for quality and performance, bypassing vendor claims.
Instructions
Runs memtrust's agent-memory benchmark suite (LongMemEval, LoCoMo, contradiction-detection, and a dozen other evals) against one or more configured memory backends -- MemPalace, Mem0, Zep/Graphiti, OpenViking -- and returns the resulting JSON report. Call this when an agent needs a fresh, reproducible comparison of memory-backend quality or performance rather than trusting a vendor's self-reported numbers; do not call it just to read documentation (pass ["--help"] for that instead) or to inspect a report that already exists on disk (use the CLI's report subcommand directly for that). A backend is only evaluated if its credential env var is set in the server's environment (e.g. MEM0_SELFHOSTED_API_KEY, GRAPHITI_GEMINI_API_KEY); backends missing credentials are reported as skipped rather than causing an error, so no prerequisite check is required before calling.
Behavior: this shells out to the real memtrust run CLI as a subprocess (network calls happen for whichever backends are configured; evals also read/write a private temp file for the JSON report, cleaned up automatically). It is read-only with respect to the backends themselves -- it queries and scores them, it does not modify backend state -- and each call is idempotent: running the same args twice re-runs the full suite and produces a fresh, independent report rather than mutating prior results. Runs can take several minutes (subprocess timeout is 600s) depending on which evals and backends are selected. On a non-zero CLI exit, the tool does not raise; it returns {"error": ..., "returncode": ..., "stderr": ...} so the calling agent can inspect what failed.
Parameter: args is a list[str] of argv tokens appended to memtrust run (NOT a shell string, and do not include "run" itself or an --output flag -- the wrapper supplies its own temp output path). Real examples pulled from memtrust run --help:
[] -- run every eval against every configured backend (both flags default to "all")
["--backends", "mempalace", "--eval", "contradiction"] -- one backend, one eval
["--backends", "mem0,zep", "--eval", "longmemeval,locomo", "--scale-stress-n-records", "10000"] -- multiple backends and evals, plus a numeric tuning flag
["--help"] -- exits before writing a report, so it surfaces as an error dict whose
stdoutfield holds the CLI's own live help text; useful for discovering flags this description doesn't enumerate, such as --sign or --locomo-dataset-path
Return shape: on success, the parsed contents of memtrust's JSON report file (per-backend, per-eval results and scores -- see memtrust report --help for how a human would render the same file). On failure, a dict with an error key plus whichever of returncode / stderr / stdout is available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||