AgenticRAG-based customer service multi-agent collaborative question and answer method and system

By employing AgenticRAG's multi-agent collaborative question-answering method, leveraging a multi-agent architecture and a large language model, the system optimizes prompt word recognition for user intent and key entity extraction. Combined with this architecture, it optimizes prompt words for deep retrieval and logical reasoning, generating personalized responses. This addresses the problems of strong rule dependence, weak semantic understanding, lack of context and dynamic interaction capabilities, and insufficient logical coherence in existing intelligent question-answering systems. Furthermore, it optimizes the adaptability and semantic coherence of existing intelligent question-answering systems, enhancing their adaptability and semantic understanding capabilities, and achieving logical coherence in multi-turn dialogues.

CN121031771APending Publication Date: 2025-11-28FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510927026.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems suffer from problems such as strong rule dependence, weak semantic understanding, lack of context and dynamic interaction capabilities, and insufficient logical coherence when faced with complex, ever-changing, and diverse user needs. As a result, they are unable to adapt to diverse user inputs and provide personalized services.

Method used

We adopt a multi-agent collaborative question-answering method for customer service based on AgenticRAG. By querying and analyzing agent-optimized prompts, and combining multi-source retrieval and answer generation modules, we perform in-depth retrieval and logical reasoning to generate personalized responses and conduct quality and security assessments.

Benefits of technology

It improves the adaptability, semantic understanding depth, and multi-turn dialogue logic coherence of the question-answering system, enhances the accuracy of responses to complex questions and user experience, and supports multimodal output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031771A_ABST
    Figure CN121031771A_ABST
Patent Text Reader

Abstract

The invention provides an AgenticRAG-based customer service multi-agent collaborative question-answering method and system in the technical field of artificial intelligence and natural language processing. The method comprises the following steps: S1, inputting a query statement into a Prompt template to obtain an initial cue word; s2, optimizing the initial cue word through a query and analysis Agent to obtain an enhanced cue word, performing query intention recognition and key entity extraction based on the enhanced cue word, and performing query complexity recognition based on the query intention and the key entity; s3, based on the query complexity, inputting the query intention and the key entity into a retrieval module to obtain retrieval data; s4, an answer generation module performs logical reasoning on the retrieval data, the enhanced cue words and the business rules based on the user portrait to generate reply answers; and S5, the answer evaluation module performs quality evaluation and safety evaluation on the reply answers and then outputs the reply answers. The method has the advantages that the adaptability of questions and answers, the semantic understanding depth and the logic continuity of multiple rounds of dialogues are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and natural language processing, and particularly discloses a customer service multi-agent collaborative question and answer method and system based on AgenticRAG. BACKGROUND

[0002] In recent years, thanks to the rapid development of artificial intelligence, natural language processing and large language model technology, intelligent question and answer systems (or intelligent customer service systems) have become increasingly important in modern enterprise customer service systems. Currently, the industry's intelligent question and answer systems mainly rely on rule-based methods or traditional machine learning classification methods for user intent recognition and reply generation. However, such traditional methods have significant technical limitations when faced with complex and varied user demands and diverse expressions:

[0003] 1. Strong rule dependency, difficult to extend and maintain: Its core technology relies on pre-set pattern matching or classification algorithms; although a large number of syntax rules and dialogue processes can be manually prepared by experts to achieve high accuracy in specific closed scenarios, this method is complex to build, costly to maintain, and has poor scalability, making it difficult for the system to effectively adapt and understand diverse user inputs beyond the pre-set rule framework.

[0004] 2. Weak semantic understanding: The common approach is to extract keywords and match them with a pre-set knowledge base, which is relatively simple to implement, but the semantic understanding is very limited, and the sensitivity to synonym replacement, expression sentence variation, negation and other language phenomena is low, which can easily lead to incorrect intent recognition or irrelevant search results.

[0005] 3. Lack of context and dynamic interaction ability: Even if early machine learning classifiers such as support vector machines (SVM) and naive Bayes are applied for intent recognition or question and answer matching, although they have better generalization ability than pure rule-based methods, their performance still highly depends on the quality of feature engineering; more importantly, such methods generally lack the ability to continuously model the context of multi-round dialogue, and cannot make dynamic interactive decisions.

[0006] 4. Inherent defects of traditional RAG system: The RAG-based system also has several key deficiencies: a. Insufficient intent coverage: A single retrieval module is difficult to effectively analyze and cover complex or ambiguous user intent, especially for implicit intent and context-dependent problems (such as reference, omission), and the retrieval results are likely to deviate from the user's true needs; b. Poor logical coherence: Traditional generation models lack autonomous planning and decision-making capabilities for task flow, resulting in insufficient logical coherence and lack of coherence between generated responses and multi-round dialogues; c. Lack of knowledge updating and personalization: The system usually retrieves based on a static knowledge base, lacks effective mechanisms for dynamic updating of knowledge, scenario-based adaptation, and personalized responses based on user profiles, severely limiting the system's generalization performance and user experience.

