Conversation record question and answer method and system based on thinking chain and agent reflection mechanism

By introducing technical means of thinking chains and agent reflection mechanisms in the voice call Q&A system, the existing system has solved the problem of insufficient accuracy and adaptability when dealing with complex and unstructured data, and achieved higher quality intelligent Q&A services.

CN120104761AInactive Publication Date: 2025-06-06ZHEJIANG UNIV

Patent Information

Application Number
CN202510570834.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-06-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing voice call Q&A systems are not accurate and adaptable when dealing with long text, complex queries, and unstructured call data, making it difficult to deeply understand user intentions, and perform poorly when dealing with problems with strong cross-topics, multiple rounds of conversations, and strong contextual correlations.

Method used

The dialogue record question-and-answer method based on the thinking chain and the agent reflection mechanism is adopted, and structured call records are generated through the voice call transcription and topic summary model. The search conditions and questions to be answered are extracted from user input based on the thinking chain prompt word short sample learning. The natural language generation code technology is used to generate SQL statements, and the search results are optimized through the agent reflection mechanism, and finally the answers are generated in combination with the search enhancement generation technology.

Benefits of technology

It improves the accuracy and adaptability of call record Q&A, can understand user intentions more deeply, effectively deal with complex and unstructured query tasks, and provides high-quality intelligent Q&A services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104761A_ABST
    Figure CN120104761A_ABST
Patent Text Reader

Abstract

The invention discloses a dialogue record question and answer method and system based on a thinking chain and an intelligent agent reflection mechanism. The method comprises the following steps: transcribing a voice call into a text through an automatic voice recognition (ASR) technology, and extracting a retrieval condition and a question to be answered from user input based on a thinking chain cue word; and then, generating an SQL statement by using a natural language, retrieving a target dialogue record from a local database, and optimizing a retrieval result through an agent reflection mechanism so as to ensure the query accuracy. Finally, answers are generated in combination with a retrieval enhancement generation (RAG) technology, and high-quality intelligent question and answer services are provided for the user. According to the invention, the voice technology and the language model are deeply coordinated, so that efficient and accurate intelligent question and answer service can be provided for users in scenes such as enterprise management, customer service and intelligent cabins.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of speech recognition, and in particular relates to a conversation recording question-answering method and system based on a thought chain and an intelligent agent reflection mechanism. Background Art

[0002] In recent years, with the rapid development of artificial intelligence (AI) technology, natural language processing (NLP) and automatic speech recognition (ASR) technologies have been increasingly used in intelligent question-answering systems. In scenarios such as enterprise management, customer service, and smart cockpits, users have a growing demand for interacting with systems through voice. However, current voice call question-answering systems still face many challenges, such as the accuracy of information retrieval, the reasoning ability of dialogue logic, and adaptability in complex business scenarios.

[0003] Traditional voice question-and-answer systems usually rely on keyword matching or rule-based retrieval methods, but these methods perform poorly when processing long texts, complex queries, and unstructured call data. Due to the informal expression, colloquialism, and high redundant information of call content, directly retrieving and generating answers based on traditional methods often cannot meet the requirements of high accuracy and high availability. In addition, existing question-and-answer systems lack a deep understanding of user intent and are difficult to handle cross-topic, multi-round conversations, and questions with strong contextual associations.

[0004] In recent years, Chain of Thought (CoT) reasoning technology and AI optimization methods based on agent reflection mechanisms have demonstrated superior reasoning capabilities in complex task processing. Chain of Thought reasoning can break down complex problems into multiple reasoning steps by simulating the human thinking process, thereby improving the model's performance on complex reasoning tasks. The agent reflection mechanism allows the model to self-check when answering questions and correct incorrect results to achieve higher accuracy and robustness. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that it is difficult to accurately implement call record question and answer in the prior art, and to provide a conversation record question and answer method and system based on thought chain and intelligent agent reflection mechanism.

