English

MemQ: Integrating Q-Learning into Self-Evolving Memory Agents over Provenance DAGs

Artificial Intelligence 2026-05-15 v3

Abstract

Episodic memory allows LLM agents to accumulate and retrieve experience, but current methods treat each memory independently, i.e., evaluating retrieval quality in isolation without accounting for the dependency chains through which memories enable the creation of future memories. We introduce MemQ, which applies TD(λ\lambda) eligibility traces to memory Q-values, propagating credit backward through a provenance DAG that records which memories were retrieved when each new memory was created. Credit weight decays as (γλ)d(\gamma\lambda)^d with DAG depth dd, replacing temporal distance with structural proximity. We formalize the setting as an Exogenous-Context MDP, whose factored transition decouples the exogenous task stream from the endogenous memory store. Across six benchmarks, spanning OS interaction, function calling, code generation, multimodal reasoning, embodied reasoning, and expert-level QA, MemQ achieves the highest success rate on all six in generalization evaluation and runtime learning, with gains largest on multi-step tasks that produce deep and relevant provenance chains (up to +5.7~pp) and smallest on single-step classification (+0.77~pp) where single-step updates already suffice. We further study how γ\gamma and λ\lambda interact with the EC-MDP structure, providing principled guidance for parameter selection and future research. Code is available at https://github.com/jwliao-ai/MemQ.

Keywords

Cite

@article{arxiv.2605.08374,
  title  = {MemQ: Integrating Q-Learning into Self-Evolving Memory Agents over Provenance DAGs},
  author = {Junwei Liao and Haoting Shi and Ruiwen Zhou and Jiaqian Wang and Shengtao Zhang and Wei Zhang and Ying Wen and Zhiyu Li and Feiyu Xiong and Bo Tang and Weinan Zhang and Muning Wen},
  journal= {arXiv preprint arXiv:2605.08374},
  year   = {2026}
}

Comments

22 pages, 11 figures (containing 43 individual image panels total)

R2 v1 2026-07-01T12:58:51.365Z