[0007] Therefore, how to provide a customer service multi-agent collaborative question answering method and system based on AgenticRAG to improve the adaptability, semantic understanding depth, and multi-round dialogue logical coherence of question answering has become a technical problem to be solved. SUMMARY

[0008] The technical problem to be solved by the present application is to provide a customer service multi-agent collaborative question answering method and system based on AgenticRAG to improve the adaptability, semantic understanding depth, and multi-round dialogue logical coherence of question answering.

[0009] In a first aspect, the present application provides a customer service multi-agent collaborative question answering method based on AgenticRAG, comprising the following steps:

[0010] Step S1, obtaining a query sentence input by a user, inputting the query sentence into a preset Prompt template to obtain corresponding initial prompt words;

[0011] Step S2, optimizing each initial prompt word through a query and analysis Agent to obtain enhanced prompt words, performing query intent recognition and key entity extraction based on the enhanced prompt words, and performing query complexity recognition based on the query intent and key entity;

[0012] Step S3, based on the query complexity, inputting the query intent and key entity into a retrieval module for deep retrieval to obtain retrieval data and inputting the retrieval data into an answer generation module; the retrieval module includes a retrieval routing Agent, a relational database retrieval Agent, a vector database retrieval Agent, a Web retrieval Agent, and an API interface retrieval Agent;

[0013] Step S4, the answer generation module matches the user portrait based on the historical dialogue record, logically infers the retrieval data, the enhanced prompt word and the business rule based on the user portrait, generates a reply answer and inputs the answer evaluation module;

[0014] Step S5, the answer evaluation module outputs the reply answer after quality evaluation and security evaluation of the reply answer.

[0015] Further, the step S1 is specifically:

[0016] The text format or voice format query statement input by the user is obtained, when the query statement is in voice format, the query statement is converted into text format through a pre-trained ASR large model;

[0017] The query statement is input into a preset Prompt template to obtain a corresponding initial prompt word.

[0018] Further, the step S2 is specifically:

[0019] The query and analysis agent optimizes each initial prompt word at least including keyword strengthening and instruction refinement to obtain an enhanced prompt word, calls a pre-trained large language model, performs query intent recognition and key entity extraction on the query statement based on the enhanced prompt word, and performs query complexity recognition based on the query intent and the key entity; the query complexity is simple query or complex query.

[0020] Further, the step S3 is specifically:

[0021] The query complexity is analyzed, when the query complexity is simple query, the query and analysis agent directly generates a reply answer based on the query intent and outputs;

[0022] When the query complexity is complex query, the query and analysis agent inputs the query intent and the key entity into a retrieval module for deep retrieval to obtain retrieval data and input the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a Web retrieval agent and an API interface retrieval agent.

[0023] Further, the step S4 is specifically:

[0024] The answer generation module associates historical dialogue records based on the user ID, extracts user preferences and identity features based on the historical dialogue records, matches the user portrait based on the user preferences and identity features, logically infers the retrieval data, the enhanced prompt word and the business rule based on the user portrait, generates a complete reply answer and inputs the answer evaluation module.

[0025] In a second aspect, the application provides an AgenticRAG-based customer multi-agent collaborative question and answer system, comprising the following modules:

[0026] A query statement input module is configured to obtain a query statement input by a user, input the query statement into a preset Prompt template, and obtain an initial prompt word corresponding to the query statement;

[0027] A prompt word generation module is configured to optimize each initial prompt word by querying and analyzing an agent, obtain an enhanced prompt word, perform query intent recognition and key entity extraction based on the enhanced prompt word, and perform query complexity recognition based on the query intent and the key entity;

[0028] A deep retrieval module is configured to input the query intent and the key entity into a retrieval module based on the query complexity, perform deep retrieval, obtain retrieval data, and input the retrieval data into an answer generation module; the retrieval module comprises a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a Web retrieval agent, and an API interface retrieval agent;

[0029] A reply answer generation module is configured to associate the answer generation module with historical dialogue records and match a user portrait, perform logical reasoning on retrieval data, enhanced prompt words, and business rules based on the user portrait, generate a reply answer, and input the reply answer into an answer evaluation module;

[0030] A reply answer output module is configured to output the reply answer after the answer evaluation module performs quality evaluation and safety evaluation on the reply answer.

[0031] Further, the query statement input module is specifically configured to:

[0032] obtain a query statement in a text format or a voice format input by a user, and convert the query statement into a text format by using a pre-trained ASR large model when the query statement is in a voice format;

[0033] input the query statement into a preset Prompt template to obtain an initial prompt word corresponding to the query statement.

[0034] Further, the prompt word generation module is specifically configured to:

[0035] The query and analysis agent optimizes each initial prompt word by at least including keyword reinforcement and instruction refinement through query and analysis, obtains an enhanced prompt word, calls a pre-trained large language model, performs query intent recognition and key entity extraction on a query sentence based on the enhanced prompt word, and performs query complexity recognition based on the query intent and key entity; the query complexity is a simple query or a complex query.

[0036] Further, the deep retrieval module is specifically used for:

[0037] When the query complexity is a simple query, the query and analysis agent directly generates a reply answer based on the query intent and outputs the reply answer;

