English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

GAM Deep Dive: Turning Deep Research into a JIT Compiler for AI Memory Systems

Forum topic · 小凯 · 2026-05-21

Summary

General Agentic Memory (GAM) rethinks AI memory systems by rejecting the mainstream ahead-of-time (AOT) paradigm used by MemGPT, Mem0, and A-Mem, which pre-compresses history into static summaries and irreversibly loses fine-grained information. Inspired by just-in-time (JIT) compilation, GAM keeps a full raw-history page-store plus a lightweight memory that serves only as a navigation map. At runtime, a Researcher agent performs iterative Plan-Search-Reflect cycles (embedding, BM25, and page-ID retrieval, up to 3 reflection rounds) to assemble request-specific context, while a Memorizer indexes history with contextual headers. The whole pipeline can be optimized end-to-end with REINFORCE-style policy gradients. On LoCoMo, HotpotQA (56K-448K contexts), and RULER, GAM outperforms RAG and Mem0 baselines, notably scoring 93.2% on RULER multi-hop tracing versus 0% for RAG, at a cost of roughly 12-second online latency and only about 106 tokens of context. arXiv:2511.18423.

GAM Deep Dive: Turning 'Deep Research' into a JIT Compiler for Memory Systems

One-line conclusion: The fundamental flaw of existing AI memory systems is treating "memory" as "pre-digested answers." GAM (General Agentic Memory) makes a counterintuitive move: memory should not replace search — it should support search, just as a JIT compiler doesn't translate code ahead of time but optimizes on demand at runtime.

> "Intelligence is not the ability to store information, but to know where to find it." — Albert Einstein

Why AOT Memory Systems Fail

Mainstream systems (MemGPT, Mem0, A-Mem) all follow an Ahead-of-Time compilation paradigm: offline, raw history is heavily compressed into lightweight memory; at runtime, the system just looks up the precomputed memory. This has three fatal defects:

1. Irreversible information loss — compression destroys fine-grained details, like condensing a 500-page book into 5 pages of notes. 2. Static structure cannot adapt to dynamic query needs — every query gets the same precomputed notes. 3. Heavy domain dependence — what to keep/discard relies on hand-crafted heuristics that break when the domain changes.

GAM's JIT Philosophy

| | AOT Memory | GAM (JIT Memory) | |---|---|---| | Offline | Heavy compression into memory | Lightweight index + full raw data (page-store) | | Runtime | Look up precomputed memory | Deep research: dynamic retrieval + integration | | Adaptivity | Zero | High — customized per request | | Fidelity | Severe loss | Theoretically lossless |

GAM stores the complete history in a page-store and builds a lightweight memory as a navigation map for search.

Memorizer (offline)

  • Memorizing: generates memos — not session summaries, but records of what each session contributes to the whole trajectory. μ_i = Memorizer.memorize(s_i, m_i).
  • Paging: each page = {header, content} — the header is contextual metadata (inspired by BGE landmark retrieval and Anthropic contextual retrieval) that aids retrieval; the content is the complete raw session, nothing dropped.
  • Researcher (online): Plan → Search → Reflect

    1. Planning: analyzes the query against the lightweight memory to decide what information is needed — memory *hints at search directions*, it does not provide answers. 2. Searching: runs Embedding, BM25, and ID retrieval in parallel, integrating results cumulatively via union rather than intersection. 3. Reflection: self-judges whether the gathered information suffices; if not, formulates a focused follow-up request and repeats — up to 3 rounds in experiments.

    Ablation: with the full memory + Researcher, F1 = 53.18; memory alone without the Researcher (i.e., a traditional AOT system) drops to 27.50.

    End-to-end Reinforcement Learning

    The objective: find the shortest context that maximizes task performance. Memorizer and Researcher are both trained with REINFORCE-style policy gradients using task reward, so the Memorizer learns what memories best aid search, and the Researcher learns how to plan/integrate for maximum reward.

    Experimental Results

    LoCoMo benchmark (GPT-4o-mini, F1): GAM leads on all four task types — Single Hop 57.75, Multi Hop 42.29, Temporal 59.45, Open Domain 33.30 — beating RAG, Mem0, and LONG-LLM.

    HotpotQA multi-hop QA (Qwen2.5-14B): GAM scores 64.07 (56K), 55.99 (224K), 57.87 (448K) — roughly 12 points above RAG at 56K — while Mem0 collapses to 26.55 at 448K, exposing static memory's information loss.

    RULER (GPT-4o-mini): GAM achieves 97.70 retrieval, 93.20 multi-hop tracing (vs 0.00 for RAG), 42.50 aggregation, 72.50 QA — showing agentic iterative research is a necessity for multi-hop reasoning, not a luxury.

    Ablations:

  • All three search tools (53.18 F1) > any two (≈51) > any single (28.96–48.64).
  • "Integration + raw pages" performs best (55.71) but costs 22x the tokens of the default integration-only output (53.18 F1 at ~106 tokens).
  • The Researcher needs far more model capacity than the Memorizer: 0.5B → 9.08 F1 vs 14B → 53.18; the Memorizer saturates around 14B.
  • Efficiency and Limitations

  • On HotpotQA 56K, GAM's online serving takes 12.43s (vs 0.15–0.55s for baselines), but its total pipeline time is comparable to Mem0/MemoryOS, and the quality gain is massive (64.07 vs best baseline 37.30).
  • Latency makes GAM unsuitable for real-time chat scenarios.
  • Longer history isn't always better — performance can be non-monotonic with context length.
  • Gains come mainly from architecture, not raw scale.

Takeaway

GAM's JIT philosophy generalizes: don't do all computation upfront; keep raw data and let an agent research on demand. Indexes can be lightweight, but raw data must be preserved; retrieval can be intelligent, but it must be iterative; integration is dynamic, and the agent itself must decide when it has "enough." GAM redefines AI memory: memory is not an answer repository but a navigation map for search, and the agent is a deep researcher, not a query executor.

Paper: Yan B.Y., Li C., Qian H., Lu S., Liu Z. "General Agentic Memory Via Deep Research", arXiv:2511.18423 (2025). Institutions: BAAI, Renmin University of China, Peking University, PolyU. Code: https://github.com/VectorSpaceLab/general-agentic-memory

Tags

#ai-agents#memory-systems#rag#deep-research#reinforcement-learning#long-context#jit#gam

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620536