[0006] The specific technical solutions adopted by the present invention are as follows: In a first aspect, the present invention provides a conversation record question-answering method based on thought chain and agent reflection mechanism, which comprises: S1. Using voice call transcription technology, transcribe each call into a text call record containing the call contact, timestamp, and call content text, and use a topic summary model to extract topic keywords from the call content text, and store the text call record and topic keywords in the form of structured call records in a database; S2. Convert the voice query question input by the user into a text query question through voice recognition technology, and extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query question based on the few-sample learning of the thought chain prompt words; S3, using natural language code generation technology to generate SQL statements from the natural language description text of the search condition, and retrieving all structured call records that meet the search condition from the local database as search results; S4, the text query question, the natural language description text of the search condition, the SQL statement, and the search result are combined into a multi-tuple describing the search link, and the multi-tuple is input into the reflection mechanism agent constructed based on the large language model to check whether the call record search result is qualified. If it is unqualified, the correction action for one or more links in the search link is output and the correction is performed and then re-checked until the test conclusion is qualified; S5. Input the retrieval results that are qualified and the corresponding questions to be answered into the question-answering agent built based on the large language model, generate answers in combination with the retrieval enhancement generation technology and return them to the user.

[0007] As a preferred embodiment of the first aspect, the topic summarization model is based on a large language model and is obtained by fine-tuning using call record data.

[0008] As a preferred embodiment of the above first aspect, the database adopts a locally stored relational database MySQL.

[0009] As a preferred embodiment of the first aspect above, when extracting the text query question based on a few-sample learning of thought chain prompt words, a plurality of exemplary samples simulating the human reasoning process are pre-constructed, each exemplary sample includes a text query question, a reasoning process and a reasoning result, the reasoning result includes a natural language description text of the retrieval condition extracted from the text query question and the question to be answered, and the exemplary sample is combined with the prompt word template; when the text query question to be extracted is obtained through speech recognition technology, it is combined with the placeholder of the prompt word template and input into the large language model to guide the large language model to extract the natural language description text of the retrieval condition and the question to be answered therefrom.

[0010] As a preferred embodiment of the above-mentioned first aspect, the input prompt word template of the reflection mechanism intelligent agent includes a task description, a reasoning description and an execution action; the task description is to check whether the retrieval link composed of a text query question, a natural language description text of the retrieval conditions, an SQL statement, and a retrieval result in the input multi-tuple is correct; the reasoning description is to stipulate that the large language model needs to display the basis and the intermediate reasoning process while giving the test conclusion; the execution action is to correct the output of one or more links in the retrieval link in order to obtain the correct retrieval link when the test conclusion is unqualified.

[0011] As a preferred embodiment of the above-mentioned first aspect, the input prompt word template of the question-answering agent adopts a retrieval enhanced generation prompt word template.

[0012] In a second aspect, the present invention provides a conversation record question-answering system based on thought chain and agent reflection mechanism, which comprises: A call record structuring module is used to transcribe each call into a text call record containing the call contact, timestamp, and call content text by using a voice call transcription technology, and to extract topic keywords from the call content text by using a topic summary model, and to store the text call record and topic keywords in the form of a structured call record in a database; A query deconstruction module is used to convert the voice query input by the user into a text query through voice recognition technology, and extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query based on the few-sample learning of the thought chain prompt words; A call record retrieval module, used to generate SQL statements from the natural language description text of the search condition using natural language code generation technology, and retrieve all structured call records that meet the search condition from the local database as search results; A retrieval link correction module is used to combine the text query question, the natural language description text of the retrieval condition, the SQL statement, and the retrieval result into a tuple describing the retrieval link, and input it into a reflection mechanism agent built based on a large language model to check whether the call record retrieval result is qualified. If it is unqualified, it outputs a correction action for one or more links in the retrieval link and performs a re-inspection after the correction until the inspection conclusion is qualified; The question-answering agent module is used to input the retrieval results with qualified inspection conclusions and the corresponding questions to be answered into the question-answering agent built based on the large language model, generate answers in combination with the retrieval enhancement generation technology and return them to the user.

[0013] In a third aspect, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the conversation recording and question-answering method based on the thought chain and intelligent agent reflection mechanism as described in any one of the schemes of the first aspect above.

[0014] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for recording and answering conversations based on a thought chain and an intelligent agent reflection mechanism as described in any one of the schemes of the first aspect above can be implemented.

[0015] In a fifth aspect, the present invention provides a computer electronic device comprising a memory and a processor; The memory is used to store computer programs; The processor is used to implement the conversation recording and question-answering method based on the thought chain and intelligent agent reflection mechanism as described in any one of the solutions of the first aspect when executing the computer program.