[0038] When the query complexity is a complex query, the query and analysis agent inputs the query intent and key entity into the retrieval module for deep retrieval, obtains retrieval data, and inputs the retrieval data into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a Web retrieval agent, and an API interface retrieval agent.

[0039] Further, the reply answer generation module is specifically used for:

[0040] The answer generation module associates historical dialogue records based on a user ID, extracts user preferences and identity features based on the historical dialogue records, matches a user portrait based on the user preferences and identity features, performs logical reasoning on retrieval data, enhanced prompt words, and business rules based on the user portrait, and generates a complete reply answer and inputs the reply answer into the answer evaluation module.

[0041] The application has the following advantages:

[0042] 1. By acquiring the user's query, the query is input into a preset Prompt template to obtain corresponding initial prompts. The query and analysis agent optimizes these initial prompts to obtain enhanced prompts. Based on these enhanced prompts, query intent is identified and key entities are extracted. Query complexity is then identified based on the query intent and key entities. Next, based on the query complexity, the query intent and key entities are input into the retrieval module for deep retrieval to obtain retrieval data. The answer generation module correlates historical dialogue records with user profiles, and performs logical reasoning based on the user profiles, retrieval data, enhanced prompts, and business rules to generate a response answer. Finally, the answer evaluation module evaluates the quality and security of the response answer before outputting the response answer. Integrating the intelligent agent architecture and large language model capabilities, the query and analysis agent first... The system enhances semantic parsing capabilities through dynamic optimization of prompts, accurately identifying user intent and key entities in diverse expressions. It also intelligently schedules multi-source retrieval modules (retrieval routing agent, relational database retrieval agent, vector database retrieval agent, web retrieval agent, and API interface retrieval agent) based on query complexity, ensuring a deep understanding and dynamic knowledge coverage of complex fuzzy queries. Secondly, the answer generation module connects user history to build personalized profiles and uses business rules to logically reason about search results, ensuring responses are both semantically coherent and adaptable to different user scenarios. Finally, the answer evaluation module forms a quality and security closed loop, achieving accurate responses to complex open-domain questions and maintaining a natural dialogue flow. Ultimately, this significantly improves the adaptability of question answering, the depth of semantic understanding, and the logical coherence of multi-turn dialogues.

[0043] 2. This invention possesses capabilities in task planning, autonomous decision-making, and multi-module collaboration. Based on the query and analysis agent, it can analyze the query complexity of a query statement. When the query complexity is determined to be simple, the query and analysis agent directly responds, improving the response speed. Using a multi-agent collaboration approach, the query routing agent decomposes and allocates tasks for the query statement, and then specialized query agents (relational database retrieval agent, vector database retrieval agent, web retrieval agent, and API interface retrieval agent) query knowledge from different professional areas. Multiple agents can collaborate and provide feedback for optimization, forming a highly flexible and scalable intelligent service system. Leveraging large language models and multimodal perception technology, it can more accurately parse the meaning of query statements and identify complex query intentions. Each specialized agent module has a clear division of labor and efficient collaboration, interacting with vector databases, relational databases, web pages, and APIs, and possessing advanced capabilities such as task decomposition, path planning, and dynamic adjustment.

[0044] 3. The vector database retrieval agent uses a hybrid semantic and keyword-based retrieval method to retrieve data. The retrieved data is then re-ranked using a re-rank model, and the reciprocal fusion ranking algorithm is used to merge the re-ranked content, improving retrieval recall. The evaluation agent assesses the quality and security of the responses; if the assessment results meet expectations, the responses are output; otherwise, a new retrieval is performed, improving the accuracy and security of the responses. In addition to supporting text output, it can automatically determine whether to output images, videos, charts, etc., based on user intent, enhancing the richness and intuitiveness of information expression.

[0045] 4. Traditional intelligent question-answering systems rely on keyword matching or rule engines for intent recognition and answer generation. When faced with complex sentences, ambiguous questions, or multi-turn contextual questions, they are prone to misunderstandings or inaccurate answers. This invention introduces a large language model and a multi-agent architecture, which has stronger semantic understanding and intent recognition capabilities. It can more accurately parse user input and make inferences based on historical dialogue records, thereby improving the accuracy and relevance of the response.

[0046] 5. Traditional intelligent question-answering systems lack the ability to autonomously plan and make decisions on task processes, resulting in mechanical and illogical dialogue. The multiple functional agents of this invention can work together to simulate the thinking and execution process of human customer service representatives, realize task decomposition, path planning and feedback optimization, and improve the intelligence level and interactive coherence of the system.

[0047] 6. Traditional intelligent question-answering systems typically use static knowledge bases, which cannot be updated in real time or adapt to new questions, affecting service quality. This invention integrates a dynamic knowledge retrieval mechanism to ensure that information can be obtained from the latest data sources, and combines user profiles and behavioral characteristics to provide personalized services, thereby enhancing adaptability and generalization capabilities.

