SkillAgentSearch skills...

Agentmemory

Memory system for AI agents. #1 on LongMemEval — 96.2% (481/500). Beats every published system including Chronos, Mastra, Supermemory, and Emergence. Built solo in 16 days for $1,000.

Install / Use

/learn @JordanMcCann/Agentmemory
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

agentmemory V4 — World Record on LongMemEval

96.20% on LongMemEval — the highest score ever achieved on this benchmark under real-retrieval conditions. 481 correct out of 500 cases. Single deterministic run. No oracle access. No ensemble.

Surpasses the previous world record of 95.60% held by PwC Chronos by +0.60 percentage points (+3 cases). Built by Jordan McCann with no team, no funding, and no degree — in 16 days on a mid-range gaming PC.

My LinkedIn Profile: https://www.linkedin.com/in/jordan-mccann-24b183235/

Python License LongMemEval Benchmark


The Result

| Metric | Value | |--------|-------| | Benchmark | LongMemEval (500-case oracle dataset) | | Evaluation mode | Real retrieval — USE_DIRECT_CONTEXT=False | | Score | 96.20% (481 / 500) | | Previous world record | 95.60% — PwC Chronos (478 / 500) | | Margin | +0.60 pp / +3 cases | | Run type | Single deterministic run | | Generator | Claude Opus 4.6 (temperature=0) | | Judge | GPT-4o (temperature=0, seed=42) | | Legitimacy verified | ✓ — see LEGITIMACY.md |


Benchmark Comparison

All scores are on LongMemEval_S (500 questions), single-pass real-retrieval with a GPT-4o judge unless noted. Direct-context / oracle-access scores are excluded — they do not reflect real-world retrieval capability. Ensemble scores (multiple candidates voted or reranked) are also excluded for fair comparison.

| Rank | System | Score | Correct / 500 | Generator | Notes | |------|--------|------:|---------------|-----------|-------| | 🥇 1 | agentmemory V4 (this repo) | 96.20% | 481 | Claude Opus 4.6 | Single deterministic run | | 🥈 2 | Chronos High — PwC | 95.60% | 478 | Enhanced config | arXiv, Mar 2026 | | 3 | Mastra OM (high) | 94.87% | — | GPT-5-mini | Mastra research page, Feb 2026 | | 4 | OMEGA | 93.20% | 466 | Unspecified | Raw accuracy; their reported "95.4%" is a task-weighted average, not raw score | | 5 | Chronos Low — PwC | 92.60% | — | GPT-4o | arXiv, Mar 2026 | | 6 | Hindsight (high) | 91.40% | — | Gemini 3 Pro | ⚠ Non-standard judge (GPT-OSS-120B); arXiv, Jan 2026 | | 7 | Hindsight (low) | 89.00% | — | GPT-OSS-120B | ⚠ Non-standard judge (GPT-OSS-120B); arXiv, Jan 2026 | | 8 | Emergence Internal | 86.00% | — | GPT-4o | Emergence blog | | 9 | Supermemory | 85.86% | — | GPT-4o | Single-pass score; their advertised ~99% uses an 8-variant ensemble | | 10 | Mastra OM (base) | 84.23% | — | GPT-4o | Mastra research page | | 11 | Emergence Simple | 82.40% | — | GPT-4o | Emergence blog | | 12 | Zep | 71.20% | — | GPT-4o | Zep paper, Jan 2025 |

Comparability notes:

  • OMEGA 95.4% is a task-weighted average across question types, not raw accuracy. Raw: 466/500 = 93.2%.
  • Hindsight uses GPT-OSS-120B as both generator and judge — a non-standard judge that is not directly comparable to GPT-4o-judged results. Scores are included for reference only.
  • Supermemory's ~99% is an 8-variant ensemble result, not a single-pass system. The 85.86% above is their single-pass comparable score.
  • agentmemory V4 is a single deterministic run with PYTHONHASHSEED=42 and judge seed=42 — fully reproducible, no ensembling, no oracle access.

Per-Category Results (agentmemory V4, Opus6)

| Question Type | Correct | Total | Accuracy | |---------------|---------|-------|----------| | single-session-user | 70 | 70 | 100.0% | | knowledge-update | 76 | 78 | 97.4% | | single-session-preference | 29 | 30 | 96.7% | | single-session-assistant | 54 | 56 | 96.4% | | temporal-reasoning | 128 | 133 | 96.2% | | multi-session | 124 | 133 | 93.2% | | OVERALL | 481 | 500 | 96.20% |

Abstention cases: 30/30 correct (100.0%) — the system correctly identified all unanswerable questions.


The Story

Background

agentmemory V4 is a complete memory operating system for AI agents: a retrieval engine, knowledge graph, consolidation pipeline, and evaluation harness built from scratch.

The LongMemEval benchmark (Wu et al., 2024) is the standard evaluation for long-term agent memory systems. It tests 500 cases across six question types — temporal reasoning, multi-session aggregation, knowledge update, and single-session recall — requiring a system to ingest multi-session conversation histories and answer questions purely from retrieved memory, with no access to the original conversation.

The 16-Day Journey

