Method and system for constructing intelligent customer service interaction based on big language model RAG framework

Through an intelligent customer service system based on the RAG framework of the large language model, the knowledge base is automatically processed and maintained, and the knowledge base in the existing technology is solved, and the knowledge base depends on manual maintenance and insufficient processing capabilities of complex problems is achieved, and high-quality intelligent customer service interaction and complex problems are achieved. Resolution ability.

CN119129739APending Publication Date: 2024-12-13JIANGSU ZHIJIAN LOGISTICS CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411156153.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The knowledge base construction of existing intelligent customer service systems relies heavily on manual labor, requires manual maintenance, and cannot handle complex problems, resulting in low reply quality and inaccurate understanding of user intentions.

Method used

Using a method based on the RAG framework of the large language model, the logical division and vectorization of knowledge documents are obtained and processed, and the reranker algorithm is used for search and optimization, and high-quality knowledge base data is generated, and the knowledge base is maintained automatically, so as to improve the system. Complex problem handling capabilities and quality of response.

Benefits of technology

It reduces the manual dependence of knowledge base construction, improves the retrieval accuracy and reply quality, can better understand and deal with complex problems, and improves the resolution capabilities and user experience of intelligent customer service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129739A_ABST
    Figure CN119129739A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and system for constructing intelligent customer service interaction based on a large language model RAG framework, and the method comprises the steps: carrying out the logic division of a knowledge document through a plurality of division methods, obtaining fragments, inputting the processed fragments into an embedded model, carrying out the vectorization, obtaining fragment vectors, and storing the fragment vectors into a vector database; the standard question and answer data vectors are stored in a vector database; inputting the processing result data into an embedded model for vectorization to obtain a processing result data vector, and storing the processing result data vector into a vector database; a user consultation question is converted into a semantic vector through an embedded model, a plurality of index results are re-ordered once through a Rianker algorithm, and a final index result is obtained; and inputting the final index result as a context and a user consultation question into a large language model to generate a question result. The problems that in the prior art, knowledge base construction seriously depends on manpower, manual maintenance is needed, and complex problems cannot be handled are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a system, method, electronic device and storage medium for building intelligent customer service interaction based on a large language model (RAG) framework. Background Art

[0002] The existing intelligent customer service system works based on the following technologies: the natural language processing (NLP) module analyzes and processes the user's input text, the natural language understanding (NLU) module understands the user's intention, and the natural language generation (NLG) module generates a response based on the user's intention.

[0003] The solutions of existing intelligent customer service systems are mainly based on a pre-established knowledge base, which matches answers or corpus in the knowledge base through templates, rules or intentions based on natural language processing and natural language understanding, and then returns them to users after processing through natural language generation. The accuracy is heavily dependent on the pre-established knowledge base and requires manual maintenance. When faced with complex problems, it is unable to understand the user's intentions and needs, has limited reasoning ability, and is unable to provide intelligent answers based on the user's intentions. The replies are relatively stiff and the quality of the answers needs to be improved.

[0004] Therefore, there is an urgent need for a method that can accurately realize intelligent customer service interaction. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a system, method, electronic device and storage medium for building intelligent customer service interaction based on a large language model RAG framework, so as to solve the problem that the construction of the knowledge base in the prior art is heavily dependent on manual labor, requires manual maintenance, and cannot handle complex problems.

[0006] To achieve the above purpose, an embodiment of the present invention provides a method for building intelligent customer service interaction based on a large language model RAG framework, and the method for building intelligent customer service interaction based on a large language model RAG framework specifically includes:

[0007] Acquire historical data and process the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data;

[0008] Using multiple partitioning methods to logically partition the knowledge document to obtain fragments, inputting the fragments into a large language model for processing, inputting the processed fragments into an embedded model for vectorization, obtaining fragment vectors and storing them in a vector database;

[0009] Input the standard question and answer data into the embedded model for vectorization, obtain the standard question and answer data vector and store it in the vector database;

[0010] Processing the historical conversation data, business information data and product information data through a large language model to obtain processing result data, inputting the processing result data into an embedded model for vectorization, obtaining a processing result data vector and storing it in a vector database;

[0011] Obtaining a user consultation question, converting the user consultation question into a semantic vector through an embedded model, and retrieving a plurality of index results related to the semantic vector from a vector database;

[0012] Rerank multiple index results once through the reranker algorithm to obtain the final index result;

[0013] The final index result is input into the large language model together with the user consultation question as the context to generate the question result.

