Semantic XPath: Structured Agentic Memory Access for Conversational AI
Organizations: University of Toronto, Canada · Vector Institute of Artificial Intelligence, Toronto, Canada
Abstract
Conversational AI (ConvAI) agents increasingly maintain structured memory to support long-term, task-oriented interactions. In-context memory approaches append the growing history to the model input, which scales poorly under context-window limits. RAG-based methods retrieve request-relevant information, but most assume flat memory collections and ignore structure. We propose Semantic XPath, a tree-structured memory module to access and update structured conversational memory. Semantic XPath improves performance over flat-RAG baselines by 176.7% while using only 9.1% of the tokens required by in-context memory. We also introduce SemanticXPath Chat, an end-to-end ConvAI demo system that visualizes the structured memory and query execution details. Overall, this paper demonstrates a candidate for the next generation of long-term, task-oriented ConvAI systems built on structured memory.
Figures & tables
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Method | Scorer | Itinerary | To Do List | Meal Kit | Avg. | ||||
| Pass | Tokens | Pass | Tokens | Pass | Tokens | Pass | Tokens | |||
| GPT-5 mini | In-context | – | 55.0 | 12,136 | 80.0 | 5,444 | 75.0 | 61,069 | 70.0 | 26,216 |
| Flat RAG | – | 25.0 | 3,137 | 40.0 | 2,722 | 25.0 | 3,892 | 30.0 | 3,250 | |
| GPT-5 mini | Semantic XPath | Sem | 75.0 | 5,548 | 64.0 | 5,937 | 60.0 | 7,013 | 66.3 | 6,166 |
| Semantic XPath | Entail | 85.0 | 5,161 | 84.0 | 5,184 | 80.0 | 6,728 | 83.0 | 5,691 | |
| Gemini 3 Flash | In-context | – | 95.0 | 12,846 | 72.0 | 10,465 | 70.0 | 52,849 | 79.0 | 25,387 |
| Model | Method | Scorer | Itinerary | To Do List | Meal Kit | Avg. | ||||
| Pass | Tokens | Pass | Tokens | Pass | Tokens | Pass | Tokens | |||
| GPT-5 mini | In-context | – | 90.0 | 28,342 | 70.0 | 20,398 | 80.0 | 158,552 | 80.0 | 69,097 |
| Flat RAG | – | 20.0 | 3,250 | 50.0 | 3,043 | 10.0 | 3,686 | 26.7 | 3,327 | |
| GPT-5 mini | Semantic XPath | Sem | 50.0 | 5,664 | 100.0 | 6,132 | 60.0 | 7,087 | 70.0 | 6,294 |
| Semantic XPath | Entail | 80.0 | 5,820 | 100.0 | 5,649 | 70.0 | 6,079 | 83.3 | 5,850 | |
| Gemini 3 Flash | In-context | – | 60.0 | 31,639 | 70.0 | 23,602 | 40.0 | 174,567 | 56.7 | 76,603 |
Conversational Memory
Conversational memory equips AI assistants to retain, update, and retrieve useful information from past interactions for coherent, personalized dialogue.
See all 71 papers