[0048] 7. Traditional intelligent question-answering systems lack effective evaluation of the quality of output results. The evaluation module of this invention, based on the evaluation agent, can effectively evaluate the quality and security of the response and continuously iterate and optimize, thereby improving the quality and security of the response content.

[0049] 8. Traditional intelligent question-answering systems mainly use text output, which has a single way of expressing information and limited user experience. This invention supports multimodal output and automatically determines whether to use text, images, audio and video or other forms of auxiliary display according to the user's intent, thereby improving the efficiency of information transmission and user satisfaction. Attached Figure Description

[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0051] Fig. 1 This is a flowchart of a multi-agent collaborative question-answering method for customer service based on AgenticRAG, according to the present invention.

[0052] Fig. 2 This is a schematic diagram of the structure of a customer service multi-agent collaborative question-answering system based on AgenticRAG according to the present invention. Detailed Implementation

[0053] The technical solution in this application embodiment follows the following general approach: First, the query and analysis agent enhances semantic parsing capabilities by dynamically optimizing prompts, accurately identifying user intent and key entities in diverse expressions, and intelligently scheduling multi-source retrieval modules based on query complexity to ensure deep understanding and dynamic knowledge coverage of complex fuzzy queries. Second, the answer generation module constructs personalized profiles by associating with users' historical dialogues, and performs logical reasoning on the retrieval results in conjunction with business rules, ensuring that responses are both consistent with contextual semantic coherence and adaptable to the needs of different users in various scenarios. Finally, the answer evaluation module forms a quality and security closed loop, achieving accurate responses to complex open-domain questions and maintaining a natural dialogue flow, thereby improving the adaptability of question answering, the depth of semantic understanding, and the logical coherence of multi-turn dialogues.

[0054] Please refer to Figs. 1-2 As shown, a preferred embodiment of the AgenticRAG-based multi-agent collaborative question-answering method for customer service of the present invention includes the following steps:

[0055] Step S1: Obtain the query statement input by the user, and input the query statement into the preset Prompt template to obtain the corresponding initial prompt words;

[0056] Step S2: Optimize each of the initial prompt words by querying and analyzing the Agent to obtain enhanced prompt words, identify query intent and extract key entities based on the enhanced prompt words, and identify query complexity based on the query intent and key entities;

[0057] Step S3: Based on the query complexity, input the query intent and key entities into the retrieval module for deep retrieval, obtain the retrieval data, and input it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent;

[0058] Step S4: The answer generation module associates historical dialogue records with user profiles, performs logical reasoning on the search data, enhanced prompts, and business rules based on the user profiles, generates a reply answer, and inputs it into the answer evaluation module.

[0059] Step S5: After the answer evaluation module performs a quality evaluation and a security evaluation on the response answer, it outputs the response answer.

[0060] The evaluation process of the answer evaluation module is as follows: a) Extract structured data from the responses, including keywords, entities, and intents, to provide a basis for subsequent evaluation; b) Evaluate the responses based on the evaluation agent, including quality evaluation and security evaluation. The quality evaluation covers multiple dimensions such as accuracy, relevance, coherence, and diversity, while the security evaluation identifies potential violations, such as sensitive words; c) Obtain quality and security evaluation scores based on the quality and security evaluations. If the quality or security of the response does not meet expectations, the retrieval and generation process is automatically triggered. The retrieval module's retrieval routing agent rewrites and optimizes the query and performs a re-retrieval to optimize the output quality until the requirements are met; d) Multimodal information matching and auxiliary generation determine whether auxiliary expressions such as text, images, videos, and charts are needed based on user intent. For example, when introducing product features, text and images can be combined.

[0061] This invention introduces a multi-agent mechanism, combining knowledge retrieval, semantic understanding, intent recognition, and multi-turn dialogue management to achieve accurate understanding and intelligent response to queries. First, it receives queries input by the user via text or voice. Then, based on a query and analysis agent, it identifies the query intent, extracts key entities, and assesses query complexity. If the query complexity is determined to be simple, the query and analysis agent directly provides a response; otherwise, the multi-functional agent (retrieval module) within the AgenticRag architecture works collaboratively to retrieve relevant information (retrieval data) from large-scale structured and unstructured data sources, and integrates historical dialogue records to generate an accurate and logical response. An answer evaluation module assesses the quality and security of the response. If the evaluated answer meets expectations, it is output; otherwise, based on the evaluation results, the multi-functional agent is used to optimize and rewrite the query, and relevant data is retrieved again to further enhance the response. Finally, this invention supports multi-modal output, determining whether to use images, videos, charts, or other multi-modal formats for supplementary expression based on the user's intent, thereby improving user experience and service efficiency.

[0062] Step S1 specifically involves:

[0063] The system obtains a query statement in text or voice format input by the user. When the query statement is in voice format, it converts the query statement into text format using a pre-trained ASR large model.

[0064] Input the query statement into the preset Prompt template to obtain the corresponding initial prompt words.

[0065] Step S2 specifically involves:

[0066] The Agent optimizes each initial prompt word by querying and analyzing it, including at least keyword enhancement and instruction refinement, to obtain enhanced prompt words. A pre-trained large language model is then invoked to identify the query intent and extract key entities based on the enhanced prompt words. The query complexity is then identified based on the query intent and key entities, whereby the query complexity is either a simple query or a complex query.