[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention transcribes voice calls into text through automatic speech recognition (ASR) technology, and extracts search conditions and questions to be answered from user input based on thought chain prompts; then, it generates SQL statements using natural language to retrieve target call records from the local database, and optimizes search results through the agent reflection mechanism to ensure the accuracy of the query. Finally, it combines the retrieval enhancement generation (RAG) technology to generate answers, providing users with high-quality intelligent question-answering services.

[0017] The present invention deeply collaborates with speech technology and language models, extracts natural language descriptions of call record retrieval conditions and questions to be answered from user input through thought chain prompts, and automatically verifies and optimizes retrieval results using an intelligent agent reflection mechanism to ensure accurate retrieval results, allowing users to complete accurate retrieval and query of call records in a natural language dialogue. Therefore, the present invention can be applied to scenarios such as enterprise management, customer service, and smart cockpits, providing users with efficient and accurate intelligent question-and-answer services. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of the steps of the question-answering method for recording dialogues based on thought chains and agent reflection mechanisms; Figure 2 is a schematic diagram of the retrieval link; Figure 3 A schematic diagram of an agent iteratively correcting a retrieval link based on a reflection mechanism; Figure 4 This is a schematic diagram of the overall implementation process of call record question and answer; Figure 5 This is a schematic diagram of the module composition of the dialogue record question-answering system based on the thought chain and agent reflection mechanism; Figure 6 It is a schematic diagram of the structure of computer electronic equipment. DETAILED DESCRIPTION

[0019] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.

[0020] The present invention provides a conversation record question-answering method based on thought chain and intelligent agent reflection mechanism. The method transcribes voice calls into text through automatic speech recognition (ASR) technology, and extracts retrieval conditions and questions to be answered from user input based on thought chain prompt words. Subsequently, SQL statements are generated using natural language to retrieve target call records from a local database, and the retrieval results are optimized through the intelligent agent reflection mechanism to ensure the accuracy of the query. Finally, answers are generated in combination with retrieval enhancement generation (RAG) technology to provide users with high-quality intelligent question-answering services. The specific implementation of this method is described in detail below.

[0021] like Figure 1 As shown, in a preferred embodiment of the present invention, it includes the following steps S1 to S5. The specific steps of each step are as follows: S1. Each voice call is transcribed into a text call record containing the call contact, timestamp, and call content text by using voice call transcription technology, and topic summarization model is used to extract topic keywords from the call content text, and the text call record and topic keywords are stored in the database in the form of structured call records.

[0022] It should be noted that the voice call transcription technology can be implemented using existing technology solutions. In addition, the role of the topic summary model is to understand the text of the call content and extract multiple keywords from it as topic keywords. The topic summary model can be fine-tuned based on the large language model using call record data.

[0023] It should be noted that structured call records can theoretically be stored in a cloud database or a local database. However, in order to ensure data privacy and storage security, it is preferred to store structured call records in a local database. In the embodiment of the present invention, in the above step S1, the specific process of processing a call voice into a structured call record is as follows: S11: convert the voice stream into a common audio format file, such as WAV or MP3, and save it to local storage.

[0024] S12: The above audio format files are converted into text call records through background noise reduction, voice activity detection (VAD), automatic speech recognition (ASR), speaker diarization, contact matching, and timestamp alignment operations. The text call records contain information such as call contacts, timestamps, and call content text, and record the speech content of different speakers at different times in text form.

[0025] S13: Using the topic summarization model fine-tuned by the conversation data, summarize the topics of the call records into several keywords.

[0026] S14: Combining the call records and topic keywords, forming structured data, and storing it in the local relational database MySQL. The fields of the structured data include the call start time, call end time, contact person, call content text with timestamp, and topic keywords.

[0027] S2. The voice query question input by the user is converted into a text query question through voice recognition technology, and based on the thinking chain prompt word few-sample learning, the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered are extracted from the text query question.

[0028] It should be noted that the voice query questions in the present invention refer to questions about call record queries input by users through voice, and the voice data needs to be converted into text form through voice recognition technology. However, the questions input by users are often expressed in natural language, and are prone to problems such as unclear expressions and non-standard terms, and are not suitable as query questions directly. Therefore, the present invention needs to first extract search conditions from the original questions input by the user and generate standardized questions to be answered. This process is achieved through the thinking chain prompt word few-sample learning of the large language model.

[0029] It should be noted that the thought chain prompt word few-shot learning is a machine learning method that combines the contextual learning ability of a large language model with structured reasoning guidance. Its core is thought chain (CoT) and few-shot learning (FSL). Thought chain needs to embed step-by-step reasoning logic in the prompt words to guide the model to imitate the human thinking process of solving problems step by step, while few-shot learning only needs to set multiple example samples. Through the prompt word design, the model can quickly adapt to new tasks and reduce the dependence on labeled data.

[0030] The above-mentioned thought chain prompt word few-sample learning is achieved by designing the prompt word structure. Specifically, in the present invention, when extracting the text query question based on the thought chain prompt word few-sample learning, a plurality of exemplary samples simulating the human reasoning process are pre-constructed, each exemplary sample includes a text query question, a reasoning process (i.e., thought chain) and a reasoning result, and the reasoning result includes a natural language description text of the retrieval condition extracted from the text query question and the question to be answered, and the exemplary sample is combined into the prompt word template.

[0031] Based on the above-mentioned prompt word template with exemplary samples, when the text query question to be extracted is obtained through speech recognition technology, it is combined with the placeholder of the prompt word template and input into the large language model to guide the large language model to extract the natural language description text and the question to be answered from the retrieval conditions.

[0032] In the embodiment of the present invention, in the above step S2, for a voice query question input by a user, the specific process of obtaining the natural language description text of the search condition and the corresponding question to be answered is as follows: S21: Combining the user's voice input and converting it into text through automatic speech recognition ASR technology to obtain a text query question; S22: Construct the exemplary samples and prompt word templates required for the few-sample learning based on the thought chain prompt words. When constructing the exemplary samples, it is necessary to simulate the reasoning process of humans inferring the natural language description of the retrieval conditions and the questions to be answered from the user input, thereby constructing several exemplary samples according to the reasoning process. Add the constructed exemplary samples to the prompt word template, and set the placeholder of the text query question to be extracted in the prompt word template, and describe the extraction task as extracting the standard natural language description of the retrieval conditions and the standardized questions to be answered from the text query question to be extracted.

[0033] S23: The text query question to be extracted obtained in S21 is combined with the placeholder of the prompt word template, and then the complete text of the prompt word is input into the large language model. The small sample learning of the large model is used to imitate the reasoning process in the exemplary template to extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query question.

[0034] Thus, through the above step S2, the query question input by the user can be converted into accurate search conditions and questions to be answered. However, the search conditions at this time are natural language description texts, not SQL statements that can actually be used for database search, so further conversion is required.

[0035] S3. Using natural language code generation technology, the natural language description text of the search condition is used to generate an SQL statement, and all structured call records that meet the search condition are retrieved from the local database as search results.

[0036] It should be noted that the natural language code generation technology in the present invention belongs to the prior art, and is used to convert the search conditions from the natural language description text into actual SQL statements, so as to retrieve all structured call records that meet the search conditions from a series of structured call records stored in the local database. Such technology can be implemented by directly calling existing models or tools. Available natural language code generation models include CodeGeeX 2.0, DeepSeek, OmniSQL, STRUG, SQLCoder, DuckDB-NSQL-7B, Vanna, etc. Available natural language code generation tools include rookie_text2data, Tianchi NL2SQL, etc., which can be selected according to actual needs and are not limited to this.

[0037] In an embodiment of the present invention, the specific implementation of the above step S3 is as follows: S31: using the natural language code generation model CodeGeeX 2.0 to convert the natural language description of the search conditions into SQL statements; S32: Using the converted SQL statement, structured call records that meet the conditions are retrieved from a series of structured call records stored in the local database. These structured call records are used as retrieval results for subsequent verification.

[0038] In order to better understand the specific implementation of the present invention, a text call record (hereinafter referred to as text call record A) is given below with "{" and "}" as the start mark and end mark: {Manager Zhang: Hello, Xiao Li, this is Manager Zhang. How are your preparations for next week's business trip going? Assistant Li: Hello, Manager Zhang! I have already booked a flight to Shanghai at 2:00 pm on Monday according to your request. I have also booked a hotel in a five-star hotel near the client's company. In addition, the meeting is scheduled for 10:00 am on Tuesday, which has been confirmed by the client.

[0039] Manager Zhang: Very good, thank you for your hard work. What about the meeting materials? How are the preparations going? Assistant Li: The materials are ready. The PPT and the draft contract have been sent to your email. You can take a look at them when you have time. If there are any changes that need to be made, I will adjust them at any time.

[0040] Manager Zhang: OK, I'll take a look later. By the way, I may need to stay one more day on this business trip. The client may arrange a dinner party. Can you help me confirm whether the schedule on Wednesday can be adjusted?

[0041] Assistant Li: No problem. I'll contact the airline right away to see if I can change my flight. The hotel can also extend my stay for one night. I'll confirm and let you know as soon as possible.

[0042] Manager Zhang: OK, thank you for your hard work. Also, remember to bring samples of the company's latest products. Customers may want to see the real thing.

[0043] Assistant Li: I see. The samples are ready and I will take them with me. In addition, I have arranged a pick-up service and the driver will be waiting for you at the airport.

[0044] Manager Zhang: Very good, very thoughtful. That's it for now. If you have any questions, feel free to contact me.

[0045] Assistant Li: OK, Manager Zhang, don't worry, I will follow up at any time. Have a nice weekend! Manager Zhang: Thank you, you too. Goodbye.

[0046] Assistant Li: Goodbye, Manager Zhang.} Based on the above text call record A, the topic keywords extracted from it using the topic summarization model are: business trip arrangements, flight reservations, conference materials, itinerary adjustments, and airport pick-up services. The text call record and topic keywords are stored in the database in the form of structured call records. The values ​​of its structured fields are as follows:

[0047] Based on the above text call record A, the voice query question input by the user is converted into a text query question: When will Manager Zhang go on a business trip next week? How are the flights and hotels arranged? Therefore, based on the few-sample learning of thought chain prompt words, an exemplary thought chain is: the user wants to know the specific business trip time, flight and hotel arrangements of Manager Zhang. In order to retrieve the corresponding call records, it can be judged from the user's intention that the contact or call content in the call record should contain "Manager Zhang". Therefore, the natural language description of the search condition is: "Find call records whose contacts or call contents contain 'Manager Zhang' and the topic keyword contains 'business trip arrangements'", and the question to be answered is: "What are the specific arrangements for Manager Zhang's business trip time, flight and hotel next week?"

[0048] The corresponding SQL statements generated are as follows: SELECT * FROM call records WHERE (Contact 1 = 'Manager Zhang' OR Contact 2 = 'Manager Zhang' OR Call content LIKE '%Manager Zhang%') AND Topic keywords LIKE '%Business trip arrangements%'; S4. The text query question, the natural language description text of the search condition, the SQL statement, and the search result are combined into a multi-tuple describing the search link, and input into a reflective mechanism agent constructed based on a large language model to check whether the call record search result is qualified. If it is unqualified, corrective actions for one or more links in the search link are output and re-inspected after correction until the inspection conclusion is qualified.

[0049] It should be noted that if Figure 2 As shown, the multi-tuple in the present invention is actually composed of the results obtained from each link in the above S1~S3, which describes the step-by-step generation process from the original question input by the user to the final search result. Since each link in the multi-tuple describing the search link is generated by different models and tools, it cannot be guaranteed that the entire search link is completely accurate, so it is necessary to verify whether each link in the search link and the search results finally obtained are qualified. The verification process is performed by a large language model. Specifically, a reflection mechanism agent can be constructed using a large language model, and the multi-tuple describing the search link is input into the reflection mechanism agent. The reflection mechanism agent is driven by prompt words to check the previous and next links in the search link and the search results finally obtained. If a problem occurs, it is necessary to reflect on which link has a problem and how to improve it, and then generate a corrective action. Therefore, in the present invention, it is necessary to design a prompt word template to drive the reflection mechanism agent.

[0050] In an embodiment of the present invention, the prompt word template driving the reflection mechanism agent includes a task description, a reasoning description and an execution action. The task description is to check whether the retrieval link composed of the text query question, the natural language description text of the retrieval condition, the SQL statement and the retrieval result in the input multi-tuple is correct. The reasoning description stipulates that the large language model needs to display the basis and the intermediate reasoning process while giving the test conclusion. The execution action is: when the test conclusion is unqualified, in order to obtain the correct retrieval link, it is necessary to correct the output of one or more links in the retrieval link.

[0051] It should be noted that the above-mentioned execution action needs to be output only when the inspection conclusion is unqualified. When the inspection conclusion is qualified, there is no need to output the correction action, and it is only necessary to output the inspection conclusion that the inspection conclusion is qualified. There is at least one correction action, or there can be multiple correction actions, which can be determined by the large language model. There may be problems with the text query problems, the natural language description text of the search conditions, and the SQL statements in the retrieval link. For text query problems, the query questions entered by the user may not be clear enough and additional information needs to be provided. For the natural language description text of the search conditions, there may be incorrect extraction of the corresponding natural language description text of the search conditions. For SQL statements, there may be syntax errors in the SQL statements or natural language description texts that do not meet the search conditions.

[0052] The reflection and correction process of the reflection mechanism agent needs to be iterated continuously until a qualified retrieval link is finally obtained. Figure 3 As shown, the iterative correction process is as follows: S41: Input the latest multi-tuple describing the retrieval link into the pre-built prompt word template of the driving reflection mechanism agent, and then input it into the reflection mechanism agent, and use the ability of the large language model to check whether the retrieval link and the final retrieval result are qualified. If qualified, the iteration is terminated directly. If not qualified, it is necessary to reflect on which link has problems and how to improve it, and then generate correction actions for each link with problems; S42: executing the correction action output by the agent to form a new search link, and then obtaining an updated text query question, a natural language description of the search condition, an SQL statement or a search result according to the new search link; S43: The updated text query question, the natural language description text of the search conditions, the SQL statement, and the search results are combined into a multi-tuple, which is input into the pre-built prompt word template of the driving reflection mechanism agent, and then input into the reflection mechanism agent for re-inspection, and repeated until the agent determines that the search link is qualified.

[0053] Similarly, taking the above text call record A as an example, if the reflective mechanism agent finds that there are multiple call records with Manager Zhang in the search results that meet the conditions, but the corresponding call times are different, it is judged that the query question information entered by the user is insufficient, and the user needs to be prompted to enter more search condition information. At this time, the corresponding output correction action is: find multiple call records with Manager Zhang, and require the user to provide more search conditions to make the search conditions unique. From this, the reflective mechanism agent further initiates human-computer interaction and requires the user to enter more search conditions to narrow the search scope. If the user further enters: "Find the call records with Manager Zhang this morning." Then the updated SQL can be obtained: SELECT * FROM call records WHERE (Contact 1 = 'Manager Zhang' OR Contact 2 = 'Manager Zhang' OR Call content LIKE '%Manager Zhang%') AND Topic keywords LIKE '%Business trip arrangements%' AND Call start time >= CURDATE() AND Call start time <DATE_ADD(CURDATE(), INTERVAL 12 HOUR); Similarly, for other situations, such as situations where the SQL statement may contain SQL statement syntax errors or natural language description text that does not meet the search conditions, it is necessary to re-output the action to adjust the SQL statement and output the correct SQL statement.

[0054] Finally, when the agent determines that the call records in the retrieval results of the new multi-tuple are relevant to the user's query and correct, the inspection conclusion can be considered qualified, and the subsequent steps can be executed.

[0055] S5. Input the retrieval results that are qualified and the corresponding questions to be answered into the question-answering agent built based on the large language model, combine the Retrieval Augmented Generation (RAG) technology to generate answers and return them to the user.

[0056] It should be noted that the above-mentioned retrieval enhancement generation technology belongs to the prior art, which combines language models and information retrieval technology. Specifically, when the model needs to generate text or answer questions, it will first retrieve relevant information from the retrieved object, and then use the retrieved information to guide the generation of text, thereby improving the quality and accuracy of the prediction. In the present invention, a large language model can be used as a responsive question-answering agent, and the large language model can be driven to output answers by constructing a corresponding RAG prompt word template. The RAG prompt word template may include a task definition, an answer guide, and a constraint, wherein the task definition describes that the task that the large language model needs to perform is to retrieve the answer to the question to be answered from the retrieval results containing one or more structured call records, and the answer guide and constraints describe the requirements that need to be met to answer the question and the format of the output answer.

[0057] Similarly, taking the above text call record A as an example, the ‌RAG prompt word template can be set as: Find relevant information from [Search Results] and answer [Questions to be answered]. If the [Search Results] filled in the above template is structured call record A, and [Questions to be answered] is the specific arrangements for Manager Zhang's business trip next week, flights and hotels. Then the question-answering agent will output the answer as: Manager Zhang will leave at 2 pm next Monday, take a flight to Shanghai, and stay in a five-star hotel near the client company.

[0058] Therefore, the conversation record question-and-answer method based on the thought chain and agent reflection mechanism described in S1~S5 above adopts ASR technology to translate the call voice, intelligently analyzes the user input through the thought chain prompt technology, and accurately extracts the key search elements and core issues. Based on natural language processing, structured SQL instructions are generated to quickly locate the target call records from the local database. At the same time, the preliminary search results are multi-dimensionally verified and semantically optimized through the agent reflection mechanism, which effectively improves the data precision. Finally, relying on RAG technology, the deep collaboration between the knowledge base and the language model is realized, and accurate and reliable problem solutions are output. This call record question-and-answer method can be used to provide users with efficient and accurate intelligent question-and-answer services in scenarios such as enterprise management, customer service, and smart cockpits.

[0059] It should be noted that the answer finally returned to the user can be in the form of text or voice. Since the user input is in the form of voice, it is preferred to convert the answer text into a voice file and play it on the human-computer interaction device.

[0060] It should be noted that the method steps shown in S1 to S5 above are implemented as follows: Figure 4 As shown, each step can essentially be implemented in the form of a computer program.

[0061] Therefore, based on the same inventive concept, a conversation record question-answering system based on thought chain and intelligent agent reflection mechanism is also provided. Figure 5 As shown, the system includes: A call record structuring module is used to transcribe each call into a text call record containing the call contact, timestamp, and call content text by using a voice call transcription technology, and to extract topic keywords from the call content text by using a topic summary model, and to store the text call record and topic keywords in the form of a structured call record in a database; A query deconstruction module is used to convert the voice query input by the user into a text query through voice recognition technology, and extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query based on the few-sample learning of the thought chain prompt words; A call record retrieval module, used to generate SQL statements from the natural language description text of the search condition using natural language code generation technology, and retrieve all structured call records that meet the search condition from the local database as search results; A retrieval link correction module is used to combine the text query question, the natural language description text of the retrieval condition, the SQL statement, and the retrieval result into a tuple describing the retrieval link, and input it into a reflection mechanism agent built based on a large language model to check whether the call record retrieval result is qualified. If it is unqualified, it outputs a correction action for one or more links in the retrieval link and performs a re-inspection after the correction until the inspection conclusion is qualified; The question-answering agent module is used to input the retrieval results with qualified inspection conclusions and the corresponding questions to be answered into the question-answering agent built based on the large language model, generate answers in combination with the retrieval enhancement generation technology and return them to the user.

[0062] Therefore, based on the same inventive concept, Figure 6 As shown, the present invention also provides a computer electronic device corresponding to the conversation record question-answering method based on thought chain and intelligent agent reflection mechanism provided in the above embodiment, which includes a memory and a processor; The memory is used to store computer programs; The processor is used to implement the conversation record question-answering method based on the thought chain and agent reflection mechanism as described above when executing the computer program; In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0063] Therefore, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to a conversation recording and question-answering method based on thought chain and intelligent agent reflection mechanism, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it can implement the conversation recording and question-answering method based on thought chain and intelligent agent reflection mechanism as described above.