[0014] On the basis of the above technical solution, the present invention can also be improved as follows:

[0015] Furthermore, the acquiring of historical data and processing of the historical data include:

[0016] Extracting the historical data to obtain extracted data;

[0017] After the extracted data is cleaned and standardized, metadata corresponding to the historical data is obtained.

[0018] Furthermore, the division method includes a fixed-size division method and a content-aware division method.

[0019] Furthermore, the method of using multiple division methods to logically divide the knowledge document into segments, inputting the segments into a large language model for processing, inputting the processed segments into an embedded model for vectorization, obtaining segment vectors and storing them in a vector database includes:

[0020] Determine whether the content of the segment is available. If the content of the segment is not available, extract or summarize information from the content of the segment through a large language model;

[0021] The large language model is used to conduct self-questioning and self-answering of the content of the clip, and valid question-answer pairs are obtained by scoring based on the relevance and consistency of the content.

[0022] Furthermore, the method for building intelligent customer service interaction based on the large language model RAG framework also includes:

[0023] Use a large language model to determine the completeness of historical conversation data and obtain high-quality historical conversation data;

[0024] Automatically update standard question-answering data based on high-quality historical conversation data.

[0025] Furthermore, the method for building intelligent customer service interaction based on the large language model RAG framework also includes:

[0026] After obtaining the question result of the user's consultation question, verify the question result to determine whether the question result is correct;

[0027] When the question result is incorrect, the question result corresponding to the user consultation question is re-obtained, and the question result is verified until the question result is correct.

[0028] Furthermore, the method for building intelligent customer service interaction based on the large language model RAG framework also includes:

[0029] When the index result is not retrieved, the supplementary question of the user consultation question is re-acquired until the index result is retrieved.

[0030] A system for building intelligent customer service interaction based on a large language model RAG framework, including:

[0031] An acquisition module, used to acquire historical data and process the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data;

[0032] A vectorization module, used to logically divide the knowledge document into segments using a variety of segmentation methods, input the segments into a large language model for processing, input the processed segments into an embedded model for vectorization, obtain segment vectors and store them in a vector database;

[0033] Input the standard question and answer data into the embedded model for vectorization, obtain the standard question and answer data vector and store it in the vector database;

[0034] Processing the historical conversation data, business information data and product information data through a large language model to obtain processing result data, inputting the processing result data into an embedded model for vectorization, obtaining a processing result data vector and storing it in a vector database;

[0035] The retrieval module is used to rerank multiple index results once through the reranker algorithm to obtain the final index result;

[0036] The question result generating module is used to input the final index result as context and the user consultation question into the large language model to generate the question result.

[0037] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the computer program.

[0038] A non-transitory computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0039] The embodiments of the present invention have the following advantages:

[0040] The method of constructing intelligent customer service interaction based on the RAG framework of a large language model in the present invention reduces the strong manual dependence when constructing a knowledge base, and automatically generates and maintains the knowledge base through a large language model; improves the accuracy of retrieval: generates high-quality knowledge base data in combination with a large language model; improves the relevance and accuracy of retrieval by conditional retrieval; increases the accuracy of retrieval recall results by adding a reranker algorithm; improves the quality of responses and the ability to solve complex problems: combining a large language model with a high-quality knowledge base can improve the system's ability to solve complex problems, as well as improve the quality of responses and reduce stiff and dogmatic responses. This solves the problem that the construction of the knowledge base in the prior art is heavily dependent on manual labor, requires manual maintenance, and cannot handle complex problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0042] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0043] Figure 1 A flowchart of a method for constructing intelligent customer service interaction based on a large language model RAG framework according to the present invention;

[0044] Figure 2 This is an architecture diagram of a system for building intelligent customer service interaction based on a large language model RAG framework according to the present invention;

[0045] Figure 3 This is a schematic diagram of the physical structure of the electronic device provided by the present invention.

[0046] The accompanying drawings are denoted as follows:

[0047] Acquisition module 10, vector database construction module 20, retrieval module 30, question result generation module 40, electronic device 50, processor 501, memory 502, bus 503. DETAILED DESCRIPTION

[0048] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Figure 1 This is a flow chart of an embodiment of a method for constructing intelligent customer service interaction based on a large language model RAG framework according to the present invention. Figure 1 As shown, a method for building intelligent customer service interaction based on a large language model RAG framework provided by an embodiment of the present invention includes the following steps:

[0050] S101, acquiring historical data and processing the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data;