[0067] Poor quality initial prompts, vague wording, lack of contextual guidance, or unclear objectives can lead to generated content that deviates from expectations. Optimizing initial prompts based on query and analysis agents can more clearly define the task objectives.

[0068] Step S3 specifically involves:

[0069] The query complexity is analyzed. When the query complexity is a simple query, the query and analysis agent directly generates a response answer based on the query intent and outputs it. The query and analysis agent includes the ability to call tools such as LLM and commonly used knowledge bases.

[0070] When the query complexity is complex, the query and analysis agent inputs the query intent and key entities into the retrieval module for deep retrieval, obtains the retrieval data, and inputs it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent.

[0071] When the query complexity is complex, multi-stage knowledge retrieval and reasoning are performed, where the intent includes product consultation, order inquiry, after-sales service, etc.

[0072] When the query complexity is complex, the retrieval routing agent breaks down the task process into several sub-tasks according to the query intent; for example, for the question of "how to return goods", it may be necessary to execute multiple steps such as "verify order status", "obtain return policy" and "provide operation guidance" in sequence.

[0073] Next, the knowledge source and retrieval strategy are initialized, supporting multiple knowledge sources, including structured databases, vector databases, web resources, and API interfaces. The retrieval routing agent selects the appropriate specialized retrieval agent based on the current query. Each agent has its own memory system and workflow, including tool usage, reflection, and planning capabilities, thereby enabling dynamic collaborative problem-solving.

[0074] The relational database retrieval agent interacts with relational databases and retrieves structured data, such as order status and historical query history. The vector database retrieval agent uses an embedding semantic model to convert query and text vectors into embedding vectors. Based on a hybrid retrieval of semantic and keyword data using embedding vectors, it retrieves query-related information from the vector database. A rerank model is used to reorder the content retrieved based on semantics and keywords, and then a mutual ranking fusion (RRF) algorithm is used to combine the results of semantic and keyword retrieval. The vector database stores data such as product images, browsing history, and product documents. The web retrieval agent searches the company's official website for the latest product specifications and industry news that may affect product development and sales. The API interface retrieval agent interacts with corresponding API interfaces to obtain information such as the current product delivery status, product repair progress, and customer satisfaction from logistics and after-sales service APIs. In this hybrid retrieval, semantic retrieval is based on a BERT pre-trained model, and keyword retrieval is based on the BM25 retrieval algorithm. The RRF formula is:

[0075]

[0076] Where D represents a document; n represents the number of search result lists, such as BM25 and vector search results; rank ' i (D) represents the rank of document D in the i-th search result list after reranking; k is a constant used to smooth the ranking, with a default value of 60.

[0077] Step S4 specifically involves:

[0078] The answer generation module associates historical dialogue records with user IDs, extracts user preferences and identity features based on the historical dialogue records, matches user profiles based on user preferences and identity features, and performs logical reasoning on the retrieved data, enhanced prompts, and business rules (or common sense knowledge) based on the user profiles to generate complete response answers and input them into the answer evaluation module.

[0079] A preferred embodiment of the AgenticRAG-based customer service multi-agent collaborative question-answering system of the present invention includes the following modules:

[0080] The query input module is used to obtain the query input by the user and input the query into a preset Prompt template to obtain the corresponding initial prompt words;

[0081] The prompt word generation module is used to optimize each of the initial prompt words by querying and analyzing the Agent to obtain enhanced prompt words, perform query intent identification and key entity extraction based on the enhanced prompt words, and perform query complexity identification based on the query intent and key entities.

[0082] The deep search module is used to perform deep search based on the query complexity, inputting the query intent and key entities into the search module to obtain search data and input it into the answer generation module; the search module includes a search routing agent, a relational database search agent, a vector database search agent, a web search agent, and an API interface search agent;

[0083] The response answer generation module is used by the response generation module to associate historical dialogue records with user profiles, perform logical reasoning on the retrieved data, enhanced prompts, and business rules based on the user profiles, generate response answers, and input them into the response evaluation module.

[0084] The response answer output module is used by the response evaluation module to perform quality and security assessments on the response answer and then output the response answer.

[0085] The evaluation process of the answer evaluation module is as follows: a) Extract structured data from the responses, including keywords, entities, and intents, to provide a basis for subsequent evaluation; b) Evaluate the responses based on the evaluation agent, including quality evaluation and security evaluation. The quality evaluation covers multiple dimensions such as accuracy, relevance, coherence, and diversity, while the security evaluation identifies potential violations, such as sensitive words; c) Obtain quality and security evaluation scores based on the quality and security evaluations. If the quality or security of the response does not meet expectations, the retrieval and generation process is automatically triggered. The retrieval module's retrieval routing agent rewrites and optimizes the query and performs a re-retrieval to optimize the output quality until the requirements are met; d) Multimodal information matching and auxiliary generation determine whether auxiliary expressions such as text, images, videos, and charts are needed based on user intent. For example, when introducing product features, text and images can be combined.