[0064] Therefore, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the dialogue recording and question-answering method based on the thought chain and intelligent agent reflection mechanism as described above.

[0065] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by the processor to perform the above steps S1 to S5.

[0066] It is understandable that the above storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. The storage medium may also be a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc., which can store program codes.

[0067] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0068] It should also be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0069] The above-described embodiments are only some preferred implementations of the present invention, but are not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A conversation record question-answering method based on thought chain and agent reflection mechanism, characterized in that: include: S1. Using voice call transcription technology, transcribe each call into a text call record containing the call contact, timestamp, and call content text, and use a topic summary model to extract topic keywords from the call content text, and store the text call record and topic keywords in the form of structured call records in a database; S2. Convert the voice query question input by the user into a text query question through voice recognition technology, and extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query question based on the few-sample learning of the thought chain prompt words; S3, using natural language code generation technology to generate SQL statements from the natural language description text of the search condition, and retrieving all structured call records that meet the search condition from the local database as search results; S4, the text query question, the natural language description text of the search condition, the SQL statement, and the search result are combined into a multi-tuple describing the search link, and the multi-tuple is input into the reflection mechanism agent constructed based on the large language model to check whether the call record search result is qualified. If it is unqualified, the correction action for one or more links in the search link is output and the correction is performed and then re-checked until the test conclusion is qualified; S5. Input the retrieval results that are qualified and the corresponding questions to be answered into the question-answering agent built based on the large language model, generate answers in combination with the retrieval enhancement generation technology and return them to the user.

