Elamur Research⌕
☰
home / papers / 2026 / Semantic XPath: Structured Agentic Memory Access for Conversational AI

Semantic XPath: Structured Agentic Memory Access for Conversational AI

Paper · 2026 · Yifan Simon Liu, Ruifan Wu, Liam Gallagher et al.

Summary

Task-oriented conversational agents, such as those that plan trips, manage to-do lists or recommend meal kits, must keep revisable, hierarchical memory across many turns. Placing the whole history in the prompt becomes expensive and unreliable. The authors found that the in-context approach fails about half of requests after only five turns. Standard RAG avoids this cost, but it flattens memory and can retrieve items from the wrong branch, for example the wrong day of an itinerary. The authors propose Semantic XPath, a memory module that stores conversation state as a rooted tree. Its query language resembles XPath but replaces exact matching with semantic relevance scoring. An LLM translates each user request into a query against a schema inferred from the data. Executing the query returns only the relevant subtree, which is then used to answer the user or update memory. The system was tested on three curated domains and on the LoCoMo benchmark. It scored 176.7% higher than flat RAG while using just 9.1% of the tokens that in-context memory requires. An interactive demo, Semantic XPath Chat, accompanies the work.

Key points

  • Query language: Each query step has three parts:
    • an axis (/ for children, // for descendants);
    • a node-type selector or a wildcard;
    • optional positional selectors ([i], [-i], [i:j]) and semantic operators.
  • Semantic operators: Local operators match an attribute or a node against text (~=). Scores can be combined with sum, product, min, max and 1−P. Child scores can be aggregated with avg, min, max or gmean, as in //Day[avg(/POI[node~="conference"])].
  • Memory updates: Revision history is represented with Version nodes, for example Itinerary → Version → Day → POI. Each update creates a new version branch.
  • Evaluation: The tests used GPT-5 mini and Gemini 3 Flash. On LoCoMo, Semantic XPath consumed a mean of roughly 3,032 and 3,870 input tokens, amounting to 12.2% and 14.1% of what the in-context approach took as input.
  • Resources: A failure analysis found that retrieval is the main error source, while invalid queries are rare. A live demo is available at semanticxpathchat.com, and the code is on GitHub at D3Mlab/SemanticXpath-Chat.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works

🧭 Topics 1Research subjects and languages the work is about.Dialogue systems · 624 works

Cite

Cite as Yifan Simon Liu, Ruifan Wu, Liam Gallagher, Jiazhou Liang, Armin Toroghi and Scott Sanner. 2026. Semantic XPath: Structured Agentic Memory Access for Conversational AI. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2026.acl-demo.28

@inproceedings{liu2026semantic,
  title = {{Semantic XPath: Structured Agentic Memory Access for Conversational AI}},
  author = {Yifan Simon Liu, Ruifan Wu, Liam Gallagher, Jiazhou Liang, Armin Toroghi and Scott Sanner},
  booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
  year = {2026},
  doi = {10.18653/v1/2026.acl-demo.28},
  url = {https://doi.org/10.18653/v1/2026.acl-demo.28}
}

References

25 references, 5 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Howard Chen, Ramakanth Pasunuru, Jason Weston, and Asli Celikyilmaz. 2023. Walking down the memory maze: Beyond context limit through interactive reading. arXiv preprint arXiv:2310.05029. — [arXiv:2310.05029](https://arxiv.org/abs/2310.05029) find
  2. James Clark and Steve DeRose. 1999. XML Path Language (XPath) Version 1.0. W3C Recommendation. find
  3. Google. 2026. Gemini 3 Flash. Google AI for Developers Documentation. Accessed: 2026-05-12. find
  4. Nilesh Gupta, Wei-Cheng Chang, Ngot Bui, Cho-Jui Hsieh, and Inderjit S Dhillon. 2025. Llm-guided hierarchical retrieval. arXiv preprint arXiv:2510.13217. — [arXiv:2510.13217](https://arxiv.org/abs/2510.13217) find
  5. Junyoung Kim, Anton Korikov, Jiazhou Liang, Justin Cui, Yifan Simon Liu, Qianfeng Wen, Mark Zhao, and Scott Sanner. 2026. Bayesian active learning with gaussian processes guided by llm relevance scoring for dense passage retrieval. arXiv preprint arXiv:2604.17906. find
  6. Yifan Liu, Gelila Tilahun, Xinxiang Gao, Qianfeng Wen, and Michael Gervers. 2025a. A comparative study of static and contextual embeddings for analyzing semantic changes in medieval latin charters. In Proceedings of the First Workshop on Language Models for Low-Resource Languages, pages 182–192. find
  7. Yifan Liu, Qianfeng Wen, Jiazhou Liang, Mark Zhao, Justin Cui, Anton Korikov, Armin Toroghi, Junyoung Kim, and Scott Sanner. 2025b. Multimodal item scoring for natural language recommendation via gaussian process regression with llm relevance judgments. Preprint, arXiv:2510.22023.
  8. Yifan Liu, Qianfeng Wen, Mark Zhao, Jiazhou Liang, and Scott Sanner. 2025c. Ma-dpr: Manifold-aware distance metrics for dense passage retrieval. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 31073– 31091. find
  9. Junru Lu, Siyu An, Mingbao Lin, Gabriele Pergola, Yulan He, Di Yin, Xing Sun, and Yunsheng Wu. 2023. Memochat: Tuning llms to use memos for consistent long-range open-domain conversation. Preprint, arXiv:2308.08239. — [arXiv:2308.08239](https://arxiv.org/abs/2308.08239) find
  10. Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. 2024. Evaluating very long-term conversational memory of llm agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics. find
  11. OpenAI. 2026. GPT-5 mini. OpenAI API Documentation. Accessed: 2026-05-12. find
  12. Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Advances in Neural Information Proc…
  13. Rui Li, Zeyu Zhang, Xiaohe Bo, Zihang Tian, Xu Chen, Quanyu Dai, Zhenhua Dong, and Ruiming Tang. 2025. Cam: A constructivist view of agentic memory for llm-based reading comprehension. In Advances in Neural Information Processing Systems (NeurIPS). find
  14. Jiazhou Liang, Yifan Simon Liu, David Guo, Minqi Sun, Yilun Jiang, and Scott Sanner. 2026. Evaluating scene-based in-situ item labeling for immersive conversational recommendation. arXiv preprint arXiv:2604.09698. find
  15. Nelson F Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024. Lost in the middle: How language models use long contexts. Transactions of the association for computational linguistics, 12:157–173.
  16. Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. 2023. Memgpt: Towards llms as operating systems. Preprint, arXiv:2310.08560. find
  17. Alireza Rezazadeh, Zichao Li, Wei Wei, and Yujia Bao. 2024. From isolated conversations to hierarchical schemas: Dynamic tree memory representation for llms. arXiv preprint arXiv:2410.14052. — [arXiv:2410.14052](https://arxiv.org/abs/2410.14052) find
  18. Parth Sarthi, Salman Abdullah, Aditi Tuli, Shubh Khanna, Anna Goldie, and Christopher D Manning. 2024. Raptor: Recursive abstractive processing for tree-organized retrieval. In The Twelfth International Conference on Learning Representations.
  19. Haoran Sun and Shaoning Zeng. 2025. Hierarchical memory for high-efficiency long-term reasoning in llm agents. arXiv preprint arXiv:2507.22925. — [arXiv:2507.22925](https://arxiv.org/abs/2507.22925) find
  20. Qingyue Wang, Yanhe Fu, Yanan Cao, Shuai Wang, Zhiliang Tian, and Liang Ding. 2025. Recursively summarizing enables long-term dialogue memory in large language models. Neurocomputing, 639:130193. find
  21. Qianfeng Wen, Yifan Liu, Justin Cui, Joshua Zhang, Anton Korikov, George-Kirollos Saad, and Scott Sanner. 2025. A simple but effective elaborative query reformulation approach for natural language recommendation. Preprint, arXiv:2510.02656. — [arXiv:2510.02656](https://arxiv.org/abs/2510.02656) find
  22. Qianfeng Wen, Yifan Liu, Joshua Zhang, George Saad, Anton Korikov, Yury Sambale, and Scott Sanner. 2024. Elaborative subtopic query reformulation for broad and indirect queries in travel destination recommendation. Preprint, arXiv:2410.01598. — [arXiv:2410.01598](https://arxiv.org/abs/2410.01598) find
  23. Xuechen Zhang, Xiangyu Chang, Mingchen Li, Amit Roy-Chowdhury, Jiasi Chen, and Samet Oymak. 2024. Selective attention: Enhancing transformer through principled context control. Advances in Neural Information Processing Systems, 37:11061– 11086. find
  24. Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and William B Dolan. 2020. Dialogpt: Large-scale generative pre-training for conversational response generation. In Proceedings of the 58th annual meeting of the association for computational…
  25. Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. 2024. Memorybank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 19724–19731. find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/liu-2026-semantic-xpath-structured-agentic-memory/