[0086] This invention introduces a multi-agent mechanism, combining knowledge retrieval, semantic understanding, intent recognition, and multi-turn dialogue management to achieve accurate understanding and intelligent response to queries. First, it receives queries input by the user via text or voice. Then, based on a query and analysis agent, it identifies the query intent, extracts key entities, and assesses query complexity. If the query complexity is determined to be simple, the query and analysis agent directly provides a response; otherwise, the multi-functional agent (retrieval module) within the AgenticRag architecture works collaboratively to retrieve relevant information (retrieval data) from large-scale structured and unstructured data sources, and integrates historical dialogue records to generate an accurate and logical response. An answer evaluation module assesses the quality and security of the response. If the evaluated answer meets expectations, it is output; otherwise, based on the evaluation results, the multi-functional agent is used to optimize and rewrite the query, and relevant data is retrieved again to further enhance the response. Finally, this invention supports multi-modal output, determining whether to use images, videos, charts, or other multi-modal formats for supplementary expression based on the user's intent, thereby improving user experience and service efficiency.

[0087] The query input module is specifically used for:

[0088] The system obtains a query statement in text or voice format input by the user. When the query statement is in voice format, it converts the query statement into text format using a pre-trained ASR large model.

[0089] Input the query statement into the preset Prompt template to obtain the corresponding initial prompt words.

[0090] The prompt word generation module is specifically used for:

[0091] The Agent optimizes each initial prompt word by querying and analyzing it, including at least keyword enhancement and instruction refinement, to obtain enhanced prompt words. A pre-trained large language model is then invoked to identify the query intent and extract key entities based on the enhanced prompt words. The query complexity is then identified based on the query intent and key entities, whereby the query complexity is either a simple query or a complex query.

[0092] Poor quality initial prompts, vague wording, lack of contextual guidance, or unclear objectives can lead to generated content that deviates from expectations. Optimizing initial prompts based on query and analysis agents can more clearly define the task objectives.

[0093] The deep search module is specifically used for:

[0094] The query complexity is analyzed. When the query complexity is a simple query, the query and analysis agent directly generates and outputs a response based on the query intent.

[0095] When the query complexity is complex, the query and analysis agent inputs the query intent and key entities into the retrieval module for deep retrieval, obtains the retrieval data, and inputs it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent.

[0096] When the query complexity is complex, multi-stage knowledge retrieval and reasoning are performed, where the intent includes product consultation, order inquiry, after-sales service, etc.

[0097] When the query complexity is complex, the retrieval routing agent breaks down the task process into several sub-tasks according to the query intent; for example, for the question of "how to return goods", it may be necessary to execute multiple steps such as "verify order status", "obtain return policy" and "provide operation guidance" in sequence.

[0098] Next, the knowledge source and retrieval strategy are initialized, supporting multiple knowledge sources, including structured databases, vector databases, web resources, and API interfaces. The retrieval routing agent selects the appropriate specialized retrieval agent based on the current query. Each agent has its own memory system and workflow, including tool usage, reflection, and planning capabilities, thereby enabling dynamic collaborative problem-solving.

[0099] The relational database retrieval agent interacts with relational databases and retrieves structured data, such as order status and historical query history. The vector database retrieval agent uses an embedding semantic model to convert query and text vectors into embedding vectors. Based on a hybrid retrieval of semantic and keyword data using embedding vectors, it retrieves query-related information from the vector database. A rerank model is used to reorder the content retrieved based on semantics and keywords, and then a mutual ranking fusion (RRF) algorithm is used to combine the results of semantic and keyword retrieval. The vector database stores data such as product images, browsing history, and product documents. The web retrieval agent searches the company's official website for the latest product specifications and industry news that may affect product development and sales. The API interface retrieval agent interacts with corresponding API interfaces to obtain information such as the current product delivery status, product repair progress, and customer satisfaction from logistics and after-sales service APIs. In this hybrid retrieval, semantic retrieval is based on a BERT pre-trained model, and keyword retrieval is based on the BM25 retrieval algorithm. The RRF formula is:

[0100]

[0101] Where D represents a document; n represents the number of search result lists, such as BM25 and vector search results; rank ' i (D) represents the rank of document D in the i-th search result list after reranking; k is a constant used to smooth the ranking, with a default value of 60.

[0102] The response generation module is specifically used for:

[0103] The answer generation module associates historical dialogue records with user IDs, extracts user preferences and identity features based on the historical dialogue records, matches user profiles based on user preferences and identity features, and performs logical reasoning on the retrieved data, enhanced prompts, and business rules (or common sense knowledge) based on the user profiles to generate complete response answers and input them into the answer evaluation module.

[0104] In summary, the advantages of this invention are as follows:

[0105] 1. By acquiring the user's query, the query is input into a preset Prompt template to obtain corresponding initial prompts. The query and analysis agent optimizes these initial prompts to obtain enhanced prompts. Based on these enhanced prompts, query intent is identified and key entities are extracted. Query complexity is then identified based on the query intent and key entities. Next, based on the query complexity, the query intent and key entities are input into the retrieval module for deep retrieval to obtain retrieval data. The answer generation module correlates historical dialogue records with user profiles, and performs logical reasoning based on the user profiles, retrieval data, enhanced prompts, and business rules to generate a response answer. Finally, the answer evaluation module evaluates the quality and security of the response answer before outputting the response answer. Integrating the intelligent agent architecture and large language model capabilities, the query and analysis agent first... The system enhances semantic parsing capabilities through dynamic optimization of prompts, accurately identifying user intent and key entities in diverse expressions. It also intelligently schedules multi-source retrieval modules (retrieval routing agent, relational database retrieval agent, vector database retrieval agent, web retrieval agent, and API interface retrieval agent) based on query complexity, ensuring a deep understanding and dynamic knowledge coverage of complex fuzzy queries. Secondly, the answer generation module connects user history to build personalized profiles and uses business rules to logically reason about search results, ensuring responses are both semantically coherent and adaptable to different user scenarios. Finally, the answer evaluation module forms a quality and security closed loop, achieving accurate responses to complex open-domain questions and maintaining a natural dialogue flow. Ultimately, this significantly improves the adaptability of question answering, the depth of semantic understanding, and the logical coherence of multi-turn dialogues.

[0106] 2. This invention possesses capabilities in task planning, autonomous decision-making, and multi-module collaboration. Based on the query and analysis agent, it can analyze the query complexity of a query statement. When the query complexity is determined to be simple, the query and analysis agent directly responds, improving the response speed. Using a multi-agent collaboration approach, the query routing agent decomposes and allocates tasks for the query statement, and then specialized query agents (relational database retrieval agent, vector database retrieval agent, web retrieval agent, and API interface retrieval agent) query knowledge from different professional areas. Multiple agents can collaborate and provide feedback for optimization, forming a highly flexible and scalable intelligent service system. Leveraging large language models and multimodal perception technology, it can more accurately parse the meaning of query statements and identify complex query intentions. Each specialized agent module has a clear division of labor and efficient collaboration, interacting with vector databases, relational databases, web pages, and APIs, and possessing advanced capabilities such as task decomposition, path planning, and dynamic adjustment.

[0107] 3. The vector database retrieval agent uses a hybrid semantic and keyword-based retrieval method to retrieve data. The retrieved data is then re-ranked using a re-rank model, and the reciprocal fusion ranking algorithm is used to merge the re-ranked content, improving retrieval recall. The evaluation agent assesses the quality and security of the responses; if the assessment results meet expectations, the responses are output; otherwise, a new retrieval is performed, improving the accuracy and security of the responses. In addition to supporting text output, it can automatically determine whether to output images, videos, charts, etc., based on user intent, enhancing the richness and intuitiveness of information expression.

[0108] 4. Traditional intelligent question-answering systems rely on keyword matching or rule engines for intent recognition and answer generation. When faced with complex sentences, ambiguous questions, or multi-turn contextual questions, they are prone to misunderstandings or inaccurate answers. This invention introduces a large language model and a multi-agent architecture, which has stronger semantic understanding and intent recognition capabilities. It can more accurately parse user input and make inferences based on historical dialogue records, thereby improving the accuracy and relevance of the response.

[0109] 5. Traditional intelligent question-answering systems lack the ability to autonomously plan and make decisions on task processes, resulting in mechanical and illogical dialogue. The multiple functional agents of this invention can work together to simulate the thinking and execution process of human customer service representatives, realize task decomposition, path planning and feedback optimization, and improve the intelligence level and interactive coherence of the system.

[0110] 6. Traditional intelligent question-answering systems typically use static knowledge bases, which cannot be updated in real time or adapt to new questions, affecting service quality. This invention integrates a dynamic knowledge retrieval mechanism to ensure that information can be obtained from the latest data sources, and combines user profiles and behavioral characteristics to provide personalized services, thereby enhancing adaptability and generalization capabilities.

[0111] 7. Traditional intelligent question-answering systems lack effective evaluation of the quality of output results. The evaluation module of this invention, based on the evaluation agent, can effectively evaluate the quality and security of the response and continuously iterate and optimize, thereby improving the quality and security of the response content.

[0112] 8. Traditional intelligent question-answering systems mainly use text output, which has a single way of expressing information and limited user experience. This invention supports multimodal output and automatically determines whether to use text, images, audio and video or other forms of auxiliary display according to the user's intent, thereby improving the efficiency of information transmission and user satisfaction.

[0113] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A multi-agent collaborative question-answering method for customer service based on AgenticRAG, characterized in that: Includes the following steps: Step S1: Obtain the query statement input by the user, and input the query statement into the preset Prompt template to obtain the corresponding initial prompt words; Step S2: Optimize each of the initial prompt words by querying and analyzing the Agent to obtain enhanced prompt words, identify query intent and extract key entities based on the enhanced prompt words, and identify query complexity based on the query intent and key entities; Step S3: Based on the query complexity, input the query intent and key entities into the retrieval module for deep retrieval, obtain the retrieval data, and input it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent; Step S4: The answer generation module associates historical dialogue records with user profiles, performs logical reasoning on the search data, enhanced prompts, and business rules based on the user profiles, generates a reply answer, and inputs it into the answer evaluation module. Step S5: After the answer evaluation module performs a quality evaluation and a security evaluation on the response answer, it outputs the response answer.