[0051] Specifically: extracting the historical data to obtain extracted data;

[0052] After the extracted data is cleaned and standardized, such as data formatting, data from different data sources and in multiple formats are formatted according to actual conditions; metadata corresponding to the historical data is obtained, such as key information in the extracted data, such as file name, time, business / product information, etc.

[0053] S102, using multiple partitioning methods to logically partition the knowledge document to obtain segments, inputting the segments into the large language model for processing, inputting the processed segments into the embedded model for vectorization, obtaining segment vectors and storing them in a vector database;

[0054] Specifically, the content of standard knowledge documents is relatively large, and it is impossible to directly put all the content into the large language model at one time. In addition, when the text content is long, the semantic representation becomes more difficult, and the model will forget some semantic information. Therefore, it is generally necessary to chunk the document, and when chunking the document, it needs to be chunked according to a certain chunking strategy.

[0055] The following factors need to be considered: 1. The nature of the content being indexed: whether it is a long document or book or a shorter content;

[0056] 2. Which embedding model to use and how does the embedding model perform on text chunks: Generally, embedding models have certain restrictions on the number of tokens. For example, the Bert pre-trained language model performs better on chunks with 256 to 512 tokens, and the text-embedding-ada-002 model can process chunks with 8191 tokens.

[0057] 3. How the retrieved results are applied: In what scenarios will the retrieved results be used, such as semantic search, question answering, summarization, etc.

[0058] The partitioning methods include a fixed-size partitioning method and a content-aware partitioning method.

[0059] Fixed-size chunking: Generally speaking, we want to keep some overlap between chunks to ensure that semantic context is not lost between chunks. In most common cases, fixed-size chunking will be the best path.

[0060] Content-aware chunking: This approach is a group of methods that take advantage of the nature of the content we are chunking and apply more complex chunking to it. For example, sentence chunking, paragraph chunking, specialized chunking (structured and formatted content like Markdown and Latex formats).

[0061] The specific division method needs to be carried out according to the specific data performance to ensure the accuracy and relevance of the search results.

[0062] After the text is segmented, it is determined whether the content of the fragment is available. If the fragment contains too much content or the information is not concentrated, the content of the fragment is determined to be unavailable, and the information of the content of the fragment is extracted or summarized through a large language model; the result can be used for subsequent retrieval to improve the accuracy and relevance of the retrieval results.

[0063] The large language model is used to conduct self-questioning and self-answering of the content of the clip, and valid question-answer pairs are obtained by scoring based on the relevance and consistency of the content.

[0064] S103, inputting the standard question and answer data into the embedded model for vectorization, obtaining the standard question and answer data vector and storing it in the vector database;

[0065] Specifically, part of the standard question and answer data comes from manual experience summary during business or product operation; part comes from self-questioning and self-answering of standard document data by a large language model; and part comes from valid question and answer pairs obtained based on business or product information and historical conversation data.

[0066] S104, processing the historical conversation data, business information data and product information data through the large language model to obtain processing result data, inputting the processing result data into the embedded model for vectorization, obtaining the processing result data vector and storing it in the vector database;

[0067] Specifically, the historical conversation data is further processed, such as removing invalid content, such as frequent modal particles, fixed messages, etc., and the completeness of the historical conversation data is judged through the large language model to obtain high-quality historical conversation data. Next, prompt words are designed through the large language model according to the content of the historical conversations, and high-quality historical conversation data pairs are summarized or extracted for automatic updating of standard question and answer data. The large language model labels and scoring mechanism can be used to screen effective question and answer pairs.

[0068] If the historical conversation data is highly relevant to a business or product, it can be divided according to the business or product. When searching, first match the business or product information, and then search for specific questions to effectively improve the accuracy and relevance of the search.

[0069] The fragments, standard question and answer data or processing result data are vectorized through the Embedding Mode embedding model. The vectorization process will directly affect the subsequent retrieval effect. Therefore, it is necessary to select the appropriate Embedding Mode according to the actual scenario, such as the Bert pre-trained language model, text-embedding-ada-002OpenAI semantic embedding model.

[0070] Finally, the vectorized data is stored in a vector database. Currently, commonly used vector databases include FAI SS, Chromedb, ES, etc. Generally, you can choose a suitable database based on a comprehensive consideration of various factors such as business scenarios, hardware, and performance requirements.

[0071] S105, obtaining a user consultation question, converting the user consultation question into a semantic vector through an embedded model, and retrieving multiple index results related to the semantic vector from a vector database;

