memory: add production-faithful LongMemEval benchmark#17
Draft
Rememorio wants to merge 156 commits into
Draft
Conversation
This reverts commit 850e709.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fairness and diagnostics
All three arms receive the same dated user/assistant pairs, answer model and prompt, semantic judge protocol, Top-K 30 search limit, and isolated identity scopes. Pgvector uses the production
MemoryService.EnqueueAutoMemoryJobpath and waits for each job before replay continues. Self-hosted Mem0 uses its public OSS API and configured open-source update behavior. Provider calls whose responses omit usage remain counted throughusage_missing_callsinstead of being treated as zero-cost calls.The benchmark pins both the trpc-agent-go root module and independently versioned
memory/pgvectormodule to the currentbd6b31f92a90candidate. The evaluated compact-recovery treeeaf5f49f1fa4is byte-equivalent to that PR head. Manifests record question IDs, replay counts, model variants, prompt versions, dependency replacements, table identities, cache hashes, snapshot hashes, source revisions, image digests, and usage coverage.Selection-only mode writes the full versioned protocol payload and digest. A preregistered run rejects ad hoc filters, resampling, truncation, dataset or protocol drift, exclusion-set drift, case-metadata drift, dirty builds, and benchmark-revision drift before model or provider initialization. Frozen exclusions are validated against the active dataset and represented by a canonical count and digest without retaining a local path.
Traces separate extraction misses, reconciliation or persistence losses, retrieval misses, answer failures, and judge failures. Pair-scoped provenance prevents a later unrelated memory from being credited for an answer-bearing pair that produced no memory. Recovery traces retain initial and recovered answers, the selected source, and whether recovery was applied. Formal answer replicates use empty, independent answer and judge cache ledgers while sharing immutable ingestion and retrieval snapshots.
Current evidence
The formal protocol-v2 comparison uses one fixed, already observed 16-question development set spanning all six LongMemEval types. Each arm ingested the complete selected haystack: 183 dated conversation pairs, no session or pair truncation, Top-K 30, three independent answers per question, and three independent judge votes per answer.
The candidate had no category deficit on this set: knowledge-update 2/2, multi-session 4/4, assistant 2/2, preference 2/2, user 3/3, and temporal 3/3. Main's stable misses include two assistant-result cases, one preference-history case, and one answer-context case where the required memory was already stored and retrieved. Mem0's stable failures expose assistant-result provenance and retrieval-context selection issues; its additional unstable case scored 2/3. These distinctions are retained in the traces so answer behavior is not mislabeled as extraction or retrieval quality.
The final compact-recovery candidate preserves 48/48 correct answers and 144/144 correct judge votes. Relative to its parent candidate, recovery calls fall from 27 to 24, memory LLM calls from 210 to 207, memory LLM tokens from 1,838,020 to 1,790,001 (-2.6%), and embedding tokens by 2.6%. Final memories increase from 410 to 416 and observed ingestion time increases from 1,753s to 2,301s, so this is not presented as a storage or latency improvement. Removing recovery entirely was rejected after the assistant-only
e3fc4d6ecase produced no memory or retrieval evidence.Relative to main, final-candidate memory-layer LLM tokens are 1.507x, embedding tokens 1.639x, and persisted memories 2.755x. Relative to Mem0, candidate memory-layer LLM tokens increase 1.4%, embedding tokens decrease 69.2%, and persisted memories decrease 14.2%. Answer and judge usage is reported separately because cache behavior makes it unsuitable for a memory-layer cost comparison.
An immutable 10-question LoCoMo regression sample, stratified as two questions per category with three QA repeats, scored 0.6825 mean F1 for candidate versus 0.7107 for the previous focused-passage control. The -0.0282 delta passes the preregistered -0.05 bound but is reported as bounded regression, not an improvement. All of the difference is concentrated in two questions: one answer recovery omitted a supported clause, and two recovery calls for a long list exhausted their token limit; the other eight questions have identical three-repeat means.
The formal run and compact ablation passed checksum, isolation, provenance, usage-completeness, replication, category, error, and cost audits. Exact digests and integrated interpretation are in the English report and Chinese report. Earlier seed48 and seed137 experiments remain only as historical protocol-v1 diagnostics. No new unseen blind holdout has been run or selected for this candidate.
Agent dependency
github.com/Rememorio/trpc-agent-go@v0.0.0-20260721030639-bd6b31f92a90github.com/Rememorio/trpc-agent-go/memory/pgvector@v0.0.0-20260721030639-bd6b31f92a90Validation
go test ./... -count=1,go test -race ./... -count=1, andgo vet ./...inmemory/trpc-agent-go-impl