2. The conversation record question-answering method based on thought chain and agent reflection mechanism as claimed in claim 1, characterized in that: The topic summarization model is based on a large language model and is fine-tuned using call record data.

3. The conversation record question-answering method based on thought chain and agent reflection mechanism as claimed in claim 1, characterized in that: The database adopts the locally stored relational database MySQL.

4. The conversation record question-answering method based on thought chain and agent reflection mechanism as claimed in claim 1, characterized in that: When extracting the text query question based on the few-sample learning of the thought chain prompt words, a plurality of exemplary samples simulating the human reasoning process are pre-constructed, each exemplary sample includes a text query question, a reasoning process and a reasoning result, and the reasoning result includes a natural language description text of the retrieval condition extracted from the text query question and the question to be answered, and the exemplary sample is combined into the prompt word template; When the text query question to be extracted is obtained through speech recognition technology, it is combined with the placeholder of the prompt word template and input into the large language model to guide the large language model to extract the natural language description text and the question to be answered from the retrieval condition.

5. The conversation record question-answering method based on thought chain and agent reflection mechanism as claimed in claim 1, characterized in that: The input prompt word template of the reflection mechanism intelligent agent includes a task description, a reasoning description and an execution action; the task description is to check whether the retrieval link composed of the text query question, the natural language description text of the retrieval condition, the SQL statement and the retrieval result in the input multi-tuple is correct; the reasoning description is to stipulate that the large language model needs to display the basis and the intermediate reasoning process while giving the inspection conclusion; the execution action is to correct the output of one or more links in the retrieval link in order to obtain the correct retrieval link when the inspection conclusion is unqualified.