[0072] Specifically, after obtaining user consultation, it will first be converted into a semantic vector through the Embedding Model, and then the topk most relevant index results will be retrieved from the vector database; in the vector database, some approximate nearest neighbor implementations (such as clustering, tree or HNSW algorithm) are usually used to improve the efficiency of retrieval, such as HNSW (hierarchical minimum world navigation algorithm) which has the ability to find the nearest neighbor from millions of data points in a few milliseconds. Although this method is very fast, it has a certain degree of randomness. In order to significantly reduce the computational cost, it sacrifices the guarantee of finding the absolute nearest neighbor, that is, the topK most relevant recall sets are not accurately ranked, so the first in relevance may not be the most relevant, and may appear in the 2nd to 5th rankings; if it is directly injected into the prompt without any discrimination and called for the large language model to generate, the final result is not very ideal.

[0073] Therefore, it is necessary to perform a reranker to re-rank the retrieved results.

[0074] S106, reranking the multiple index results once by using a reranker algorithm to obtain a final index result;

[0075] Specifically, when searching, you can add restrictions, such as specifying a certain business or product, and only search among the data that meets the conditions. This way, the final search results will be more relevant to the user's inquiry and more accurate.

[0076] Due to the randomness of retrieval, the first recall result is often not satisfactory, but when the index is in the millions or even tens of millions, you can only sacrifice some progress in exchange for time. You can increase the size of the topK in the first retrieval, such as from the original 10 to 30, and then use a more accurate reranker algorithm for accurate scoring and re-ranking. Considering the accuracy and effect, you can use bge-reranker-large or other re-ranking models for re-ranking, thereby improving the accuracy of recall.

[0077] S107, inputting the final index result as context and the user's inquiry question into the large language model to generate a question result;

[0078] Specifically, the final index result is injected into the prompt as the context together with the user's consultation question. The large language model is used to understand, analyze, and infer the user's consultation question and the final index result, and finally a reasonable response message is returned to answer the user's consultation question.

[0079] The method for building intelligent customer service interaction based on the large language model RAG framework also includes:

[0080] After obtaining the question result of the user's consultation question, verify the question result to determine whether the question result is correct;

[0081] When the question result is incorrect, the question result corresponding to the user consultation question is re-obtained, and the question result is verified until the question result is correct.

[0082] When the index result is not retrieved, the supplementary question of the user consultation question is re-acquired until the index result is retrieved.

[0083] The method for constructing intelligent customer service interaction based on the large language model RAG framework obtains historical data and processes the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data; multiple division methods are used to logically divide the knowledge documents into segments, the segments are input into the large language model for processing, the processed segments are input into the embedded model for vectorization, the segment vectors are obtained and stored in the vector database; the standard question and answer data are input into the embedded model for vectorization, the standard question and answer data vectors are obtained and stored in the vector database; the historical conversation data, business information data and product information data are processed by the large language model to obtain processing result data, the processing result data are input into the embedded model for vectorization, the processing result data vectors are obtained and stored in the vector database; user consultation questions are obtained, the user consultation questions are converted into semantic vectors by the embedded model, and multiple index results related to the semantic vectors are retrieved from the vector database; multiple index results are re-ranked by the reranker algorithm to obtain final index results; the final index results are input into the large language model together with the user consultation questions as context to generate question results. The problem that the construction of the knowledge base in the prior art is heavily dependent on manual work, requires manual maintenance, and cannot handle complex problems is solved. The method can handle more complex problems based on background information, thereby improving the ability to solve complex problems, and by setting prompt words, it can effectively reduce stiff and dogmatic replies, thereby improving service quality and user experience.

[0084] Figure 2 This is a flow chart of a system embodiment of the present invention for building intelligent customer service interaction based on a large language model RAG framework; Figure 2 As shown, an embodiment of the present invention provides a system for building intelligent customer service interaction based on a large language model RAG framework, including the following steps:

[0085] The vector database construction module 20 is used to obtain historical data and process the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical dialogue data, business information data and product information data;

[0086] Extracting the historical data to obtain extracted data;

[0087] After the extracted data is cleaned and standardized, metadata corresponding to the historical data is obtained.

[0088] Using multiple partitioning methods to logically partition the knowledge document to obtain fragments, inputting the fragments into a large language model for processing, inputting the processed fragments into an embedded model for vectorization, obtaining fragment vectors and storing them in a vector database;

[0089] The partitioning methods include a fixed-size partitioning method and a content-aware partitioning method.

