QueryLink: Leveraging Query-Memory Alignment for Long-Term Reasoning in LLM Agents

Xuxian Hu, Zhu Teng, Wei Zhang, Ming He, Jianping Fan


Abstract
Retrieval-Augmented Generation (RAG) systems are widely used to mitigate the stateless nature of Large Language Models (LLMs) in long-term and personalized interactions by incorporating external memory. However, existing approaches often prioritize memory organization, such as knowledge graphs, while overlooking a critical semantic gap between implicit, intent-driven queries and explicit, narrative-based memories. To bridge this gap, we propose QueryLink, a novel framework that leverages Query-Memory Alignment to project both queries and memories into a shared semantic space. It significantly boosts recall by facilitating multi-grained retrieval of semantically relevant information. To further enhance memory retrieval, we leverage Coherent Memory Chunking, a mechanism that processes memories in multi-turn dialogue units, preserving semantic integrity, rather than relying on fixed-size segments. Extensive experiments on the LoCoMo and LongMemEval benchmark demonstrate that QueryLink significantly outperforms SOTA methods, achieving at least a 7% improvement in reasoning accuracy (measured by LLM). Additionally, QueryLink can be integrated as a plug-and-play component to boost existing vector-based systems like A-MEM, leading to improvements of over 6% in both F1 and B1 scores.The code is available at https://github.com/Dontplay0112/querylink.
Anthology ID:
2026.findings-acl.765
Volume:
Findings of the Association for Computational Linguistics: ACL 2026
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
15608–15621
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.765/
DOI:
Bibkey:
Cite (ACL):
Xuxian Hu, Zhu Teng, Wei Zhang, Ming He, and Jianping Fan. 2026. QueryLink: Leveraging Query-Memory Alignment for Long-Term Reasoning in LLM Agents. In Findings of the Association for Computational Linguistics: ACL 2026, pages 15608–15621, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
QueryLink: Leveraging Query-Memory Alignment for Long-Term Reasoning in LLM Agents (Hu et al., Findings 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.765.pdf
Checklist:
 2026.findings-acl.765.checklist.pdf