2. The multi-agent collaborative question-answering method for customer service based on AgenticRAG as described in claim 1, characterized in that: Step S1 specifically involves: The system obtains a query statement in text or voice format input by the user. When the query statement is in voice format, it converts the query statement into text format using a pre-trained ASR large model. Input the query statement into the preset Prompt template to obtain the corresponding initial prompt words.

3. The multi-agent collaborative question-answering method for customer service based on AgenticRAG as described in claim 1, characterized in that: Step S2 specifically involves: By querying and analyzing the Agent, each of the initial prompt words is optimized by at least keyword enhancement and instruction refinement to obtain enhanced prompt words. A pre-trained large language model is called to identify the query intent and extract key entities based on the enhanced prompt words. Query complexity is identified based on the query intent and key entities. The query complexity is either simple or complex.

4. The multi-agent collaborative question-answering method for customer service based on AgenticRAG as described in claim 1, characterized in that: Step S3 specifically involves: The query complexity is analyzed. When the query complexity is a simple query, the query and analysis agent directly generates and outputs a response based on the query intent. When the query complexity is complex, the query and analysis agent inputs the query intent and key entities into the retrieval module for deep retrieval, obtains the retrieval data, and inputs it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent.

5. The multi-agent collaborative question-answering method for customer service based on AgenticRAG as described in claim 1, characterized in that: Step S4 specifically involves: The answer generation module associates historical dialogue records with user IDs, extracts user preferences and identity features based on these records, matches user profiles based on these preferences and features, and performs logical reasoning on the retrieved data, enhanced prompts, and business rules based on these profiles to generate a complete response and input it into the answer evaluation module.

6. A customer service multi-agent collaborative question-answering system based on AgenticRAG, characterized in that: Includes the following modules: The query input module is used to obtain the query input by the user and input the query into a preset Prompt template to obtain the corresponding initial prompt words; The prompt word generation module is used to optimize each of the initial prompt words by querying and analyzing the Agent to obtain enhanced prompt words, perform query intent identification and key entity extraction based on the enhanced prompt words, and perform query complexity identification based on the query intent and key entities. The deep search module is used to perform deep search based on the query complexity, inputting the query intent and key entities into the search module to obtain search data and input it into the answer generation module; the search module includes a search routing agent, a relational database search agent, a vector database search agent, a web search agent, and an API interface search agent; The response answer generation module is used by the response generation module to associate historical dialogue records with user profiles, perform logical reasoning on the retrieved data, enhanced prompts, and business rules based on the user profiles, generate response answers, and input them into the response evaluation module. The response answer output module is used by the response evaluation module to perform quality and security assessments on the response answer and then output the response answer.

7. The customer service multi-agent collaborative question-answering system based on AgenticRAG as described in claim 6, characterized in that: The query input module is specifically used for: The system obtains a query statement in text or voice format input by the user. When the query statement is in voice format, it converts the query statement into text format using a pre-trained ASR large model. Input the query statement into the preset Prompt template to obtain the corresponding initial prompt words.

8. The customer service multi-agent collaborative question-answering system based on AgenticRAG as described in claim 6, characterized in that: The prompt word generation module is specifically used for: By querying and analyzing the Agent, each of the initial prompt words is optimized by at least keyword enhancement and instruction refinement to obtain enhanced prompt words. A pre-trained large language model is called to identify the query intent and extract key entities based on the enhanced prompt words. Query complexity is identified based on the query intent and key entities. The query complexity is either simple or complex.

9. A customer service multi-agent collaborative question-answering system based on AgenticRAG as described in claim 6, characterized in that: The deep search module is specifically used for: The query complexity is analyzed. When the query complexity is a simple query, the query and analysis agent directly generates and outputs a response based on the query intent. When the query complexity is complex, the query and analysis agent inputs the query intent and key entities into the retrieval module for deep retrieval, obtains the retrieval data, and inputs it into the answer generation module; the retrieval module includes a retrieval routing agent, a relational database retrieval agent, a vector database retrieval agent, a web retrieval agent, and an API interface retrieval agent.

10. A customer service multi-agent collaborative question-answering system based on AgenticRAG as described in claim 6, characterized in that: The response generation module is specifically used for: The answer generation module associates historical dialogue records with user IDs, extracts user preferences and identity features based on these records, matches user profiles based on these preferences and features, and performs logical reasoning on the retrieved data, enhanced prompts, and business rules based on these profiles to generate a complete response and input it into the answer evaluation module.

Citation Information

Cited By

  • General text intelligent retrieval method and system based on rule analysis

    CN121210649A

  • Enterprise-level intelligent scheduling agent system, method, medium, terminal and program product

    CN121835727A

  • Map association question-answering system and question-answering method based on multiple agents

    CN122086960A