Semantic XPath: Structured Agentic Memory Access for Conversational AI
Semantic XPath uses tree-structured memory for conversational AI, improving performance by 176.7% with only 9.1% of tokens.
Key Findings
Methodology
This paper introduces Semantic XPath, a method utilizing a tree-structured memory module for accessing and updating conversational memory. It combines an XPath-style query language with semantic matching techniques to efficiently retrieve relevant memory substructures. This structured memory access significantly enhances memory management and updates.
Key Results
- Semantic XPath improves performance over flat RAG baselines by 176.7%, while using only 9.1% of the tokens required by in-context memory.
- In multi-turn dialogues, Semantic XPath maintains stable pass rates, significantly outperforming in-context memory methods.
- Experimental results show that Semantic XPath excels across various conversational tasks, especially those requiring structured memory.
Significance
Semantic XPath offers an efficient memory management solution for long-term, task-oriented conversational AI systems. By leveraging structured memory access, it addresses the limitations of traditional in-context memory methods in terms of token usage and performance, providing new insights for future dialogue system development.
Technical Contribution
The technical contributions of Semantic XPath include the introduction of a tree-structured memory module and an XPath-style query language. This approach not only enhances memory retrieval efficiency but also reduces token usage, offering new engineering possibilities.
Novelty
Semantic XPath is the first to combine XPath query language with semantic matching for structured conversational memory access. Its innovation lies in effectively utilizing the hierarchical structure of conversational memory, rather than simple flat retrieval.
Limitations
- Semantic XPath may face performance bottlenecks when handling extremely complex memory structures.
- The system's semantic matching accuracy depends on the capabilities of the underlying model.
Future Work
Future research directions include optimizing the performance of Semantic XPath, enhancing its handling of complex memory structures, and exploring its application in more conversational scenarios.
AI Executive Summary
As conversational AI systems evolve, effectively managing and accessing long-term memory becomes a crucial challenge. Traditional in-context memory methods append growing history, leading to performance degradation and increased token usage. To address this, the paper proposes Semantic XPath, a tree-structured memory module that uses an XPath-style query language for efficient memory access and updates.
Semantic XPath significantly enhances dialogue system performance through structured memory management. In experiments, it outperforms flat RAG baselines by 176.7% in performance while using only 9.1% of the tokens required by in-context memory. This efficient memory access enables Semantic XPath to excel in multi-turn dialogues, particularly in tasks requiring complex memory structures.
Despite its excellent performance, Semantic XPath may face challenges when dealing with extremely complex memory structures. Future research can further optimize its performance and explore its potential applications in more dialogue scenarios.
Deep Analysis
Background
Conversational AI systems have rapidly developed in recent years, especially in task-oriented long-term dialogues, where effectively managing and accessing conversational memory becomes a key issue. Traditional in-context memory methods manage memory by appending historical records, but this approach performs poorly in long dialogues. RAG methods improve efficiency by retrieving relevant information but often ignore the structural nature of memory.
Core Problem
The core problem is how to efficiently manage and access structured memory in long-term dialogues. Traditional methods are inefficient in handling complex dialogues, consume a large number of tokens, and are prone to reasoning errors and hallucinated outputs.
Innovation
The core innovation of Semantic XPath lies in introducing a tree-structured memory module and an XPath-style query language. • By using a tree structure, Semantic XPath efficiently organizes and accesses conversational memory. • The XPath-style query language, combined with semantic matching techniques, achieves precise memory retrieval.
Methodology
- �� Use a tree structure to organize conversational memory, with nodes representing units of conversational state. • Employ an XPath-style query language to retrieve relevant substructures. • Combine semantic matching techniques to ensure retrieval accuracy and relevance.
Experiments
The experimental design includes testing the performance of Semantic XPath across multiple conversational tasks. GPT-5 mini and Gemini-3 flash are used as LLM backbones, and comparisons are made with in-context memory and flat RAG methods. Evaluation metrics include pass rate and token usage.
Results
Experimental results show that Semantic XPath significantly outperforms flat RAG baselines in performance, particularly in tasks requiring complex memory structures. Its token usage is only 9.1% of that required by in-context memory methods.
Applications
Semantic XPath is suitable for conversational AI systems requiring long-term memory management, such as travel itinerary planning and to-do list management. Its efficient memory access can significantly improve system response speed and accuracy.
Limitations & Outlook
Despite its excellent performance, Semantic XPath may face challenges when handling extremely complex memory structures. The system's semantic matching accuracy depends on the capabilities of the underlying model, and future research can further optimize its performance.
Plain Language Accessible to non-experts
Imagine a library where Semantic XPath acts like a smart librarian. Traditional methods are like bringing all the books to you every time, while Semantic XPath quickly finds the relevant books based on your needs and only brings out the parts you need. This approach saves time and reduces unnecessary effort.
ELI14 Explained like you're 14
Hey, buddy! Imagine you're playing a game and need to remember lots of tasks. Traditional methods are like writing all the tasks on a sheet and reading them from start to finish every time. Semantic XPath is like a super helper that categorizes tasks and quickly finds the information you need. This way, you can complete tasks faster and win the game!
Glossary
Semantic XPath
A method combining XPath query language and semantic matching for conversational memory access.
Used for efficient retrieval and updating of conversational memory.
RAG (Retrieval-Augmented Generation)
A method that enhances generative models by retrieving relevant information.
Baseline method compared with Semantic XPath.
Tree Structure
A hierarchical structure for organizing information, with nodes representing different levels of information.
Used to organize conversational memory.
Token
A basic unit in natural language processing, usually a word or character.
Metric for evaluating memory method efficiency.
Semantic Matching
A method for determining information relevance by calculating semantic similarity.
Used to improve Semantic XPath retrieval accuracy.
Open Questions Unanswered questions from this research
- 1 How to maintain high performance in extremely complex memory structures?
- 2 How to further improve the accuracy of semantic matching?
Applications
Immediate Applications
Travel Planning
Semantic XPath can be used to optimize travel itinerary planning, quickly retrieving and updating itinerary information.
Long-term Vision
Smart Assistants
Semantic XPath has the potential to become a core technology for smart assistants, significantly improving the efficiency and accuracy of dialogue systems.
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.