[0090] Determine whether the content of the segment is available. If the content of the segment is not available, extract or summarize information from the content of the segment through a large language model;

[0091] The large language model is used to conduct self-questioning and self-answering of the content of the clip, and valid question-answer pairs are obtained by scoring based on the relevance and consistency of the content.

[0092] Input the standard question and answer data into the embedded model for vectorization, obtain the standard question and answer data vector and store it in the vector database;

[0093] Processing the historical conversation data, business information data and product information data through a large language model to obtain processing result data, inputting the processing result data into an embedded model for vectorization, obtaining a processing result data vector and storing it in a vector database;

[0094] Use a large language model to determine the completeness of historical conversation data and obtain high-quality historical conversation data;

[0095] Automatically update standard question-answering data based on high-quality historical conversation data.

[0096] The acquisition module 10 is used to obtain user consultation questions;

[0097] A retrieval module 30 is used to convert the user consultation question into a semantic vector through an embedded model, retrieve multiple index results related to the semantic vector from a vector database, and rerank the multiple index results through a reranker algorithm to obtain a final index result;

[0098] A question result generating module 40, configured to input the final index result as a context and the user's consultation question into a large language model to generate a question result;

[0099] After obtaining the question result of the user's consultation question, verify the question result to determine whether the question result is correct;

[0100] When the question result is incorrect, the question result corresponding to the user consultation question is re-obtained, and the question result is verified until the question result is correct.

[0101] When the index result is not retrieved, the supplementary question of the user consultation question is re-acquired until the index result is retrieved.

[0102] The present invention provides a system for constructing intelligent customer service interaction based on a large language model RAG framework, obtains historical data through a vector database construction module 20, and processes the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data, and product information data; uses a variety of division methods to logically divide the knowledge documents into segments, inputs the segments into a large language model for processing, inputs the processed segments into an embedded model for vectorization, obtains segment vectors and stores them in a vector database; inputs the standard question and answer data into an embedded model for vectorization, obtains standard question and answer data vectors and stores them in a vector database; through a large language The model processes the historical conversation data, business information data and product information data to obtain processing result data, inputs the processing result data into the embedded model for vectorization, obtains the processing result data vector and stores it in the vector database; obtains the user consultation question through the acquisition module 10; converts the user consultation question into a semantic vector through the embedded model, retrieves multiple index results related to the semantic vector from the vector database, re-ranks the multiple index results once through the reranker algorithm to obtain the final index result; inputs the final index result as context and user consultation question into the large language model through the question result generation module 40 to generate the question result. The system for constructing intelligent customer service interaction based on the large language model RAG framework solves the problem that the construction of the knowledge base in the prior art is heavily dependent on manual labor, requires manual maintenance, and cannot handle complex problems.

[0103] Figure 3 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, the electronic device 50 includes: a processor 501 (processor), a memory 502 (memory) and a bus 503;

[0104] The processor 501 and the memory 502 communicate with each other via the bus 503;

[0105] The processor 501 is used to call the program instructions in the memory 502 to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining historical data and performing data processing on the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data; using multiple division methods to logically divide the knowledge documents into segments, inputting the segments into a large language model for processing, inputting the processed segments into an embedded model for vectorization, obtaining segment vectors and storing them in a vector database; inputting the standard question and answer data into an embedded model for vectorization, obtaining standard question and answer data vectors and storing them in a vector database; The historical conversation data, business information data and product information data are processed by a large language model to obtain processing result data, and the processing result data is input into an embedded model for vectorization to obtain a processing result data vector and store it in a vector database; user consultation questions are obtained, and the user consultation questions are converted into semantic vectors by an embedded model, and multiple index results related to the semantic vectors are retrieved from the vector database; multiple index results are re-ranked by a reranker algorithm to obtain a final index result; the final index result is input into a large language model together with the user consultation question as a context to generate a question result.

[0106] The present embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining historical data, and performing data processing on the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data, and product information data; using multiple division methods to logically divide the knowledge documents into segments, inputting the segments into a large language model for processing, inputting the processed segments into an embedded model for vectorization, obtaining segment vectors and storing them in a vector database; inputting the standard question and answer data into an embedded model for vectorization, obtaining The standard question and answer data vector is stored in the vector database; the historical conversation data, business information data and product information data are processed by the large language model to obtain the processing result data, the processing result data is input into the embedded model for vectorization, the processing result data vector is obtained and stored in the vector database; the user consultation question is obtained, the user consultation question is converted into a semantic vector by the embedded model, and multiple index results related to the semantic vector are retrieved from the vector database; the multiple index results are re-ranked by the reranker algorithm to obtain the final index result; the final index result is input into the large language model together with the user consultation question as the context to generate the question result.