This result was built over 16 days by a single developer, on a mid-range gaming PC (Intel Core i3-12100F), spending approximately $1,000 total across API costs and roughly 300 million tokens consumed throughout development.

No degree. No team. No funding. No prior academic research.

750+ iteration logs, regression tests, and progress files are available on request.

The development followed a systematic optimization process spanning 46 iteration cycles, each validated through targeted test runs before any full evaluation:

| Phase | Score | Notes | |-------|-------|-------| | Initial system, first run | ~68% | Unoptimized baseline | | After early optimization cycles | ~98% | High score, but evaluation was invalid | | Discovered invalidation | — | USE_DIRECT_CONTEXT=True — system was receiving the full raw conversation transcript rather than retrieved memories. This is oracle access, not retrieval. The 98% score was discarded entirely. | | Flipped to legitimate mode (USE_DIRECT_CONTEXT=False) | ~88% | Real retrieval only — cold restart | | ITER-1 (calibrated real-retrieval baseline) | 82.0% (410/500) | Official starting point | | ITER-32 | 91.4% (457/500) | +9.4 pp over 32 cycles | | ITER-45 (Opus1 / Opus2 / Opus3 / Opus4) | 95.6% (478/500) | Tied the Chronos world record — three times | | ITER-46 (Opus6) | 96.20% (481/500) | New world record |

What Broke the Tie — ITER-46

Opus1 through Opus4 all landed at exactly 478/500 despite continued prompt engineering. Root cause analysis identified two independent sources of non-determinism in the HNSW retrieval index that were causing ±3 case swings per run, canceling every improvement:

  1. Insertion-order-dependent node levels — level assignment used sequential RNG seeded with 42, but the traversal order depended on async scheduling, making the graph structure different on every run.

  2. PYTHONHASHSEED randomization — Python randomizes hash() for strings by default, changing set iteration order in HNSW beam search between processes.

ITER-46 fixed both with a three-part solution: SHA-256 vector hashing for level assignment (content-based, insertion-order-independent), subprocess re-execution with PYTHONHASHSEED=42 (deterministic beam search), and seed=42 on the GPT-4o judge call. The resulting deterministic HNSW graph produced a superior retrieval configuration that had been masked by noise in every prior run.

The full optimization methodology was developed through a proprietary systematic iteration process. Implementation details are in the source; iteration methodology is not published.


Architecture

| Component | Implementation | |-----------|---------------| | Generator | Claude Opus 4.6 via Anthropic API (temperature=0) | | Judge | GPT-4o via OpenAI API (temperature=0, seed=42) | | Embedder | all-mpnet-base-v2 (sentence-transformers, 768-dim) | | ANN index | HNSW (M=16, ef_construction=200, ef_search=100) | | Reranker | cross-encoder/ms-marco-MiniLM-L-6-v2 (1,236 calls across 500 cases) | | Storage | SQLite (:memory: per case — no cross-case contamination) | | Retrieval signals | Semantic (0.30) · Lexical/BM25 (0.12) · Activation (0.18) · Graph (0.18) · Importance (0.10) · Temporal (0.12) | | Token budgets | multi-session: 7,500 · temporal-reasoning: 5,000 · knowledge-update: 2,500 · single-session: 1,500–3,500 | | Determinism | PYTHONHASHSEED=42 (subprocess re-exec) · SHA-256 vector hash (HNSW levels) · judge seed=42 | | Total tokens (full run) | 4,308,380 | | Errors / abstention failures | 0 / 0 |

Retrieval Pipeline (per case)

haystack_sessions
      │
      ▼
  MemoryStore (:memory: SQLite)       ← fresh per case, no cross-contamination
  ├── Ingestion: all sessions, all turns
  ├── Event extraction (temporal-reasoning)
  └── Graph construction (auto)
      │
      ▼
  async_recall(question, limit=500)
  ├── HNSW ANN candidates (semantic)
  ├── BM25 lexical candidates
  ├── Activation, graph, importance, temporal scoring
  └── CrossEncoder reranker
      │
      ▼
  async_build_context(token_budget)
  ├── Session-balanced or topic-dense selection (per type)
  ├── Session date label injection
  └── Coreference hints (multi-session)
      │
      ▼
  Claude Opus 4.6  →  GPT-4o judge  →  correct / incorrect

Legitimacy Verification

The 96.20% score has been audited against the LongMemEval benchmark methodology.

Key verifications:

  • USE_DIRECT_CONTEXT = False is enforced with a hard assert that crashes the run if set otherwise
  • answer_session_ids and has_answer oracle fields are never accessed during generation
  • All haystack_sessions are ingested — no pre-filtering to answer-containing sessions
  • Judge prompts match the official evaluate_qa.py templates verbatim
  • Scoring uses the standard LongMemEval J-score formula (correct / 500 × 100)
  • All 500 cases evaluated — zero errors, zero skips

→ Full audit report: LEGITIMACY.md


Quick Start

from agentmemory import Memo
View on GitHub
GitHub Stars7
CategoryDevelopment
Updated2d ago
Forks0

Languages

Python

Security Score

85/100

Audited on Apr 3, 2026

No findings