---
title: "Semantic XPath — paper by Liu et al. (2026)"
description: "The authors propose Semantic XPath, a memory module that stores conversation state as a rooted tree. 25 references, cited by 3 papers here."
authors: ["Yifan Simon Liu", "Ruifan Wu", "Liam Gallagher", "Jiazhou Liang", "Armin Toroghi", "Scott Sanner"]
year: 2026
venue: "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)"
source: "https://aclanthology.org/2026.acl-demo.28/"
doi: "10.18653/v1/2026.acl-demo.28"
licence: "CC BY 4.0 (ACL Anthology)"
licence_url: "https://creativecommons.org/licenses/by/4.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/liu-2026-semantic-xpath-structured-agentic-memory/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/liu-2026-semantic-xpath-structured-agentic-memory/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2026](https://md.research.elamur.ai/free/en/papers/2026/page/6/) / Semantic XPath: Structured Agentic Memory Access for Conversational AI

# Semantic XPath: Structured Agentic Memory Access for Conversational AI

**Authors:** [Yifan Simon Liu](https://md.research.elamur.ai/free/en/authors/yifan-simon-liu/), Ruifan Wu, Liam Gallagher, [Jiazhou Liang](https://md.research.elamur.ai/free/en/authors/jiazhou-liang/), [Armin Toroghi](https://md.research.elamur.ai/free/en/authors/armin-toroghi/) and [Scott Sanner](https://md.research.elamur.ai/free/en/authors/scott-sanner/) · **Year:** 2026 · **Venue:** [Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)](https://md.research.elamur.ai/free/en/venues/acl/) ([ACL 2026](https://md.research.elamur.ai/free/en/venues/acl/2026/)) · **Publisher:** [Association for Computational Linguistics](https://md.research.elamur.ai/free/en/publishers/association-for-computational-linguistics/) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

**Links:** [Publisher's page](https://aclanthology.org/2026.acl-demo.28/) · [PDF](https://aclanthology.org/2026.acl-demo.28.pdf) · [DOI 10.18653/v1/2026.acl-demo.28](https://doi.org/10.18653/v1/2026.acl-demo.28) · [OpenAlex](https://openalex.org/W7166891334)

**Citations:** 0 citations (OpenAlex, 2026-10-14) · [3](https://md.research.elamur.ai/free/en/papers/liu-2026-semantic-xpath-structured-agentic-memory/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## 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

- [University of Toronto](https://md.research.elamur.ai/free/en/universities/university-of-toronto/) — University, Toronto, Canada · 96 works · 142,007 citations
- [Vector Institute](https://md.research.elamur.ai/free/en/labs/vector-institute/) — Research institute, Toronto, Canada · 33 works · 4,535 citations

📚 Shelves (4): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 16,667 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 16,194 works · [🎭 Arts and Humanities](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/) · 16,039 works · [🗣️ Language and Linguistics](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/language-and-linguistics/) · 15,891 works

🧭 Topics (1): [🗨️ Dialogue systems](https://md.research.elamur.ai/free/en/topics/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.

```bibtex
@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}
}
```

- [← previous Semantic Change Characterization with LLMs using Rhetorics](https://md.research.elamur.ai/free/en/papers/sa-2026-semantic-change-characterization-llms-rhetorics/)
- [next → SFTMix: Elevating Language Model Instruction Tuning with Mixup Recipe](https://md.research.elamur.ai/free/en/papers/xiao-2026-sftmix-elevating-language-model-instruction/)
- [↑ back to papers of 2026](https://md.research.elamur.ai/free/en/papers/2026/page/6/)

## 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](https://scholar.google.com/scholar?q=Howard+Chen%2C+Ramakanth+Pasunuru%2C+Jason+Weston%2C+and+Asli+Celikyilmaz%2E+2023%2E+Walking+down+the+memory+maze%3A+Beyond+context+limit+through+interactive+reading%2E+arXiv+preprint+arXiv%3A2310%2E05029%2E+%E2%80%94+%5BarXiv%3A231)
2. James Clark and Steve DeRose. 1999. XML Path Language (XPath) Version 1.0. W3C Recommendation. [find](https://scholar.google.com/scholar?q=James+Clark+and+Steve+DeRose%2E+1999%2E+XML+Path+Language+%28XPath%29+Version+1%2E0%2E+W3C+Recommendation%2E)
3. Google. 2026. Gemini 3 Flash. Google AI for Developers Documentation. Accessed: 2026-05-12. [find](https://scholar.google.com/scholar?q=Google%2E+2026%2E+Gemini+3+Flash%2E+Google+AI+for+Developers+Documentation%2E+Accessed%3A+2026%2D05%2D12%2E)
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](https://scholar.google.com/scholar?q=Nilesh+Gupta%2C+Wei%2DCheng+Chang%2C+Ngot+Bui%2C+Cho%2DJui+Hsieh%2C+and+Inderjit+S+Dhillon%2E+2025%2E+Llm%2Dguided+hierarchical+retrieval%2E+arXiv+preprint+arXiv%3A2510%2E13217%2E+%E2%80%94+%5BarXiv%3A2510%2E13217%5D%28https%3A%2F%2Farxiv%2Eorg%2Fabs%2F251)
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](https://scholar.google.com/scholar?q=Junyoung+Kim%2C+Anton+Korikov%2C+Jiazhou+Liang%2C+Justin+Cui%2C+Yifan+Simon+Liu%2C+Qianfeng+Wen%2C+Mark+Zhao%2C+and+Scott+Sanner%2E+2026%2E+Bayesian+active+learning+with+gaussian+processes+guided+by+llm+relevance+scori)
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](https://scholar.google.com/scholar?q=Yifan+Liu%2C+Gelila+Tilahun%2C+Xinxiang+Gao%2C+Qianfeng+Wen%2C+and+Michael+Gervers%2E+2025a%2E+A+comparative+study+of+static+and+contextual+embeddings+for+analyzing+semantic+changes+in+medieval+latin+charters%2E+In)
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](https://md.research.elamur.ai/free/en/papers/liu-2026-multimodal-item-scoring-natural-language/). 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](https://scholar.google.com/scholar?q=Yifan+Liu%2C+Qianfeng+Wen%2C+Mark+Zhao%2C+Jiazhou+Liang%2C+and+Scott+Sanner%2E+2025c%2E+Ma%2Ddpr%3A+Manifold%2Daware+distance+metrics+for+dense+passage+retrieval%2E+In+Proceedings+of+the+2025+Conference+on+Empirical+Meth)
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](https://scholar.google.com/scholar?q=Junru+Lu%2C+Siyu+An%2C+Mingbao+Lin%2C+Gabriele+Pergola%2C+Yulan+He%2C+Di+Yin%2C+Xing+Sun%2C+and+Yunsheng+Wu%2E+2023%2E+Memochat%3A+Tuning+llms+to+use+memos+for+consistent+long%2Drange+open%2Ddomain+conversation%2E+Preprint%2C+ar)
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](https://scholar.google.com/scholar?q=Adyasha+Maharana%2C+Dong%2DHo+Lee%2C+Sergey+Tulyakov%2C+Mohit+Bansal%2C+Francesco+Barbieri%2C+and+Yuwei+Fang%2E+2024%2E+Evaluating+very+long%2Dterm+conversational+memory+of+llm+agents%2E+In+Proceedings+of+the+62nd+Annual)
11. OpenAI. 2026. GPT-5 mini. OpenAI API Documentation. Accessed: 2026-05-12. [find](https://scholar.google.com/scholar?q=OpenAI%2E+2026%2E+GPT%2D5+mini%2E+OpenAI+API+Documentation%2E+Accessed%3A+2026%2D05%2D12%2E)
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](https://md.research.elamur.ai/free/en/papers/lewis-2020-retrieval-augmented-generation-knowledge-intensive/). 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](https://scholar.google.com/scholar?q=Rui+Li%2C+Zeyu+Zhang%2C+Xiaohe+Bo%2C+Zihang+Tian%2C+Xu+Chen%2C+Quanyu+Dai%2C+Zhenhua+Dong%2C+and+Ruiming+Tang%2E+2025%2E+Cam%3A+A+constructivist+view+of+agentic+memory+for+llm%2Dbased+reading+comprehension%2E+In+Advances+in+)
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](https://scholar.google.com/scholar?q=Jiazhou+Liang%2C+Yifan+Simon+Liu%2C+David+Guo%2C+Minqi+Sun%2C+Yilun+Jiang%2C+and+Scott+Sanner%2E+2026%2E+Evaluating+scene%2Dbased+in%2Dsitu+item+labeling+for+immersive+conversational+recommendation%2E+arXiv+preprint+arXi)
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](https://md.research.elamur.ai/free/en/papers/liu-2023-lost-middle-language-models-use/). 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](https://scholar.google.com/scholar?q=Charles+Packer%2C+Sarah+Wooders%2C+Kevin+Lin%2C+Vivian+Fang%2C+Shishir+G%2E+Patil%2C+Ion+Stoica%2C+and+Joseph+E%2E+Gonzalez%2E+2023%2E+Memgpt%3A+Towards+llms+as+operating+systems%2E+Preprint%2C+arXiv%3A2310%2E08560%2E)
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](https://scholar.google.com/scholar?q=Alireza+Rezazadeh%2C+Zichao+Li%2C+Wei+Wei%2C+and+Yujia+Bao%2E+2024%2E+From+isolated+conversations+to+hierarchical+schemas%3A+Dynamic+tree+memory+representation+for+llms%2E+arXiv+preprint+arXiv%3A2410%2E14052%2E+%E2%80%94+%5BarXiv%3A)
18. Parth Sarthi, Salman Abdullah, Aditi Tuli, Shubh Khanna, Anna Goldie, and Christopher D Manning. 2024. [Raptor: Recursive abstractive processing for tree-organized retrieval](https://md.research.elamur.ai/free/en/papers/sarthi-2024-raptor-recursive-abstractive-processing-tree/). 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](https://scholar.google.com/scholar?q=Haoran+Sun+and+Shaoning+Zeng%2E+2025%2E+Hierarchical+memory+for+high%2Defficiency+long%2Dterm+reasoning+in+llm+agents%2E+arXiv+preprint+arXiv%3A2507%2E22925%2E+%E2%80%94+%5BarXiv%3A2507%2E22925%5D%28https%3A%2F%2Farxiv%2Eorg%2Fabs%2F2507%2E22925%29)
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](https://scholar.google.com/scholar?q=Qingyue+Wang%2C+Yanhe+Fu%2C+Yanan+Cao%2C+Shuai+Wang%2C+Zhiliang+Tian%2C+and+Liang+Ding%2E+2025%2E+Recursively+summarizing+enables+long%2Dterm+dialogue+memory+in+large+language+models%2E+Neurocomputing%2C+639%3A130193%2E)
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](https://scholar.google.com/scholar?q=Qianfeng+Wen%2C+Yifan+Liu%2C+Justin+Cui%2C+Joshua+Zhang%2C+Anton+Korikov%2C+George%2DKirollos+Saad%2C+and+Scott+Sanner%2E+2025%2E+A+simple+but+effective+elaborative+query+reformulation+approach+for+natural+language+rec)
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](https://scholar.google.com/scholar?q=Qianfeng+Wen%2C+Yifan+Liu%2C+Joshua+Zhang%2C+George+Saad%2C+Anton+Korikov%2C+Yury+Sambale%2C+and+Scott+Sanner%2E+2024%2E+Elaborative+subtopic+query+reformulation+for+broad+and+indirect+queries+in+travel+destination+r)
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](https://scholar.google.com/scholar?q=Xuechen+Zhang%2C+Xiangyu+Chang%2C+Mingchen+Li%2C+Amit+Roy%2DChowdhury%2C+Jiasi+Chen%2C+and+Samet+Oymak%2E+2024%2E+Selective+attention%3A+Enhancing+transformer+through+principled+context+control%2E+Advances+in+Neural+Info)
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](https://md.research.elamur.ai/free/en/papers/zhang-2019-dialogpt-large-scale-generative-pre/). 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](https://scholar.google.com/scholar?q=Wanjun+Zhong%2C+Lianghong+Guo%2C+Qiqi+Gao%2C+He+Ye%2C+and+Yanlin+Wang%2E+2024%2E+Memorybank%3A+Enhancing+large+language+models+with+long%2Dterm+memory%2E+In+Proceedings+of+the+AAAI+Conference+on+Artificial+Intelligence)

*Updated 31 October 2026*