[0107] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.

[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0110] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A method for building intelligent customer service interaction based on a large language model RAG framework, characterized in that: The method for building intelligent customer service interaction based on the large language model RAG framework specifically includes: Acquire historical data and process the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data; Using multiple partitioning methods to logically partition the knowledge document to obtain fragments, inputting the fragments into a large language model for processing, inputting the processed fragments into an embedded model for vectorization, obtaining fragment vectors and storing them in a vector database; Input the standard question and answer data into the embedded model for vectorization, obtain the standard question and answer data vector and store it in the vector database; Processing the historical conversation data, business information data and product information data through a large language model to obtain processing result data, inputting the processing result data into an embedded model for vectorization, obtaining a processing result data vector and storing it in a vector database; Obtaining a user consultation question, converting the user consultation question into a semantic vector through an embedded model, and retrieving a plurality of index results related to the semantic vector from a vector database; Rerank multiple index results once through the reranker algorithm to obtain the final index result; The final index result is input into the large language model together with the user consultation question as the context to generate the question result.

2. The method for constructing intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The acquiring of historical data and processing of the historical data include: Extracting the historical data to obtain extracted data; After the extracted data is cleaned and standardized, metadata corresponding to the historical data is obtained.

3. The method for building intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The partitioning methods include a fixed-size partitioning method and a content-aware partitioning method.

4. The method for building intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The method of using multiple partitioning methods to logically partition the knowledge document to obtain fragments, inputting the fragments into a large language model for processing, inputting the processed fragments into an embedded model for vectorization, obtaining fragment vectors and storing them in a vector database includes: Determine whether the content of the segment is available. If the content of the segment is not available, extract or summarize information from the content of the segment through a large language model; The large language model is used to conduct self-questioning and self-answering of the content of the clip, and valid question-answer pairs are obtained by scoring based on the relevance and consistency of the content.

5. The method for building intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The method for building intelligent customer service interaction based on the large language model RAG framework also includes: Use a large language model to determine the completeness of historical conversation data and obtain high-quality historical conversation data; Automatically update standard question-answering data based on high-quality historical conversation data.

6. The method for building intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The method for building intelligent customer service interaction based on the large language model RAG framework also includes: After obtaining the question result of the user's consultation question, verify the question result to determine whether the question result is correct; When the question result is incorrect, the question result corresponding to the user consultation question is re-obtained, and the question result is verified until the question result is correct.

7. The method for building intelligent customer service interaction based on the large language model RAG framework according to claim 1 is characterized in that: The method for building intelligent customer service interaction based on the large language model RAG framework also includes: When the index result is not retrieved, the supplementary question of the user consultation question is re-acquired until the index result is retrieved.

8. A system for building intelligent customer service interaction based on a large language model RAG framework, characterized in that: include: A vector database construction module is used to obtain historical data and process the historical data; wherein the historical data includes knowledge documents, standard question and answer data, historical conversation data, business information data and product information data; Using multiple partitioning methods to logically partition the knowledge document to obtain fragments, inputting the fragments into a large language model for processing, inputting the processed fragments into an embedded model for vectorization, obtaining fragment vectors and storing them in a vector database; Input the standard question and answer data into the embedded model for vectorization, obtain the standard question and answer data vector and store it in the vector database; Processing the historical conversation data, business information data and product information data through a large language model to obtain processing result data, inputting the processing result data into an embedded model for vectorization, obtaining a processing result data vector and storing it in a vector database; The acquisition module is used to obtain user consultation questions; A retrieval module is used to convert the user consultation question into a semantic vector through an embedded model, retrieve multiple index results related to the semantic vector from a vector database, and rerank the multiple index results once through a reranker algorithm to obtain a final index result; The question result generating module is used to input the final index result as context and the user consultation question into the large language model to generate the question result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A non-transitory computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Automatic RAG knowledge base construction method and system based on large model

    CN119558393A

  • Method and System for Automatically Constructing a RAG Knowledge Base Based on Large Language Models

    CN119558393B

  • Multi-modal knowledge base construction and retrieval method and system based on large language model

    CN121009961A

  • Large language model and vector processing off-line knowledge base integration system and method

    CN121168606A

  • RAG knowledge base construction method, equipment and medium

    CN121503606A