DSRAG : A Double-Stream Retrieval-Augmented Generation Framework for Countless Intent Detection (2025)

Abstract: Current intent detection work experiments with minor intent categories. However, in real-world scenarios of data analysis dialogue systems, intents are composed of combinations of numerous metrics and dimensions, resulting in countless intents and posing challenges for the language model. The retrieval-augmented generation (RAG) method efficiently retrieves key intents. However, the single retrieval route sometimes fails to recall target intents and causes incorrect results. To alleviate the above challenges, we introduce the DSRAG framework combining query-to-query (Q2Q) and query-to-metadata (Q2M) double-stream RAG approaches. Specifically, we build a repository of query statements for Q2Q using the query templates with the key intents. When a user’s query comes, it rapidly matches repository statements. Once the relevant query is retrieved, the results can be quickly returned. In contrast, Q2M retrieves the relevant intents from the metadata and utilizes large language models to choose the answer. Experimental results show that DSRAG achieves significant improvements compared with merely using prompt engineering and a single retrieval route.

## introduction large language models (llms) @xcite @xcite have significantly transformed the landscape of natural language processing tasks. with their robust understanding and generation capabilities, task-oriented data analysis dialogue systems have garnered widespread attention. these systems can intelligently assist data analysts (defined as users) in inquiring, analyzing, and visualizing data. one crucial aspect of these systems is intent detection @xcite @xcite , identifying which of a fixed set of actions to take based on the user's queries. current intent detection work typically experiments with minor intent categories (e.g., clinc @xcite datasets with 150 intents, banking @xcite with 77 intents). however, in the scenario of data analysis dialogue systems, an intent consists of the metrics and dimensions that the user wishes to analyze. for example, as shown in figure 1 , we need to detect the metric daily active user and the dimension gender from the metadata based on the user's query (more descriptions of metadata, metric, and dimension are shown in section 3.1). the application has numerous metrics, each with multiple dimensions, resulting in countless combinations. therefore, traditional classification methods @xcite are inapplicable. besides, detecting the intent from countless combinations of metrics and dimensions will create a significant challenge for the model because of the limitation of long text modeling and input length. to alleviate this challenge, we introduce the rag @xcite ) method to retrieve key intents from the extensive pool, thereby filtering out the irrelevant intents and reducing the complexity of the problem. however, for each query, employing a single retrieval route to directly retrieve the information from the metadata that stores numerous metrics and dimensions, sometimes can't recall the target intents, causes incorrect results, and impacts user experience. to further improve the accuracy of intent detection, we propose the comprehensive double-stream rag (dsrag) framework that integrates two retrieval approaches, namely query to query (q2q) and query to metadata (q2m). 1) q2q: we create a series of query templates and infill different structured metadata to build a query statement repository that simulates potential user queries. when the user's query comes, q2q rapidly matches it with repository statements. once the most similar query statement is retrieved, there is no need to execute q2m, which significantly decreases response time and error feedback probability. 2) q2m: we employ common retrieval methods, including indexing, re-rank, etc. to obtain relevant metrics and dimensions from metadata. after that, we innovatively propose two approaches based on closed and open sourced llms to select the most relevant metrics and dimensions. to validate the effectiveness of dsrag, we conduct experiments based on real online user queries. the results show that dsrag significantly improves accuracy from 24.7% to 78.7% compared with directly using gpt-3.5-turbo to choose the correct intents, and from 58.7% to 78.7% and 82.7% to 90.3% compared to a single retrieval route with gpt3.5-turbo and fine-tuned open-sourced llms. our contributions are listed below: ## conclusion in this paper, we outline the challenges of current intent detection methods. specifically, in data analysis dialogue systems, intents are formed by combining various metrics and dimensions, resulting in countless intents and posing challenges for current works. besides, although employing rag approaches is effective in retrieving key intents, sometimes it can't recall the target intent. therefore, to further improve the accuracy of intent detection, we have developed the dsrag framework, which uses a double-stream retrieval strategy. when the query comes, q2q are implements to look for a similar query in the library of query statements constructed by the key metrics and dimensions with the query templates. if it doesn't find a relevant query, q2m is employed to retrieve the relevant metrics and dimensions from metadata. the experiments on real user queries confirm that q2q can address a large portion of the queries with high accuracy and low latency. additionally, the dsrag shows sig-nificant improvements compared to merely using prompt engineering and rag methods.