6. The conversation record question-answering method based on thought chain and agent reflection mechanism as claimed in claim 1, characterized in that: The question-answering agent uses a retrieval-enhanced generation prompt word template in the input prompt word template.

7. A conversation record question-answering system based on thought chain and agent reflection mechanism, characterized in that: include: A call record structuring module is used to transcribe each call into a text call record containing the call contact, timestamp, and call content text by using a voice call transcription technology, and to extract topic keywords from the call content text by using a topic summary model, and to store the text call record and topic keywords in the form of a structured call record in a database; A query deconstruction module is used to convert the voice query input by the user into a text query through voice recognition technology, and extract the natural language description text of the search conditions required for searching the call records and the corresponding questions to be answered from the text query based on the few-sample learning of the thought chain prompt words; A call record retrieval module, used to generate SQL statements from the natural language description text of the search condition using natural language code generation technology, and retrieve all structured call records that meet the search condition from the local database as search results; A retrieval link correction module is used to combine the text query question, the natural language description text of the retrieval condition, the SQL statement, and the retrieval result into a tuple describing the retrieval link, and input it into a reflection mechanism agent built based on a large language model to check whether the call record retrieval result is qualified. If it is unqualified, it outputs a correction action for one or more links in the retrieval link and performs a re-inspection after the correction until the inspection conclusion is qualified; The question-answering agent module is used to input the retrieval results with qualified inspection conclusions and the corresponding questions to be answered into the question-answering agent built based on the large language model, generate answers in combination with the retrieval enhancement generation technology and return them to the user.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, it can implement the conversation record question-answering method based on the thought chain and intelligent agent reflection mechanism as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the conversation recording and question-answering method based on the thought chain and intelligent agent reflection mechanism as described in any one of claims 1 to 6 is implemented.

10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the conversation record question-answering method based on the thought chain and intelligent agent reflection mechanism as described in any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Call content backtracking method and device, electronic equipment and storage medium

    CN115118810A

  • Intelligent question and answer method and device, computer equipment and program product

    CN118820436A

  • Intelligent SQL query generation method and system based on large language model

    CN118861081A

  • Database AI question answering system and method based on large language model and retrieval enhancement

    CN118981522A

  • Method for generating answers to questions based on large language model

    CN119476471A

Cited By

  • Information service method and system based on agent causal relationship reasoning

    CN120611801A

  • An information service method and system based on agent causal relationship reasoning

    CN120611801B

  • Text classification method and device, computer equipment and storage medium

    CN120744126A

  • Multi-round retrieval reasoning thinking chain data generation method and program product

    CN121094149A