Knowledge robot as service
By using a knowledge robot framework that combines inverted indexes and vector indexes with machine learning models to dynamically search and generate responses, the problem of users having difficulty accessing data and services in service platforms is solved, achieving natural interaction and efficient response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PAYPAL INC
- Filing Date
- 2024-07-30
- Publication Date
- 2026-04-17
AI Technical Summary
Existing service platforms struggle to provide users with the data and services they need in a natural and intuitive way. Users have to manually browse or contact agents, and the burden of updating and maintaining information pages is heavy.
Employing a knowledge robot framework, it interacts with users through natural language dialogue, dynamically searches for relevant documents and generates free-form responses. It integrates inverted indexes and vector indexes, machine learning models, and combines semantic and text search optimization results to provide personalized responses.
It enables user-friendly access to data and services, reduces the burden of platform updates and maintenance, improves the accuracy and efficiency of responses, and supports dynamic adaptation across multiple domains.
Smart Images

Figure CN121889783A_ABST
Abstract
Description
Technical Field
[0001] This specification relates in general to computer-based automated interactive services, and more specifically to a framework for providing knowledge robots configurable to interact with users across multiple domains, according to various embodiments of this disclosure. Background Technology
[0002] Service providers typically offer a platform for interacting with their users. This platform can be implemented as a website, mobile application, or telephone service, through which users can access data and / or services offered by the service provider. While these platforms can be interactive in nature (e.g., the content of the platform can change based on different user interactions, etc.), they are fixed and constrained by their structure. In other words, users must navigate the platform to obtain the desired data and / or service. When the data and / or service a user wants is "hidden" (e.g., requiring multiple non-intuitive navigating steps, etc.), it can be difficult for users to access the data and / or service purely through manual navigating of the platform.
[0003] In the past, service providers often dedicated one or more information pages within their platforms, such as "Frequently Asked Questions (FAQ)" pages, to assist users in accessing in-demand data and / or services. These information pages might include predefined questions, such as "How do I change my password?", and pre-filled answers. However, because the questions were pre-generated, users searching for data and / or services still had to navigate through the information pages to find questions that matched their desired data and / or services. If the desired data and / or services didn't match any of the questions on the information page, users had to manually navigate the platform or contact a human agent of the service provider. Furthermore, information pages placed an additional burden on service providers, as the answers to the pre-generated questions needed to be reviewed and / or modified whenever any of the platform, data, and / or services offered by the service provider were updated. Therefore, an advanced framework is needed to deliver data and / or services to users in a natural and intuitive way. Attached Figure Description
[0004] Figure 1 This is a block diagram illustrating an electronic transaction system according to an embodiment of the present disclosure; Figure 2 This is a block diagram illustrating a knowledge robot according to an embodiment of the present disclosure; Figure 3 This is a block diagram illustrating a document retrieval module that utilizes multiple search engines to generate search results according to an embodiment of the present disclosure; Figure 4 The illustration shows an example process for generating a knowledge robot according to an embodiment of the present disclosure; Figure 5 The illustration depicts an example flow for using a knowledge robot to generate free-form answers according to an embodiment of the present disclosure; Figure 6 The illustration shows an example flow for generating search results using multiple search engines according to an embodiment of the present disclosure; Figure 7 The illustration shows an example neural network that can be used to implement a machine learning model according to embodiments of the present disclosure; and Figure 8 This is a block diagram of a system for implementing an apparatus according to embodiments of the present disclosure.
[0005] The embodiments and advantages of this disclosure are best understood by referring to the following detailed description. It should be understood that similar reference numerals are used to identify similar elements illustrated in one or more of the figures, which are shown to illustrate embodiments of this disclosure and not to limit it. Detailed Implementation
[0006] This disclosure describes methods and systems for providing knowledge robots configurable to interact with users across multiple domains. Similar to chatbots, knowledge robots are software modules capable of interacting with users through dialogue in natural language (e.g., free-form / unstructured text). However, unlike chatbots that typically interact with users using predefined rules and structured text, knowledge robots configured using the techniques disclosed herein can dynamically search for relevant documents within one or more specific domains based on user queries and generate free-form responses to user queries using content extracted from these relevant documents.
[0007] In some embodiments, knowledge robots can be dynamically generated (e.g., as a service) for different service providers or different areas within a service provider. Each service provider or each area within a service provider can be associated with documents that include information and knowledge related to the service provider or area. For example, a service provider may have access to product brochures associated with the products and / or services offered by the service provider, technical and / or marketing articles published by the service provider's engineers or marketing team, press releases generated by the service provider, reviews and other articles generated by third parties describing the products and / or services offered by the service provider, and so on. Documents related to the service provider can be associated with different areas. For example, documents related to the service provider may include documents associated with the service provider's platform, documents associated with the products and / or services offered by the service provider, documents associated with legal matters such as user data privacy protection, and documents associated with other areas.
[0008] To generate knowledge bots for specific service providers, a chat system can first obtain documents related to one or more domains associated with that service provider. When documents are associated with different domains, the chat system can segment the documents into different document sets (also called different "document corpora") based on the corresponding domains, so that each domain can be associated with a corresponding document corpus. The chat system can then generate one or more indexes for each document corpus, which can be used by one or more search engines to search the document corpus based on user queries. In some embodiments, the chat system can generate multiple indexes for each document corpus, such as inverted indexes and vector indexes.
[0009] An inverted index is an index data structure that stores a mapping of content (such as words or strings) extracted from documents to document locations within a document corpus. In some embodiments, these mappings can be implemented as hash tables that use distinct words or strings extracted from each document in the document corpus as keys. These keys are mapped to values indicating the document locations containing the corresponding words or strings. Inverted indexes can be used by text-based search engines to perform searches to retrieve relevant documents based on a query. For example, upon receiving a user query, a text-based search engine can identify keys in the hash table that include keywords matching the words or strings included in the user query and can retrieve documents mapped from those keys.
[0010] Vector indexes are another type of index data structure. Unlike inverted indexes that use words or strings as indexes, vector indexes are built on vectors using one or more mathematical models. To generate vector indexes, chat systems can extract embeddings from a document corpus (e.g., by using one or more natural language models, such as bidirectional encoder representations from transformer (BERT) models, etc.). In some embodiments, chat systems can generate embeddings by parsing words in a document from multiple directions (e.g., forward and backward, etc.), so that the chat system can understand not only the meaning of each word itself, but also the meaning of adjacent words (e.g., the words before and after it). The embeddings generated for a document can represent the contextual meaning of the document.
[0011] Each embedding can be implemented as a vector with a set of dimensions, where each dimension can correspond to a specific meaning / context. Thus, each embedding can encompass the semantic context derived from a portion of a document (e.g., a phrase, sentence, paragraph, etc.). In other words, each embedding captures the context (not keywords) of the corresponding part of the document. Similar to inverted indexes, embeddings can be implemented as keys in a table (e.g., a hash table) that are mapped to corresponding documents. A semantic-based search engine can then use the vector index to perform searches to retrieve relevant documents based on a query. For example, upon receiving a user query, a semantic-based search engine can extract one or more embeddings based on the user query. The semantic-based search engine can then identify keys (which include the embeddings) that match one or more embeddings. For example, a key matches that embedding if the Euclidean distance between a key (corresponding to a certain embedding) and one of the embeddings is within a threshold. The semantic-based search engine can then retrieve the documents corresponding to the matching keys.
[0012] One advantage of using vector indexes to query document corpora is that documents sharing similar semantic context with the user's query (but which may not contain the exact same keywords) will be retrieved by semantic-based search engines. Because these documents do not contain the exact same keywords as the user's query, text-based search engines may not be able to retrieve such relevant documents. On the other hand, because the embeddings stored in vector indexes are constrained by the number of dimensions, they may not represent every keyword in the document; therefore, semantic-based search engines may miss some relevant documents that text-based search engines could retrieve based on the user's query. For example, chat systems can use both inverted indexes and vector indexes simultaneously to retrieve relevant documents for a query, thereby enhancing search results.
[0013] Once an index is generated based on one or more document corpora, the chat system can integrate search engines (e.g., text-based search engines, semantic-based search engines, etc.) with machine learning models (e.g., generative artificial intelligence models (also known as large language models), such as OpenAI®'s ChatGPT, Bard, DALL-E, Midjourney, DeepMind, etc.) for the knowledge bot. In some embodiments, the chat system can integrate a data framework (e.g., LlamaIndex, LangChain, etc.) for ingesting and constructing data relevant to different domains for the machine learning model. This framework provides data connectors that enable the knowledge bot to ingest data in different formats (e.g., PDFs, text documents, etc.) from various data sources using different application programming interfaces (APIs).
[0014] In some embodiments, the chat system may also provide an interface for interacting with users and enabling them to access and utilize the knowledge bot. In some embodiments, the interface may be implemented as a chat window, which can be integrated within a service provider's platform, allowing users to interact with the knowledge bot by providing text-based queries. In some embodiments, the interface may be implemented within an interactive voice response (IVR) system, allowing users to interact with the knowledge bot by providing voice-based queries. The chat system can then use one or more speech recognition algorithms to translate the voice query into a text query.
[0015] When a knowledge robot is configured to handle queries across multiple domains, it can first analyze the user query received from the user to determine which domain the query is associated with. The user query received from the user may be unstructured and free-form (i.e., it does not conform to a predefined structure or format specified by the service provider). The knowledge robot can then identify the indexes and document corpora corresponding to the domains associated with the user query and can use a search engine (e.g., a text-based search engine, a semantic-based search engine, etc.) to retrieve documents related to the user query from the document corpus. For example, a text-based search engine can extract keywords (e.g., words or strings, etc.) from the user query and match the keywords with one or more association keys in the inverted index. The text-based search engine can then identify a first set of documents mapped from one or more association keys as relevant to the user query.
[0016] Similarly, a semantic-based search engine can retrieve a second set of documents from a document corpus that are relevant to a user query. For example, a semantic-based search engine can determine one or more embeddings (e.g., vectors) based on the user query. The semantic-based search engine can then compare the one or more embeddings with embeddings stored in a vector index and identify the set of embeddings in the vector index that are most similar to the one or more embeddings (e.g., whose Euclidean distance to the one or more embeddings is within a threshold, etc.). The semantic-based search engine can then retrieve a second set of documents from the document corpus that are mapped from this set of embeddings.
[0017] As discussed in this paper, each search engine has its strengths and weaknesses and may retrieve relevant documents that other search engines might miss. For example, a first set of documents retrieved by a text-based search engine and a second set of documents retrieved by a semantic-based search engine may not completely overlap, because the text-based search engine may retrieve one or more documents that were missed by the semantic-based search engine, and vice versa. To optimize the quality of the search results that will subsequently be fed to a machine learning model to generate a response, a knowledge robot may merge the two sets of documents retrieved separately by the text-based and semantic-based search engines. In some embodiments, when each search engine retrieves relevant documents, each search engine may determine a relevance score (or confidence score) for each retrieved document. This score indicates how confident the search engine is that the document is relevant to the user query. For example, a text-based search engine may assign a higher score to a document that includes all keywords extracted from the user query than to a document that includes only one keyword extracted from the user query. Similarly, a semantic-based search engine may assign a higher score to a document associated with an embedding that is closer to the embedding associated with the user query than to a document associated with an embedding that is farther away from the embedding associated with the user query.
[0018] In some embodiments, the knowledge robot may rank documents within a first document set and a second document set based on scores, and may generate a related document set (e.g., selecting the document with the highest ranking, etc.). The knowledge robot may then generate input (e.g., a hint) for a machine learning model based on a user query and the related document set. Based on this hint, the machine learning model may generate a response to the user query based on the content of the related document set. For example, the machine learning model may also generate embeddings based on the related document set. The machine learning model may then match the embeddings generated based on the user query with the embeddings generated based on the related document set, and may extract portions of content from the related document set to generate a response to the user query. The machine learning model may generate the response in a natural language format (e.g., free-form, unstructured format) based on the extracted content portions according to one or more parameters. Thus, the response may include one or more sentences and / or one or more paragraphs.
[0019] In some embodiments, a knowledge bot may use multiple machine learning models to generate responses to different user queries. For example, a chat system may be configured to use a simpler machine learning model (e.g., a machine learning model with a simpler internal structure) to generate responses to less complex user queries. Responses generated by such a machine learning model may be directly copied from one or more relevant documents. On the other hand, a knowledge bot may use a more sophisticated machine learning model (e.g., a machine learning model with a more complex internal structure) to generate responses to more complex user queries. Responses generated by such a machine learning model may include new content that is not found in any relevant documents. More specifically, in some embodiments, the new content may be derived by the machine learning model based on the relevant documents through the internal structure of the machine learning model or otherwise generated. After generating a response, the knowledge bot may provide the response on an interface (e.g., display the response in a chat window on the user's device, send an audio response to the user's device, etc.).
[0020] In some embodiments, the knowledge bot can continue to interact with the user. For example, the user can continue to have a natural, free-flowing conversation with the knowledge bot via the interface. In one example, the user can provide a follow-up query to the knowledge bot, and the knowledge bot can again process the follow-up query using the techniques disclosed herein and provide another response to the user. Since a user can submit multiple queries within an online session (e.g., a session is defined as an uninterrupted connection between the user's device and the knowledge bot over a network), some of these queries may be related to each other. In some scenarios, the context (or background) of the session may help the knowledge bot interpret the user's query more accurately.
[0021] Consider an example: A user submits a first query to the knowledge robot, "How do I generate documents using the XYZ program?". The knowledge robot can retrieve relevant documents from a corpus of documents associated with the XYZ program product and generate a first response for the user. The first response indicates how the user can generate documents using the XYZ program. After creating a document using the XYZ program, the user submits a second query to the knowledge robot, "I don't know how to save it." Based solely on the second query, the knowledge robot may not understand the question, or may retrieve documents that are irrelevant to the query or may not be helpful to the user. However, based on the context of the conversation between the user and the knowledge robot within the same online session (e.g., including the first query and the first response, or other previous queries and / or responses, etc.), the knowledge robot may understand that the user wants to know how to save the document generated in the XYZ program. In some embodiments, the context of a subsequent user query does not necessarily have to be during the same online session, but can be during a later online session. In this case, the knowledge robot will be able to access queries and responses from the user's previous online sessions to provide additional context for the current query. Online sessions that take place within a shorter timeframe (e.g., within an hour of the current online session) are likely to be more relevant. In this way, the knowledge robot does not need to look at all previous online sessions, but only at more recent ones, such as those that are on the same day (or other timeframe) as the current online session.
[0022] Thus, in some embodiments, the knowledge robot can modify user queries based on the context of an online session (or any previous online session) and can use the modified user queries to generate responses to improve the quality of the responses and the conversation with the user. For example, the knowledge robot may include a chat history data storage device, and may store user queries submitted by the user and responses generated for the user queries in the chat history data storage device. When the knowledge robot receives a new query from the user (e.g., a second user query), the knowledge robot can generate context based on the chat history between the user and the knowledge robot (the chat history may only cover user queries and responses associated with the same online session, or user queries and responses associated with the current online session and any previous online sessions, etc.). The knowledge robot can modify the second user query based on the context.
[0023] Using the example illustrated above, since the user's first query asks about generating documents using the XYZ program, the knowledge robot can infer from the context derived from the online session that the term "it" in the second query refers to "documents in the XYZ program." The knowledge robot can then modify the second query, replacing "it" with the phrase "documents in the XYZ program." The modified second query might become "I don't know how to save documents in the XYZ program."
[0024] Then, the knowledge robot can use a search engine to retrieve relevant documents for the user based on the modified second query. The knowledge robot can also use the modified second query and the retrieved documents to generate suggestions for a machine learning model. Based on these suggestions, the machine learning model can generate a second response to the second user query. The knowledge robot can then provide this second response to the user via an interface. After providing the second response to the user, the knowledge robot can also store the modified second query and the second response in a chat history data storage device for processing subsequent queries from the user.
[0025] One drawback of knowledge bots is their high computational resource requirements for document retrieval (based on semantic search) and response generation. Therefore, in some embodiments, to further enhance the performance of knowledge bots, chat systems can incorporate a semantic caching layer within the bot. This allows the same response stored in the cache to be used to respond to similar user queries. The semantic caching layer differs from traditional caching systems, which require an exact match between the user query and the cached key for cached data to be used in a response. With traditional caching systems, a new query must match the exact key stored in the cache for the system to use a response from a matching key. Thus, because the query "I want to add a card" does not perfectly match the stored key corresponding to the query "I want to add a credit card," the query "I want to add a card" will not trigger a response to be retrieved from the cache, even though the response to the query "I want to add a card" should be the same as the response to the query "I want to add a credit card."
[0026] On the other hand, the semantic caching layer does not store queries directly as keys in the cache memory. Instead, the semantic caching layer is configured to store embeddings associated with different user queries previously submitted to the knowledge bot. In some embodiments, due to the limited storage capacity of the semantic caching layer, it may select embeddings associated with a number of the most frequently submitted queries to store in the cache memory. Each embedding may be linked to responses previously generated by a machine learning model and provided to users.
[0027] When a new user query is received (e.g., via an interface), the knowledge robot first checks if a match exists within the semantic cache layer before using a search engine and machine learning model to generate a response to the new user query. The knowledge robot can use the machine learning model to generate one or more embeddings based on the user query. The knowledge robot can then determine if any key (embedded element) in the cache is similar to one or more embeddings generated based on the user query. Unlike traditional caching systems that require an exact match, the knowledge robot can identify a match if the key in the cache is within a threshold range of the distance to one or more embeddings generated based on the user query. If the key matches an embedding generated based on the user query, the semantic cache layer can provide the interface with a response linked to the matching key (a response previously generated by the knowledge robot as a response to a previous query) as a response to the new user query.
[0028] In some embodiments, after generating a knowledge bot, the chat system can verify the knowledge bot and the responses it generates. The chat system can verify the knowledge bot both online and offline. For example, the chat system can use a test query set to verify the knowledge bot offline. The test query set may include queries of varying lengths, with some portions below a length threshold and others above it. These queries may have been provided to different chatbots to generate baseline responses, and these baseline responses may have been further reviewed and revised by one or more human agents. Thus, the chat system obtains a set of baseline responses corresponding to the test query set. The chat system can then generate an embedding based on each baseline response set.
[0029] By providing a test query set to the knowledge bot, the chat system can obtain a test response set from the knowledge bot. The chat system can also generate embeddings based on each response from the test response set. For each query in the test query set, the chat system can compare the embedding generated based on the corresponding benchmark response with the embedding generated based on the corresponding test response. The chat system can determine the deviation between the two embeddings. If the deviation of the test query set (e.g., the chat system can use total deviation, average deviation, mean deviation, etc.) exceeds a threshold, the chat system can reconfigure the knowledge bot, for example, by adjusting one or more parameters associated with the search engine and / or adjusting one or more parameters associated with the machine learning model. The chat system can test various versions of the knowledge bot (each version can be associated with different parameters of the search engine and / or different parameters of the machine learning model) and can select the version of the knowledge bot with the smallest deviation.
[0030] In some embodiments, the chat system can determine that the document corpus lacks information related to a specific topic within the domain based on the deviation between embeddings. For example, the chat system can determine that the deviation of a subset of queries related to a specific topic is significantly greater than that of other queries. The chat system can retrieve (e.g., crawl from a service provider's intranet or the Internet) additional documents related to the specific topic and can add these additional documents to the document corpus for use by the knowledge robot.
[0031] In some embodiments, during the real-time operation of the knowledge bot, the chat system may intercept the response generated by the machine learning model for a user query before providing it to the user via the interface. The chat system may verify and modify the response before providing the modified response to the user. For example, the chat system may adjust the service provider's guidelines during response verification / correction, such as removing one or more words determined to be inappropriate. In some embodiments, when a response generated by the machine learning model is deemed generally inappropriate, the chat system may not provide the user with that response, but instead provide a default response (e.g., "We couldn't find the answer to your question," etc.).
[0032] In some embodiments, the chat system can also intercept user queries before providing them to the knowledge bot. The chat system can determine whether the user query is appropriate or relevant to one of the known domains associated with the service provider. For example, a user query for "What's the weather like today?" or "Who is the president?" might not be relevant to any domain associated with the service provider. The chat system can provide a default response to the user instead of providing such a query to the knowledge bot, thus improving system efficiency by requiring fewer computational resources.
[0033] Using the techniques disclosed herein to generate knowledge robots offers numerous technical advantages. For example, since a single knowledge robot may link to different knowledge bases (e.g., different indexes correspond to different document corpora associated with different domains, etc.), the knowledge robot can dynamically and flexibly answer user questions related to different domains without requiring the generation of multiple knowledge robots satisfying different domains, nor requiring reconfiguration and / or retraining of knowledge robots. Furthermore, by configuring the knowledge robot to use different sets of parameters for documents retrieved by a search engine and different sets of parameters for a machine learning model to generate responses, the knowledge robot can be configured to generate responses for different domains in different ways (e.g., different length requirements, different tone requirements, different complexity requirements, etc.). For example, when a user query relates to a domain related to customers of a service provider, the knowledge robot can be configured to generate a less technically complex, longer, and more technically professional response. On the other hand, when a user query relates to a domain related to technicians of a service provider, the knowledge robot can be configured to generate a more technically complex and shorter response.
[0034] Furthermore, since knowledge robots are generated by integrating different modules (e.g., different search engines, machine learning models, etc.), these modules can perform their respective functions independently of each other, and therefore these modules can be easily interchanged. For example, a chat system can replace one machine learning model (e.g., Bard) with another machine learning model (e.g., ChatGPT), or replace one search engine with another search engine in a plug-and-play manner, while the knowledge robot can continue to operate in the same way without interruption.
[0035] Figure 1 The figure illustrates an electronic transaction system 100 within which a chat system can be implemented according to one embodiment of this disclosure. The electronic transaction system 100 includes a service provider server 130, a merchant server 120, and user devices 110 and 180, which are communicatively coupled to each other via a network 160. In one embodiment, the network 160 may be implemented as a single network or a combination of multiple networks. For example, in various embodiments, the network 160 may include the Internet and / or one or more intranets, terrestrial networks, wireless networks, and / or other suitable types of communication networks. In another example, the network 160 may include a wireless telecommunications network (e.g., a cellular telephone network) adapted to communicate with other communication networks such as the Internet.
[0036] In one embodiment, user equipment 110 may be used by user 140 to interact with merchant server 120 and / or service provider server 130 via network 160. For example, user 140 may use user equipment 110 to conduct online purchasing transactions with merchant server 120 via a website hosted by merchant server 120 or a mobile application associated with merchant server 120. User 140 may also log in to a user account to access account services or conduct electronic transactions (e.g., data access, account transfers or payments, etc.) with service provider server 130. In various embodiments, user equipment 110 may be implemented using any suitable combination of hardware and / or software configured for wired and / or wireless communication over network 160. In various implementations, user equipment 110 may include at least one of a wireless cellular phone, wearable computing device, PC, laptop, etc.
[0037] In one embodiment, user device 110 includes a user interface (UI) application 112 (e.g., a web browser, mobile payment application, etc.) that user 140 can use to interact with merchant server 120 and / or service provider server 130 via network 160. In one implementation, the UI application 112 includes a software program (e.g., a mobile application) that provides user 140 with a graphical user interface (GUI) to interact and communicate with service provider server 130 and / or merchant server 120 via network 160. In another implementation, the UI application 112 includes a browser module that provides a network interface for browsing information available on network 160. For example, the UI application 112 may be partially implemented as a web browser to view information available on network 160. Thus, user 140 can use the UI application 112 to initiate electronic transactions with merchant server 120 and / or service provider server 130.
[0038] In various embodiments, user equipment 110 may include additional applications 116 that may be required in one or more embodiments of this disclosure to provide additional features available to user 140. In one example, such additional applications 116 may include security applications for implementing client-side security features, programmatic client applications for interfacing with appropriate application programming interfaces (APIs) via network 160, and / or various other types of generally known programs and / or software applications. In other examples, additional applications 116 may interface with user interface application 112 to improve efficiency and convenience.
[0039] In one embodiment, user equipment 110 may include at least one identifier 114, which may be implemented, for example, as an operating system registry entry, a cookie associated with user interface application 112, an identifier associated with the hardware of user equipment 110 (e.g., a media control access (MAC) address), or various other suitable identifiers. In various implementations, identifier 114 may be transmitted via network 160 along with a user login request to service provider server 130, and identifier 114 may be used by service provider server 130 to associate a user with a specific user account (e.g., and a specific profile).
[0040] In various implementations, user 140 is able to input data and information into the input components (e.g., keyboard) of user device 110. For example, user 140 can use the input components to interact with UI application 112 (e.g., to conduct purchase transactions with merchant server 120 and / or service provider server 130, to initiate cancellation transaction requests, etc.).
[0041] User device 180 may include hardware and / or software components substantially the same as user device 110, and may be used by users within a service provider associated with service provider server 130 to initiate the construction and configuration of one or more knowledge robots to the service provider or other service providers (e.g., merchants associated with merchant server 120, etc.). Alternatively, user device 180 may also be used by users within a service provider to interact with one or more knowledge robots associated with service provider server 130.
[0042] In various embodiments, merchant server 120 may be maintained by a business entity (or, in some cases, by a partner of the business entity that processes transactions on behalf of the business entity). Examples of business entities include merchants, resource information providers, utility providers, online retailers, real estate management providers, social networking platforms, cryptocurrency brokerage platforms, and so on, which offer a variety of items for purchase and process payments for purchases. Merchant server 120 may include merchant database 124 for identifying available items or services that can be provided to user devices 110 and 180 for their respective users to view and purchase.
[0043] In one embodiment, merchant server 120 may include a marketplace application 122 configured to provide information to user interface application 112 of user device 110 via network 160. In one embodiment, marketplace application 122 may include a web server hosting merchant websites for merchants. For example, user 140 of user device 110 (or user 180) may interact with marketplace application 122 via network 160 through user interface application 112 to search and view various items or services available for purchase in merchant database 124. In one embodiment, merchant server 120 may include at least one merchant identifier 126, which may be included as part of one or more items or services available for purchase, such as associating a particular item and / or transaction with a particular merchant. In one implementation, merchant identifier 126 may include one or more attributes and / or parameters related to the merchant, such as business and banking information. Merchant identifier 126 may include attributes related to merchant server 120, such as identification information (e.g., serial number, location address, GPS coordinates, network identifier, etc.).
[0044] Although Figure 1 Only one merchant server 120 is shown, but it is envisioned that multiple merchant servers (each associated with a different merchant) could be connected to user equipment 110 and service provider server 130 via network 160.
[0045] In one embodiment, the service provider server 130 may be maintained by a transaction processing entity or online service provider, which can provide processing of electronic transactions between users (e.g., users of user devices and other user devices, etc.) and / or between users and one or more merchants. Thus, the service provider server 130 may include a service application 138 adapted to interact with user device 110 and / or merchant server 120 via network 160 to facilitate electronic transactions (e.g., electronic payment transactions, data access transactions, etc.) between users and merchants processed by the service provider server 130. In one example, the service provider server 130 may be provided by PayPal® Inc. of San Jose, California, and / or by one or more service entities or their respective intermediaries, which may provide multiple point-of-sale devices in various locations to facilitate transaction routing between merchants and, for example, service entities.
[0046] In some embodiments, service application 138 may include a payment processing application (not shown) for processing purchases and / or payments in electronic transactions between users and merchants or between any two entities (e.g., between two users, two merchants, etc.). In one implementation, the payment processing application assists in resolving electronic transactions through verification, delivery, and settlement. Thus, the payment processing application resolves debt issues between users and merchants, where funds can be deducted and / or deposited directly and / or automatically from accounts in a banking-acceptable manner.
[0047] Service provider server 130 may also include interface server 134, which is configured to provide content (e.g., web content) to users and interact with them. For example, interface server 134 may include a web server configured to provide web content in response to HTTP requests. In another example, interface server 134 may include an application server configured to interact with corresponding applications (e.g., service provider mobile applications) installed on user devices 110 and 180 via one or more protocols (e.g., REST API, SOAP, etc.). Thus, interface server 134 may include pre-generated electronic content ready to be provided to users. For example, interface server 134 may store login pages and be configured to provide login pages to users to log in to their user accounts to access various services provided by service provider server 130. Interface server 134 may also include other electronic pages associated with different services (e.g., e-transaction services, etc.) provided by service provider server 130. Therefore, users (e.g., user 140, user device 180, or a merchant associated with merchant server 120, etc.) can access user accounts associated with users and access various services provided by service provider server 130 by generating HTTP requests to service provider server 130.
[0048] In one embodiment, service provider server 130 may be configured to maintain one or more user accounts and merchant accounts in account database 136. Each account may be associated with a profile and may include account information associated with one or more individual users (e.g., user 140 associated with user device 110, etc.) and merchants. For example, account information may include private financial information of users and merchants, such as one or more account numbers, passwords, credit card information, bank information, digital wallets used or other types of financial information, transaction history, Internet Protocol (IP) addresses, and device information associated with user accounts. In some embodiments, account information may also include user purchase profile information, such as account funds options and payment options associated with the user, payment information, receipts, and other information collected in response to completed funds and / or payment transactions.
[0049] In one implementation, a user may have identity attributes stored in the service provider server 130, and the user may have credentials for authenticating or verifying their identity with the service provider server 130. User attributes may include personal information, banking information, and / or the source of funds. In various aspects, user attributes may be passed to the service provider server 130 as part of login, search, selection, purchase, and / or payment requests, and user attributes may be used by the service provider server 130 to associate the user with one or more specific user accounts maintained by the service provider server 130, and to determine the authenticity of requests from user devices.
[0050] In various embodiments, the service provider server 130 also includes a chat module 132 that implements the chat system as discussed herein. In some embodiments, the chat module 132 may provide a user interface that allows a user (e.g., an internal user of the service provider server 130, such as a user of user device 180, etc.) to submit requests and parameters for generating and configuring a knowledge bot. For example, a user of user device 180 may specify a particular service provider (e.g., a service provider associated with service provider server 130 or other service providers, such as a merchant associated with merchant server 120, etc.) and one or more domains associated with the service provider. When specifying one or more domains, the user may provide document locations associated with the one or more domains.
[0051] Based on user input, chat module 132 can use the techniques disclosed herein to generate and configure one or more knowledge bots to provide services to users of service provider server 130 (or other service providers, such as merchants associated with merchant server 120). For example, chat module 132 can generate one or more knowledge bots for one or more domains (e.g., product and service information domain, internal knowledge base domain, platform usage domain, etc.) specified in the user input and associated with service provider server 130. Chat module 132 can then configure one or more knowledge bots to provide conversational interactions with users based on different document corpora associated with different domains.
[0052] Figure 2 The illustration shows example knowledge robots generated by chat module 132 according to various embodiments of the present disclosure. As discussed herein, chat module 132 can be configured to provide knowledge robots as a service to different service providers and / or different domains within a service provider. Specifically, chat module 132 can generate and configure one or more knowledge robots, such as knowledge robot 200, for different service providers and / or different domains.
[0053] Upon receiving a request to generate a knowledge robot for one or more domains, the chat module 132 in some embodiments may obtain documents related to one or more domains. These documents may include product brochures associated with products and / or services offered by a service provider, technical and / or marketing articles published by the service provider's engineers or marketing team, press releases generated by the service provider, third-party generated reviews and other articles describing the service provider's products and / or services, internal process documents associated with the service provider, and so on. The chat module 132 may store the documents in a document storage device 216 (or multiple storage devices accessible to the chat module 132). In some embodiments, when the documents obtained by the chat module 132 are associated with multiple domains, the chat module 132 may divide the documents into several groups such that all documents associated with the same domain are stored in the same group. Each group of documents may form a document corpus for the knowledge robot 200 to use in generating responses to various user queries.
[0054] Then, the chat module 132 can generate one or more indexes for each document corpus stored in the document storage device 216. These one or more indexes can be used by one or more corresponding search engines to retrieve documents related to the user's query from the document corpus stored in the document storage device 216. In some embodiments, the chat module 132 can generate inverted indexes and vector indexes for each document corpus stored in the document storage device 216, and can store the inverted indexes and vector indexes in the index storage device 214.
[0055] An inverted index is an index data structure that stores a mapping between content extracted from documents (such as words or strings) and document locations within a document corpus. To generate an inverted index, chat module 132 can parse documents in each document corpus and extract keywords from each document (e.g., words or strings appearing in each document, etc.). Chat module 132 can store these keywords as keys in a hash table, and these keys are then linked to document locations in document storage device 216 that include the corresponding keywords. The inverted index can be used by a text-based search engine to perform searches to retrieve relevant documents based on a query.
[0056] Vector indexes are another type of index data structure. Unlike inverted indexes that use words or strings as indexes, vector indexes are built on vectors using one or more mathematical models. To generate vector indexes, chat module 132 can extract embeddings from documents in each document corpus (e.g., by using one or more natural language models, such as the BERT model, etc.). In some embodiments, chat module 132 can generate embeddings by parsing words in each document from multiple directions (e.g., forward and backward, etc.), so that chat module 132 (and / or the natural language model) can understand not only the meaning of each word itself, but also the meaning of adjacent words (e.g., the words before and after the word). The embeddings generated for a document can represent the contextual meaning of the document.
[0057] In some embodiments, the chat module 132 may implement the embeddings as vectors in a multidimensional space, which may represent semantic context derived from a portion of a document (e.g., understanding the meaning of one or more words in the document based on adjacent words). The chat module 132 may store the embeddings as keys in a hash table, which are linked to the document locations used to derive the embeddings. The semantic-based search engine can then use the vector index to perform a search to retrieve relevant documents based on the query.
[0058] Therefore, the chat module 132 can integrate the user interface module 208, query formatting module 202, document retrieval module 204, and AI module 206 within the knowledge robot 200. In some embodiments, the user interface module 208 can provide a user interface for interacting with the knowledge robot 200. This interface can be implemented as a chat interface, which allows the user to provide text input in natural language format (e.g., a user query) via a user device and view the response to the user query generated by the knowledge robot 200. In some embodiments, this interface can be implemented as an interactive voice response (IVR) system, which allows the user to engage in voice dialogue with the knowledge robot 200.
[0059] User interface 208 can provide an interface on any device, such as user device 110, user device 180, and / or merchant server 120. Users can submit user query 232 to knowledge robot 200 via the interface provided on their device. This query can be a question in natural language format, such as “How do I reset my password?”, “How do I generate documentation using your XYZ program?”, “I want to add a credit card to my account,” and so on. Since users can submit questions in any free-form format, they can provide queries in any way they need, without being limited by pre-existing structures. Upon receiving user query 232, query formatting module 202 of knowledge robot 200 can reformat user query 232. For example, query formatting module 202 can modify user query 232 based on the context associated with the conversation between the user and knowledge robot 200 during the current chat session (and / or previous chat sessions). It is envisioned that, while conversing with knowledge robot 200, users may submit user queries using language that references previous queries or statements from the chat session (or previous chat sessions). For example, the knowledge robot 200 may be configured to store any previously submitted user queries and responses generated for those queries in the chat history data storage device 212. When the query formatting module 202 receives the user query 232, it may derive context 242 based on the user's previously submitted queries and responses generated for the user during the current chat session. In some embodiments, the query formatting module 202 may also include queries and responses from previous chat sessions between the user and the knowledge robot 200 to generate the context. However, since the current chat session is more relevant and indicative to the meaning of the user query 232, the query formatting module 202 may either use only queries and responses from the current chat session or assign greater weight to queries and responses from the current chat session than to queries and responses from previous chat sessions.
[0060] For example, during a chat session between a user and knowledge robot 200, the user might initially ask knowledge robot 200, “How do I generate documentation in your XYZ program?” After receiving a response generated by knowledge robot 200, the user may then ask via user interface 208, “How do I save it?” (This is user query 232). Knowledge robot 200 may not accurately interpret user query 232, and therefore may not be able to generate a relevant response for user query 232 based solely on that query, because the user query lacks key information (e.g., what “it” refers to, etc.). However, considering the context derived from at least the previous user query “How do I generate documentation in your XYZ program,” query formatting module 202 can deduce the context of the chat session (e.g., the chat session relates to documentation and the XYZ program). Query formatting module 202 can then modify user query 232 to generate a modified query 244 based on the context. In some embodiments, query formatting module 202 may add, remove, or replace words in the user query when modifying it. In this example, query formatting module 202 can replace the word "it" in user query 232 with "documents using the XYZ program" based on context. Modifying the user query based on context can improve (by document retrieval module 204) the search for relevant documents for the user query, and (by AI module 206) the generation of relevant and helpful responses to the user query.
[0061] Then, the query formatting module 202 can pass the modified query 244 to the document retrieval module 204 to retrieve documents related to the user query 232. In some embodiments, when the knowledge robot 200 is configured to process queries across multiple domains, the document retrieval module 204 can first determine the domain associated with the modified query 244 from one or more domains. For example, the document retrieval module 204 can parse the modified query 244 and determine a specific domain from one or more domains based on the words included in the modified query 244. The document retrieval module 204 can then access one or more indexes generated by the chat module 132 for that specific domain from the index storage device 214.
[0062] In some embodiments, the document retrieval module 204 may include one or more search engines that can match the modified query 244 to one or more keys in an index stored in the index storage device 214. The document retrieval module 204 may also retrieve documents linked by one or more keys from the document storage device 216. In some embodiments, using one or more search engines and the indexes in the index storage device 214, the document retrieval module 204 can retrieve documents 246 determined to be relevant to the user query 232 from the document storage device 216. The document retrieval module 204 may pass the retrieved document 246 to the AI module 206. In some embodiments, the AI module 206 may also obtain the modified query 244 and the context 242 of the dialogue between the user and the knowledge robot 200.
[0063] In some embodiments, AI module 206 may include a machine learning model (e.g., a large language model such as ChatGPT, Bard, DALL-E, Midjourney, DeepMind, etc.) configured to generate a response to user query 232 based on modified query 244, document 246, and context 242. AI module 206 may generate input (e.g., a hint) for the machine learning model based on modified query 244, document 246, and context 242. Based on the hint, the machine learning model may be configured and trained to generate a response 234 to query 242 using the content within document 246. Response 234 may be in natural language format, including sentences and / or paragraphs that are easily understood by humans. User interface module 208 may send response 235 to the device (e.g., user device 110, user device 180, merchant server 120, etc.) that submitted user query 232 via the interface.
[0064] In some embodiments, AI module 206 may be associated with multiple machine learning models of different types and / or complexities to generate responses to different user queries. For example, AI module 206 may use simpler machine learning models (e.g., machine learning models with simpler internal structures, such as a simplified version of ChatGPT, etc.) to generate responses to less complex user queries. Responses generated by such machine learning models may be directly copied from one or more relevant documents. On the other hand, the knowledge robot may use more sophisticated machine learning models (e.g., machine learning models with more complex internal structures, such as more advanced versions of ChatGPT, etc.) to generate responses to more complex user queries. Responses generated by such machine learning models may include new content that is not found in any relevant documents. More specifically, in some embodiments, the new content may be derived by the machine learning model based on the relevant documents through the internal structure of the machine learning model or otherwise generated. After generating a response, knowledge robot 200 may provide the response on an interface (e.g., displaying the response in a chat window on the user device, sending an audio response to the user device, etc.).
[0065] Users can continue to interact with the knowledge robot 200 via the interface (e.g., by submitting user queries and viewing responses generated by the knowledge robot 200, etc.). The knowledge robot 200 can continue to store user queries and responses in the chat history storage device 212, so that, using the techniques described herein, the updated context of the conversation between the user and the knowledge robot 200 can be used to enhance the performance of the knowledge robot 200 in generating responses to subsequent queries.
[0066] Using large language models to generate automated responses for users offers numerous advantages. For example, large language models can interpret and absorb vast amounts of raw data and generate responses using natural language that summarizes and presents at least a portion of the knowledge extracted from the raw data (which may include new content derived from the raw data). Interacting with users using such large language models can yield substantial benefits, as users can ask any type of question within a domain in a free-form manner (rather than being limited to pre-generated questions presented on a FAQ page), and responses can be dynamically generated based on knowledge derived from a set of documents. With Knowledge Robot 200, service providers are no longer required to pre-generate responses to any questions but can update documents (internal, external, etc.) at any time without affecting the operation of Knowledge Robot 200.
[0067] However, generating responses using large language models can also be resource-intensive (and therefore power- and time-consuming), as large language models are typically implemented in complex computer architectures designed for analyzing and processing large amounts of data. Therefore, to further enhance the performance of the knowledge robot 200, the chat module 132 in some embodiments can integrate a caching layer 240 within the knowledge robot 200. The caching layer 240 allows the knowledge robot 240 to store and reuse responses previously generated for other user queries in response to the current query.
[0068] In some embodiments, cache layer 240 includes a semantic caching system configured to store previously generated responses and match them with the current user query. Cache layer 240 differs from other conventional caching systems, where an exact match of the key (e.g., the user query) is required for reuse of previously generated responses stored as cached data. With conventional caching systems, a new query must be exactly the same as the key (potentially a previously submitted query) stored in the cache for the system to use a response from a matching key for the new query. Thus, the query "I want to add a card" will not match the key corresponding to the query "I want to add a credit card," thus not triggering a retrieval of the response from the cache, even though the response to the query "I want to add a card" should be the same as the response to the query "I want to add a credit card."
[0069] On the other hand, cache layer 240 includes a semantic caching system that does not store queries directly as keys in the cache memory. Instead, cache layer 240 is configured to store embeddings generated based on different user queries previously submitted to knowledge robot 200. For example, when knowledge robot 200 processes a user query (or a modified query), cache layer 240 (or document retrieval module 204) can generate embeddings based on the user query. Cache layer 240 can store the embeddings as keys for cached data and can store the responses generated by AI module 206 for user queries as values corresponding to the keys.
[0070] In some embodiments, due to the limited storage capacity of the cache memory, the cache layer 240 may not be able to store all the embeddings and responses of previously received queries, but may instead selectively store the embeddings and responses corresponding to popular queries (e.g., queries with a submission frequency above a threshold, etc.).
[0071] When a new user query is received (e.g., a modified query 244), the knowledge robot can determine whether a match exists between the modified query 244 and the keys in the cache memory before the document retrieval module 204 and / or the AI module 206 process the modified query 244. The cache layer 240 can generate an embedding for the modified query 244 and determine whether any key embedding in the cache memory is within a threshold distance of the embedding generated for the modified query 244. If a key embedding is within the threshold distance of the embedding generated for the modified query 244, the cache layer 240 can retrieve the response corresponding to the matching key embedding from the cache memory and provide that response as a response to query 232 to the interface, which significantly reduces the computational complexity and processing time of processing user query 232. Using a semantic caching system, the cache layer 240 matches the query "I want to add a card" with the key embedding generated for the previously submitted query "I want to add a credit card," because the embeddings generated for these two queries should be sufficiently similar (e.g., close within a threshold distance), even if the two queries are not exactly the same.
[0072] In some embodiments, after generating the knowledge robot 200 and before deploying it to users, the chat module 132 can verify the responses generated by the knowledge robot 200 to ensure that the quality of the responses exceeds a threshold. This threshold can vary depending on the type of query; for example, a query requiring a more precise or accurate response may have a higher accuracy threshold than a query requiring only a more general response. The chat module 132 can verify responses both online and offline. For example, the chat module 132 may include an online verification module 252 configured to verify the responses generated by the knowledge robot 200 online, and an offline verification module 254 configured to verify the responses generated by the knowledge robot 200 offline.
[0073] In some embodiments, the offline verification module 254 may use a test query set to verify the knowledge bot 200 offline (e.g., in a test environment separate from the production environment). The test query set may include queries of varying lengths to ensure that the knowledge bot 200 can respond to user queries of different lengths with a quality exceeding a threshold. Thus, the offline verification module 254 can obtain a test query set comprising a portion below the length threshold and another portion above the length threshold. These test queries may have been provided to different chatbots and may have been reviewed and revised by one or more human agents. Based on the work performed by other chatbots and / or human agents, the offline verification module 254 can obtain a benchmark response set corresponding to the test query set.
[0074] To validate the knowledge robot 200, the offline validation module 254 can provide a test query set as a user query to the knowledge robot 200. Using the techniques disclosed herein, the knowledge robot 200 can generate responses (e.g., a test response set) for the test query set. Since the responses generated by the knowledge robot 200 are in natural language format and can be expressed in many different ways (e.g., different tones, using different words with the same meaning, using various different phrases to express the same meaning, etc.), comparing the responses generated by the knowledge robot 200 to a benchmark response in a literal manner (e.g., a word-by-word comparison between two responses) is invalid. Therefore, the offline validation module 254 can determine whether the contextual meaning of the responses generated by the knowledge robot 200 matches the contextual meaning of the benchmark response.
[0075] To this end, the offline verification module 254 can generate embeddings based on each response in the baseline response set. The offline verification module 254 can also generate embeddings based on each response in the test response set generated by the knowledge robot 200. Since the embeddings generated for a response represent the semantic meaning of the response, comparing the embeddings of responses to determine whether the test response accurately represents the meaning of the baseline response is effective. For each query in the test query set, the offline verification module 254 can compare the embeddings generated based on the corresponding baseline response with the embeddings generated based on the corresponding test response. In some embodiments, the offline verification module 254 can determine the deviation between two embeddings. The deviation between the test response and the corresponding baseline response can represent the degree of similarity (or difference) between the two responses in their semantic meaning. The offline verification module 254 can continue to determine the deviations between other response pairs.
[0076] If the deviation between the test response set and the baseline response set (e.g., the chat system can use total deviation, average deviation, mean deviation, etc.) exceeds a threshold, the chat module 132 can reconfigure the knowledge robot 200. For example, the chat module 132 can reconfigure the knowledge robot 200 by adjusting one or more parameters associated with the search engine in the document retrieval module 204 and / or adjusting one or more parameters associated with the machine learning model in the AI module 206. In some embodiments, the chat module 132 can test various versions of the knowledge robot 200 (each version may be associated with different parameters of the search engine in the document retrieval module 204 and / or different parameters of the machine learning model in the AI module 206). In some embodiments, the chat module 132 can select the version of the knowledge robot 200 with the smallest deviation for use in a production environment.
[0077] In some embodiments, the online verification module 252 may be configured to verify queries and / or responses for the knowledge robot 200 during production. For example, when a user query is submitted through the interface of the knowledge robot 200, the online verification module 252 may intercept the user query and validate it before passing it to other modules within the knowledge robot 200 for processing. Validation of the user query ensures that it is associated with one of the domains that the knowledge robot 200 is configured to serve, and that there is sufficient determinism (e.g., exceeding a threshold) to ensure that the knowledge robot 200 can generate an acceptable answer for the user query. Thus, when the online verification module 252 intercepts a user query, it may analyze the query (e.g., by parsing the words in the query). The online verification module 252 may determine whether the user query is associated with one of the domains (if so, the user query is considered appropriate) or not associated with one of the domains (if so, the user query is considered inappropriate). Only when the user query is deemed appropriate can the online verification module 252 pass it to the formatting module 202 and / or the document retrieval module 204. If a user query is deemed inappropriate, the online verification module 252 can provide the user with a default response (e.g., “We have no answer to your question”, etc.) instead of passing the user query to other modules of the knowledge robot 200 for processing.
[0078] When AI module 206 generates a response to a user query, in some embodiments, online verification module 252 may also verify the response before providing it to the user device through the interface of knowledge robot 200. In some embodiments, online verification module 252 may analyze the response (e.g., by parsing the words in the response) and may determine whether the response conforms to a set of guidelines associated with a service provider. For example, the service provider may include guidelines prohibiting the use of certain words or requiring the use of certain words in one or more domains. Thus, online verification module 252 determines whether the response conforms to the guidelines. If the response does not conform to the guidelines, online verification module 252 may modify the response before providing the modified response to the user. For example, online verification module 252 may add words to the response or remove / change words from the response based on the guidelines. In some embodiments, when the response generated by AI module 206 is deemed generally inappropriate, online verification module 252 may not provide the response to the user, but instead provide a default response (e.g., "We couldn't find the answer to your question," etc.).
[0079] Due to the modular structure of the knowledge robot 200, its generation offers flexibility in terms of the components integrated into it and the user groups it serves. For example, as discussed herein, since the AI module 206 is configured to generate responses based solely on prompts, which include user queries and a set of documents used to generate the responses, the knowledge robot 200 can seamlessly provide responses across different domains. In some embodiments, the chat module 132 can provide the knowledge robot 200 with a corpus of documents associated with different domains and corresponding indexes (and store them in the document storage device 216 and the index storage device 214), so that the knowledge robot 200 can serve user queries associated with different domains. Alternatively, the chat module 132 can generate multiple knowledge robots, each similar to the knowledge robot 200, and can provide a separate corpus of documents and corresponding indexes to each knowledge robot, so that each knowledge robot can be configured to serve user queries associated with its respective domain. Furthermore, the chat module 132 can replace any component (e.g., the query formatting module 202, the document retrieval module 204 (or any search engine within the document retrieval module 204), or the AI module 206) without affecting the operation of the knowledge robot 200, thus enabling seamless updates and / or improvements to the knowledge robot 200.
[0080] Figure 3 The illustration shows an example schematic diagram of a document retrieval module 204 according to various embodiments of the present disclosure. In this example, the document retrieval module 204 includes two search engines, including a text-based retrieval module 302 and a semantic-based retrieval module 304, which work together to perform document retrieval functions for the knowledge robot 200. In some embodiments, when the chat module 132 generates and configures the knowledge robot 200 to serve user queries related to a specific domain, the chat module 132 can obtain a document corpus 312 associated with that specific domain. The chat module 132 can generate an inverted index 322 based on the document corpus 312, and can use a natural language processing model 308 to generate a vector index 324 based on the document corpus 312. The chat module 132 can store the document corpus 312 in a document storage device 216, and can store the inverted index 322 and the vector index 324 in an index storage device 214.
[0081] When the document retrieval module 204 receives a user query (or a modified user query, such as modified query 244), it can use the text-based retrieval module 302 and the semantic-based retrieval module 304 to retrieve documents related to the modified query 244 from the document corpus 312. For example, the text-based retrieval module 302 can extract words or strings from the modified query 244 and determine whether the words or strings extracted from the modified query 244 match any key in the inverted index 322. Once the text-based retrieval module 302 identifies a key in the inverted index 322 that matches the words or strings extracted from the modified query 244, it can retrieve the document set 332 from the document corpus 312 based on the key identified in the inverted index 322.
[0082] The semantic-based retrieval module 304 can generate embeddings (e.g., vectors) based on the modified query 244 and determine whether the embeddings generated based on the modified query 244 match any keys in the vector index 324. Once the semantic-based retrieval module 304 identifies a key in the vector index 324 that matches an embedding generated based on the modified query 244, the semantic-based retrieval module 304 can retrieve the document set 334 from the document corpus 312 based on the key identified from the vector index 324.
[0083] As discussed herein, each search engine (e.g., text-based retrieval module 302 and semantic-based retrieval module 304) has its strengths and weaknesses, and may retrieve relevant documents that other search engines might miss. One advantage of using semantic-based retrieval module 304 (and vector index 324) to query the document corpus 312 is that documents sharing a similar semantic context with the modified query 244 (but which may not contain the exact same keywords) will be retrieved by semantic-based retrieval module 304. Because the documents do not contain the exact same keywords as the user query, text-based retrieval module 302 may not be able to retrieve such relevant documents using inverted index 322. On the other hand, because the embeddings stored in vector index 324 are constrained by the number of dimensions, they may not be able to represent every keyword in the document, and therefore semantic-based retrieval module 304 may miss some relevant documents that text-based retrieval module 302 could retrieve based on modified query 244. For example, the document set 332 retrieved by the text-based retrieval module 302 and the document set 334 retrieved by the semantic-based retrieval module 304 may not completely overlap, because the text-based retrieval module 302 may retrieve one or more documents that were missed by the semantic-based retrieval module 304, and the semantic-based retrieval module 304 may similarly retrieve one or more documents that were missed by the text-based retrieval module 302.
[0084] To optimize the search capabilities of document retrieval module 204, it can use ranking module 306 to merge document groups 332 and 334 retrieved by the various retrieval modules. In some embodiments, when text-based retrieval module 302 and semantic-based retrieval module 304 retrieve their respective groups of documents 332 and 334, they can determine a relevance score (or confidence score) for each retrieved document. This score indicates the degree of confidence the retrieval module has in the relevance of the corresponding document to the modified query 244. For example, text-based retrieval module 302 can assign a higher score to a document from document set 332 that includes all words extracted from the modified query 244, compared to a document from document set 332 that includes only one word extracted from the modified query 244. Similarly, the semantic-based retrieval module 304 can assign higher scores to documents from document set 334 that are associated with embeddings that are further away from the embeddings generated based on modified query 244, compared to documents from document set 334 that are associated with embeddings that are closer to the embeddings generated based on modified query 244.
[0085] In some embodiments, ranking module 306 may merge document groups 332 and 334 and rank the documents from the merged documents based on scores. Ranking module 306 may then generate a relevant set of documents as search results 246 for knowledge robot 200 (e.g., selecting the document with the highest ranking, etc.).
[0086] Figure 4 The illustration depicts a process 400 for generating and verifying a knowledge robot according to various embodiments of the present disclosure. In some embodiments, at least a portion of process 400 may be performed by chat module 132. Process 400 begins (at step 405) with obtaining a corpus of documents associated with a domain. For example, when chat module 132 receives a request to generate a knowledge robot (e.g., knowledge robot 200) for serving queries associated with a specific domain, chat module 132 may retrieve documents associated with that specific domain (e.g., document corpus 312). For example, when a specific domain is associated with products and / or services offered by a service provider, chat module 132 may access service provider server 130 and may search for and obtain documents related to the products and / or services, such as user manuals associated with the products and / or services, technical articles associated with the products and / or services, marketing materials associated with the products and / or services, third-party reviews of the products and / or services, or other materials related to the products and / or services.
[0087] Then, process 400 (in step 410) generates one or more search indexes for indexing the document corpus for use by one or more search models, and (in step 415) integrates the one or more search models and one or more search indexes with an artificial intelligence (AI) model to generate a knowledge robot. For example, chat module 132 can generate inverted index 322 by extracting keywords from each document in document corpus 312. Inverted index 322 may include multiple key-value pairs. Each key-value pair may include the extracted keyword as the key and the location address of the document from which the keyword was extracted as the value. Inverted index 322 can be used by text-based retrieval module 302 to retrieve relevant documents from document corpus 312.
[0088] The chat module 132 can also use the natural language processing model 308 to generate embeddings from each document in the document corpus 312, and can generate a vector index 324 based on the embeddings. The vector index 324 can also include multiple key-value pairs. Each key-value pair can include the embedding as the key and the location address of the document from which the embedding was generated as the value. The vector index 324 can be used by the semantic-based retrieval module 304 to retrieve relevant documents from the document corpus 312.
[0089] Chat module 132 can integrate document retrieval module 204 (including text-based retrieval module 302 and semantic-based retrieval module 304) and AI module 206 into knowledge robot 200. In some embodiments, AI module 206 may include a large language model (e.g., ChatGPT, Bard, etc.) configured to generate responses in natural language format based on prompts.
[0090] After integrating various modules into the knowledge robot, process 400 can validate the knowledge robot, for example, by obtaining sample user queries and target answers to the sample user queries (in step 420), and by generating candidate answers to the sample user queries (in step 425) using the knowledge robot. For example, chat module 132 can obtain a test query set for offline validation of knowledge robot 200. The test query set can include queries of varying lengths to ensure that knowledge robot 200 can provide responses to user queries of different lengths with quality exceeding a threshold. Chat module 132 can provide the test query set as user queries to knowledge robot 200. The knowledge robot can then generate responses based on the test query set.
[0091] Process 400 (in step 430) determines whether the response generated by knowledge robot 200 is acceptable (e.g., based on thresholds, system criteria, compliance requirements, etc., as discussed above). If the response is acceptable, process 400 (in step 440) deploys the knowledge robot in the production environment. On the other hand, if the response is unacceptable, process 400 (in step 435) adjusts the parameters associated with the knowledge robot and repeats the verification steps (e.g., steps 425 and 430). For example, chat module 132 can compare the response generated by knowledge robot 200 with a set of benchmark responses prepared for the test query set. In some embodiments, chat module 132 can generate embeddings for each response generated by knowledge robot 200 and each corresponding benchmark response, instead of directly comparing the responses. Chat module 132 can compare the embeddings associated with the response generated by knowledge robot 200 and the embeddings associated with the corresponding benchmark response. Chat module 132 can determine the deviation between the two embeddings. In some embodiments, the chat module 132 can determine the deviation of all responses generated by the knowledge robot 200, and if the deviation (e.g., sum, mean, median, etc.) is below a threshold, the response can be determined to be acceptable. If the response is acceptable, the chat module 132 can deploy the knowledge robot 200 in a production environment for use by various users.
[0092] On the other hand, if the response is determined to be unacceptable (e.g., deviation exceeds a threshold, etc.), the chat module 132 can adjust the parameters associated with the search engine (e.g., text-based retrieval module 302 and semantic-based retrieval module 304) and / or the parameters associated with the AI module 206. Adjusting the parameters associated with the search engine may affect the documents retrieved by each search engine. Adjusting the parameters associated with the AI module 206 may affect how the knowledge robot 200 generates responses (e.g., how it extracts content from relevant documents, how it summarizes content from relevant documents, word choice / language used in the response, tone used in the response, etc.). The chat module 132 can continue to adjust the parameters of the knowledge robot 200 and test the responses generated by the knowledge robot 200 until the responses generated by the knowledge robot 200 are acceptable. In some embodiments, the chat module 132 can generate multiple versions of the knowledge robot 200 based on different parameter sets and can select the version with the highest response quality (e.g., the smallest deviation from the benchmark response, etc.).
[0093] Figure 5 The illustration depicts a process 500 of generating a response to a user query using a knowledge robot according to various embodiments of the present disclosure. In some embodiments, at least a portion of process 500 may be performed by chat module 132 and / or knowledge robot 200. Process 500 begins (in step 505) by receiving a user query from a user device. For example, knowledge robot 200 may receive a user query (e.g., user query 232) submitted by a user through UI module 208 and an interface presented on a device (e.g., user device 110, user device 180, merchant server 120, etc.).
[0094] In step 510, process 500 modifies the user query based on the context of the conversation. For example, the knowledge robot 200 may store previous conversations between the user and the knowledge robot 200 (e.g., user queries submitted by the user and responses generated by the knowledge robot 200 in response to the user queries) in the chat history data storage device 212. Since the context of previous conversations may help assist the knowledge robot 200 in correctly interpreting the user query 232, the query formatting module 202 may modify the user query 232 to generate a modified query 244 based on the context. This modification may include adding words to the user query 232, removing words from the user query 232, or replacing words in the user query 232 with other words.
[0095] Then, process 500 (in step 515) determines whether the response stored in the cache memory is available to respond to the user query. If it is determined that the response from the cache memory is available to respond to the user query, process 500 (in step 520) retrieves the response from the cache memory and provides the response to the user device. For example, knowledge robot 200 may analyze the modified query 244 to determine whether the modified query 244 corresponds to any key in the cache memory. In some embodiments, cache layer 240 may generate an embedding based on the modified query 244 and may determine whether the embedding corresponds to any key in the cache memory. Each key in cache layer 240 may include one or more embeddings generated based on a previously submitted user query. Thus, cache layer 240 may determine whether the embedding generated based on the modified query 244 is within a threshold distance of the embedding corresponding to the key in the cache memory. If there is a match between the embedding generated based on the modified query 244 and the key, cache layer 240 may retrieve the response corresponding to the key and may provide the response to the user device as a response to query 232.
[0096] On the other hand, if it is determined that any responses stored in the cache cannot be used to respond to a user query, process 500 (in step 525) retrieves a set of documents related to the modified user query from the document corpus using one or more search models. For example, document retrieval module 204 may use one or more search engines to retrieve relevant documents based on the modified query 244. In some embodiments, document retrieval module 204 may use text-based retrieval module 302 and semantic-based retrieval module 304 to retrieve relevant documents based on the modified query 244. Text-based retrieval module 302 may use inverted index 322 to identify a set of documents 332 related to the modified query 244 from the document corpus 312. Semantic-based retrieval module 304 may use vector index 324 to identify a set of documents 334 related to the modified query 244 from the document corpus 312. Ranking module 306 may select a subset of documents from document sets 332 and 334 as search results 246.
[0097] Then, process 500 (in step 530) generates a suggestion for the AI model based on the modified user query and document set, and (in step 535) obtains a response from the AI model. For example, upon receiving search result 246 (which includes a document set determined to be related to the modified query 244), knowledge robot 200 can use the modified query 244, search result 246, and context 242 to generate input (e.g., a suggestion) for AI module 206. AI module 206 can then generate response 234 based on the suggestion.
[0098] After obtaining a response (from the AI model or from a cache), process 500 (in step 540) verifies the response and (in step 545) provides the response to the user device. For example, online verification module 252 can verify response 234. If response 234 conforms to a set of criteria associated with the service provider, knowledge robot 200 can provide response 234 to the user device that submitted user query 232. On the other hand, if response 234 does not conform to the set of criteria, online verification module 252 can modify response 234 or replace response 234 with a default response before providing the modified response to the user device.
[0099] Figure 6 The illustration depicts a process 600 for retrieving documents related to a user query according to various embodiments of the present disclosure. In some embodiments, at least a portion of process 600 may be performed by chat module 132 and / or knowledge robot 200. Process 600 begins (at step 605) by receiving a user query. For example, knowledge robot 200 may receive a user query (e.g., user query 232) submitted by a user through UI module 208 and an interface presented on a device (e.g., user device 110, user device 180, merchant server 120, etc.).
[0100] Then, process 600 (in step 610) uses a text-based retrieval module and an inverted index to retrieve a first document set from the document corpus based on the user query, and (in step 615) uses a semantic-based retrieval module and a vector index to retrieve a second document set from the document corpus based on the user query. For example, document retrieval module 204 may include a text-based retrieval module 302 configured to use an inverted index 322 to identify a document set 332 related to the modified query 244. Document retrieval module 204 may also include a semantic-based retrieval module 304 configured to use a vector index 324 to identify a document set 334 related to the modified query 244.
[0101] Process 600 (in step 620) collectively ranks the first and second document sets, and (in step 625) determines a subset of documents from the first and second document sets based on the ranking. For example, text-based retrieval module 302 can determine a score for each document in document set 332 that is determined to be relevant to the modified query 244. This score can indicate the degree of relevance between the corresponding document and the modified query 244, so that if it is determined that the first document is more closely related to the modified query 244 than the second document, the first document can have a higher score than the second document. Similarly, semantic-based retrieval module 304 can determine a score for each document in document set 334 that is determined to be relevant to the modified query 244. Then, document retrieval module 204 can merge document set 332 and document set 334, and rank the documents in the merged set based on the scores. In some embodiments, document retrieval module 204 can select a subset of documents (e.g., the top 10 documents, etc.) as search results 246 for the modified query 244.
[0102] Process 600 (in step 630) determines whether the quality of a subset of documents is above a threshold. If the quality of the subset of documents is determined not to be above the threshold, process 600 (in step 635) provides a default response. On the other hand, if the quality of the subset of documents is determined to be above the threshold, process 600 (in step 640) provides the subset of documents to the AI model. For example, the document retrieval module may determine whether the quality of search result 246 is above the threshold (e.g., whether the collective score of search result 246, such as the average, median, etc., is above the threshold score, etc.). If the quality is determined not to be above the threshold, document retrieval module 204 may determine that the knowledge robot 200 does not have sufficient knowledge to respond to user query 232. Then, the knowledge robot 200 may terminate the process of AI module 206 generating a response to user query 232 and instead provide a default response to the user device (e.g., "We cannot answer your question", etc.).
[0103] On the other hand, if it is determined that the quality of the search result 246 is higher than the threshold, the document retrieval module 204 can provide the search result 246 to the AI module 206, so that the AI module can generate a response to the user query 232 based on the content extracted from the search result 246.
[0104] Figure 7The illustration shows an example artificial neural network 700 that can be used to implement machine learning models, such as a large language model associated with AI module 206, a natural language model 308, and a semantic-based retrieval module 304. As shown, the artificial neural network 700 comprises three layers—an input layer 702, a hidden layer 704, and an output layer 706. Each of layers 702, 704, and 706 may include one or more nodes (also referred to as “neurons”). For example, input layer 702 includes nodes 732, 734, 736, 738, 740, and 742; hidden layer 704 includes nodes 744, 746, and 748; and output layer 706 includes node 750. In this example, each node in a layer is connected to every node in an adjacent layer via an edge, and each edge is often associated with an adjustable weight. For example, node 732 in input layer 702 is connected to all nodes 744, 746, and 748 in hidden layer 704. Similarly, node 744 in the hidden layer is connected to all nodes 732, 734, 736, 738, 740, and 742 in the input layer 702 and node 750 in the output layer 706. Although for illustrative purposes only, each node in each layer in this example is fully connected to nodes in one or more adjacent layers, it is envisioned that nodes in different layers could be connected according to any other neural network topology as needed to perform the corresponding task.
[0105] Hidden layer 704 is an intermediate layer between the input layer 702 and the output layer 706 of the artificial neural network 700. While only one hidden layer of the artificial neural network 700 is shown for illustrative purposes, it is envisioned that the artificial neural network 700, used to implement any computer-based model, could include as many hidden layers as needed. Hidden layer 704 is configured to extract and transform the input data received from the input layer 702 through a series of weighted computations and activation functions.
[0106] In this example, the artificial neural network 700 receives a set of inputs and produces an output. Each node in the input layer 702 may correspond to a different input. For example, when the artificial neural network 700 is used to implement a machine learning model associated with the AI module 206, the nodes in the input layer 702 may correspond to different parameters and / or attributes of the prompt (which may be generated based on the modified query 244, context 242, and search result 246).
[0107] In some embodiments, each node 744, 746, and 748 in the hidden layer 704 generates a representation that may include mathematical computation (or algorithm) to produce values based on input values received from nodes 732, 734, 736, 738, 740, and 742. The mathematical computation may include assigning different weights (e.g., node weights, edge weights, etc.) to each data value received from nodes 732, 734, 736, 738, 740, and 742, performing a weighted sum of the inputs according to the weights assigned to each connection (e.g., each edge), and then applying an activation function associated with each node (or neuron) to the result. Nodes 744, 746, and 748 may include different algorithms (e.g., different activation functions) and / or be assigned different weights to data variables from nodes 732, 734, 736, 738, 740, and 742, such that each of nodes 744, 746, and 748 can produce different values based on the same input values received from nodes 732, 734, 736, 738, 740, and 742. The activation functions can be the same or different between different layers. Example activation functions include, but are not limited to, Sigmoid, hyperbolic tangent, Rectified Linear Unit (ReLU), leaky ReLU, Softmax, and so on. Thus, after several hidden layers, the input data received at input layer 702 is transformed into values indicating significantly different data characteristics corresponding to the task for which the artificial neural network 700 is designed to perform.
[0108] In some embodiments, the weights initially assigned to the input values of each node 744, 746, and 748 may be randomly generated (e.g., using a computer randomizer). The values generated by nodes 744, 746, and 748 can be used by nodes 750 in the output layer 706 to produce the output values of the artificial neural network 700 (e.g., responses to user queries, predictions, etc.). The number of nodes in the output layer depends on the nature of the task being processed. For example, in a binary classification problem, the output layer may consist of a single node representing the probability of belonging to a class (e.g., ...). Figure 7 (As shown in the example). In multi-class classification problems, the output layer may have multiple nodes, each representing the probability of belonging to a particular class. When the artificial neural network 700 is used to implement a machine learning model associated with the AI module 206, the output node 750 may be configured to generate new content (e.g., responses in natural language format) based on prompts.
[0109] In some embodiments, the artificial neural network 700 may be implemented on one or more hardware processors, such as a CPU (central processing unit), GPU (graphics processing unit), FPGA (field-programmable gate array), application-specific integrated circuit (ASIC), a dedicated AI accelerator like a TPU (tensor processing unit), and dedicated hardware accelerators specifically designed for the neural network computations described herein, etc. Example specific hardware for the neural network architecture may include, but is not limited to, Google Edge TPUs, Deep Learning Accelerators (DLAs), NVIDIA's AI-focused GPUs, etc. The hardware used to implement the neural network architecture is specifically configured based on factors such as the complexity of the neural network, the scale of the task (e.g., training time, input data size, training dataset size, etc.), and the desired performance.
[0110] An artificial neural network 700 can be trained using training data based on one or more loss functions and one or more hyperparameters. By iteratively training the artificial neural network 700 using training data via a feedback mechanism (e.g., comparing the output from the artificial neural network 700 with an expected output, also known as the "ground truth" or "label"), the parameters of the artificial neural network 700 (e.g., weights, bias parameters, coefficients in the activation function, etc.) can be adjusted according to one or more loss functions and based on one or more hyperparameters to achieve the objective of producing the optimal output in output layer 706, thereby minimizing the loss in the loss function. Given a loss, the negative gradient of the loss function is computed individually with respect to each weight of each layer. Such negative gradients are computed layer by layer, iterating backward from the last layer (e.g., from output layer 706 to input layer 702 of the artificial neural network 700). These gradients quantify the sensitivity of the network's output to parameter variations. These gradients are computed efficiently by applying the chain rule of calculus, propagating the gradients backward from output layer 706 to input layer 702.
[0111] Based on the calculated negative gradient, an optimization algorithm is used to minimize the loss, updating the parameters of the artificial neural network 700 from the last layer back to the input layer (backpropagation). Backpropagation from the last layer (e.g., output layer 706) to the input layer 702 can be performed over several training iterations on several training samples. In this way, the parameters of the artificial neural network 700 can be progressively updated in the direction that leads to smaller or minimized loss, indicating that the artificial neural network 700 has been trained to generate predicted output values closer to the target output value and improving prediction accuracy. Training can continue until a stopping criterion is met, such as reaching the maximum number of iterations or achieving satisfactory performance on validation data. At this point, the trained network can be used to make predictions on new, unseen data, such as predicting the frequency of related future events.
[0112] Figure 8 This is a block diagram of a computer system 800 suitable for implementing one or more embodiments of the present disclosure, including a service provider server 130, a merchant server 120, a user equipment 180, and a user equipment 110. In various implementations, each of user equipment 110 and 180 may include a mobile cellular phone suitable for wireless communication, a personal computer (PC), a laptop computer, a wearable computing device, etc., and each of service provider server 130 and merchant server 120 may include a network computing device, such as a server. Therefore, it should be understood that devices 110, 120, 130, and 180 can be implemented as computer system 800 in the following manner.
[0113] Computer system 800 includes a bus 812 or other communication mechanisms for transmitting information data, signals, and messages between various components of computer system 800. These components include an input / output (I / O) component 804 that processes user (i.e., sender, receiver, service provider) actions, such as selecting keys on a keypad / keyboard, selecting one or more buttons or links, etc., and sending corresponding signals to bus 812. I / O component 804 may also include output components, such as a display 802 and cursor controls 808 (e.g., keyboard, keypad, mouse, etc.). Display 802 may be configured to display a login page for logging into a user account or a checkout page for purchasing items from a merchant. Optional audio input / output component 806 may also be included to allow users to input information using speech by converting audio signals. Audio I / O component 806 allows users to hear audio. Transceiver or network interface 820 sends and receives signals between computer system 800 and other devices (e.g., another user device, merchant server, or service provider server) via network 822. In one embodiment, the transmission is wireless, although other transmission media and methods may also be suitable. Processor 814, which may be a microcontroller, digital signal processor (DSP), or other processing component, processes these various signals, for example, for display on computer system 800 or for transmission to other devices via communication link 824. Processor 814 may also control the transmission of information (such as cookies or IP addresses) to other devices.
[0114] The computer system 800 also includes a system memory component 810 (e.g., RAM), a static storage component 816 (e.g., ROM), and / or a disk drive 818 (e.g., a solid-state drive, hard disk drive). The computer system 800 performs specific operations by a processor 814 and other components by executing one or more sequences of instructions contained in the system memory component 810. For example, the processor 814 may execute the automated response functions described herein, such as according to processes 400, 500, and 600.
[0115] The logic may be encoded in a computer-readable medium, which can refer to any medium that participates in providing instructions to the processor 814 for execution. Such a medium can take many forms, including but not limited to non-volatile media, volatile media, and transmission media. In various implementations, non-volatile media include optical discs or magnetic disks, volatile media include dynamic memory, such as system memory component 810, and transmission media include coaxial cables, copper wires, and optical fibers, including conductors forming bus 812. In one embodiment, the logic is encoded in a non-transitory computer-readable medium. In one example, the transmission medium may take the form of sound waves or light waves, such as those generated during radio waves, optical communications, and infrared data communications.
[0116] Some common forms of computer-readable media include floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, any other optical media, punched cards, paper tapes, any other physical media with a perforated pattern, RAM, PROMs, EPROMs, FLASH-EPROMs, any other memory chips or cartridges, or any other media that a computer is suitable to read.
[0117] In various embodiments of this disclosure, the execution of the instruction sequence implementing this disclosure may be performed by a computer system 800. In various other embodiments of this disclosure, multiple computer systems 800 coupled to a network (e.g., a LAN, WLAN, PSTN, and / or various other wired or wireless networks, including telecommunications, mobile, and cellular telephone networks) via a communication link 824 may execute instruction sequences to implement this disclosure in coordination with each other.
[0118] Where applicable, the various embodiments provided in this disclosure may be implemented using hardware, software, or a combination of hardware and software. Furthermore, where applicable, the various hardware and / or software components described herein may be combined into composite components including software, hardware, and / or both, without departing from the spirit of this disclosure. Where applicable, the various hardware and / or software components described herein may be separated into sub-components including software, hardware, or both, without departing from the scope of this disclosure. Moreover, where applicable, it is contemplated that software components may be implemented as hardware components, and vice versa.
[0119] According to this disclosure, software, such as program code and / or data, may be stored on one or more computer-readable media. It is also contemplated that the software identified herein may be implemented using one or more networked and / or other forms of general-purpose or special-purpose computers and / or computer systems. Where applicable, the order of the various steps described herein may be altered, combined into compound steps, and / or separated into sub-steps to provide the features described herein.
[0120] The various features and steps described herein can be implemented as a system comprising one or more memories storing the various information described herein and one or more processors coupled to the one or more memories and networks, wherein the one or more processors are operable to perform the steps as described herein; implemented as a non-transitory machine-readable medium comprising a plurality of machine-readable instructions, which, when executed by the one or more processors, are adapted to cause the one or more processors to perform a method comprising the steps described herein; and implemented as a method executed by one or more devices, such as hardware processors, user equipment, servers, and other devices described herein.
[0121] The following claims pertain to various embodiments.
[0122] As described above, the additional embodiment includes a system comprising a non-transitory memory; and one or more hardware processors coupled to the non-transitory memory and configured to read instructions from the non-transitory memory to cause the system to perform operations including obtaining a document corpus corresponding to a first domain that can be used to generate a knowledge robot; providing a chat interface for the knowledge robot, the chat interface being configured to receive user queries from a user device; generating one or more indexes based on the document corpus that can be used by one or more search models of the knowledge robot, wherein the one or more search models are configured to generate search results using the one or more indexes, the search results including a set of documents from the document corpus associated with responses to the user queries; and integrating the one or more search models and a machine learning model within the knowledge robot, wherein the machine learning model is configured to generate a response to the user queries based on the search results, wherein the response includes multiple words in natural language format, and wherein the chat interface is further configured to present the response on the user device.
[0123] In one or more embodiments of the above system, 1) the operation further includes obtaining multiple user queries associated with the first domain; determining multiple target responses corresponding to the multiple user queries; generating multiple responses using the knowledge robot based on the multiple user queries; and performing a semantic comparison between the multiple target answers and the multiple responses; 2) the operation further includes adjusting one or more parameters associated with the machine learning model based on the semantic comparison between the multiple target responses and the multiple responses; 3) the operation further includes adjusting one or more parameters associated with the one or more search models based on the semantic comparison between the multiple target responses and the multiple responses; 4) the operation further includes determining multiple target responses based on the semantic comparison between the multiple target responses and the multiple responses. The document corpus lacks information associated with a specific topic; obtains a set of documents associated with the specific topic; and adds the document set to the document corpus; 5) the plurality of user queries includes a first set of user queries with a query length below a threshold and a second set of user queries with a query length above the threshold; and / or 6) the operation further includes, in response to receiving a second user query from a second user device, performing a second semantic comparison between the second user query and a plurality of keys stored in a cache memory; determining a match between the second user query and a specific key among the plurality of keys based on the second semantic comparison; retrieving a value corresponding to the specific key from the cache memory without using the machine learning model to process the second user query; and providing content to the second user device based on the value.
[0124] In another embodiment, a method includes: providing a chat interface to a knowledge robot, the chat interface being configured to receive a user query associated with a first domain by a computer system accessing a document corpus associated with the first domain; the computer system generating one or more indexes based on the document corpus that can be used by one or more search models of the knowledge robot, wherein the one or more search models are configured to use the one or more indexes to identify a set of documents associated with the user query from the document corpus; the computer system integrating the one or more search models with an artificial intelligence (AI) model within the knowledge robot, wherein the AI model is configured to generate a response to the user query based on the document set, wherein the response includes content derived from the document set; and presenting the response on the chat interface.
[0125] In one or more embodiments of the above method, 1) the method further includes modifying the response to the user query based on a set of strategies; 2) the modification includes at least one of the following: replacing a first word in the response with a second word, removing one or more words from the response, or modifying at least one word from the response; 3) the method further includes receiving a second query from a device; determining that the second query is not associated with the first domain; and providing a default response to the device in response to determining that the second query is not associated with the first domain and not using the AI model to process the second query; 4) the method further includes obtaining a plurality of test queries associated with the first domain; determining a plurality of benchmark responses corresponding to the plurality of test queries; generating a plurality of test responses based on the plurality of test queries using the knowledge robot; and determining a deviation between the plurality of benchmark responses and the plurality of test responses based on a semantic comparison between the plurality of benchmark responses and the plurality of test responses; 5) the method further includes adjusting one or more parameters associated with the AI model in response to determining that the deviation exceeds a threshold; and / or 6) the method further includes adjusting one or more parameters associated with the one or more search models in response to determining that the deviation exceeds a threshold.
[0126] In another embodiment, a non-transitory machine-readable medium stores machine-readable instructions executable to cause a machine to perform operations including accessing a document corpus associated with the first domain; generating one or more indexes based on the document corpus for use by one or more search models of the knowledge robot, wherein the one or more search models are configured to use the one or more indexes to generate search results including a set of documents from the document corpus based on a user query; and integrating the one or more search models with a machine learning model, wherein the machine learning model is configured to generate a response to the user query based on the search results, wherein the response includes multiple words in natural language format.
[0127] In one or more embodiments of the non-transitory machine-readable medium described above, 1) the operation further includes obtaining user queries associated with the first domain; determining multiple target answers corresponding to the multiple queries; using the knowledge robot, generating multiple candidate answers based on the multiple user queries; and performing a semantic comparison between the multiple target answers and the candidate answers; 2) the operation further includes adjusting at least a first parameter associated with the machine learning model or a second parameter associated with the one or more search models based on the semantic comparison between the multiple target answers and the multiple candidate answers; 3) the operation further includes determining, based on the semantic comparison between the multiple target answers and the multiple answers, that the document corpus lacks information associated with a specific topic corresponding to the first domain; obtaining a document set associated with the specific topic; and adding the document set to the document corpus; 4) the operation further includes modifying the response to the user query based on a set of strategies; and presenting the modified response on an interface; and / or 5) the modification includes at least one of the following: replacing a first word in the response with a second word, modifying at least one word from the response, or removing one or more words from the response.
Claims
1. A system comprising: Non-transitory memory; as well as One or more hardware processors, coupled to the non-transitory memory and configured to read instructions from the non-transitory memory to cause the system to perform operations, said operations including: Receive user queries associated with the first domain from the user equipment; One or more search models are used to identify a set of documents related to the user query from a document corpus corresponding to the first domain; Inputs for generative artificial intelligence (AI) models are generated by combining the user query with the document set; Using the generative AI model, a response to the user query is generated based on the input, wherein the response is based on information from at least two documents in the document set; and The response is provided to the user equipment.
2. The system of claim 1, wherein, The user query is in natural language format.
3. The system of claim 1, wherein, The one or more search models include a text-based search model, which is configured to identify one or more documents from the document corpus based on one or more keywords extracted from the user query.
4. The system as claimed in claim 1, wherein, The one or more search models include a semantic-based search model, which is configured to (i) derive the contextual meaning of the user query by parsing multiple words within the user query, and (ii) identify one or more documents from the document corpus based on the contextual meaning of the user query.
5. The system as described in claim 4, wherein, The semantic-based search model is also configured to analyze the multiple words by parsing them forward and backward.
6. The system as claimed in claim 1, wherein, The one or more search models include: (i) a text-based search model configured to identify one or more first documents associated with the user query from the document corpus based on one or more keywords extracted from the user query; and (ii) a semantic-based search model configured to identify one or more second documents associated with the user query from the document corpus based on contextual meaning derived from the user query, wherein the operation further includes: Analyze the one or more first documents and the one or more second documents; The one or more first documents and the one or more second documents are ranked based on the analysis; and Based on the ranking, a set of documents relevant to the user query is selected from the one or more first documents and the one or more second documents.
7. The system as claimed in claim 1, wherein, The response consists of paragraphs of words in natural language format.
8. A method comprising: The computer system receives user queries from the user equipment. Based on a specific domain associated with the user query, a document corpus is accessed from multiple document corpora. The computer system uses one or more search models to determine one or more documents from the document corpus that are associated with the response to the user query; Using a machine learning model, a response to the user query is generated based on the user query and the one or more documents, wherein the response includes content generated based on information extracted from at least two of the one or more documents; and The response is provided to the user equipment.
9. The method of claim 8, wherein, The user query is a first user query that is part of a dialogue between the user of the user device and the knowledge robot, and the method further includes: Retrieve the chat history associated with the user on the user device, wherein the chat history includes one or more user queries previously submitted by the user and one or more responses generated by the machine learning model for the one or more user queries; The context is derived based on the chat history; and The first user query is modified based on the context, wherein, based on the modified first user query, the one or more documents are determined to be associated with the first query.
10. The method of claim 9, wherein, The modification includes, based on at least one of the one or more user queries or the one or more responses, performing at least one of the following: adding one or more words to the first user query, deleting one or more words from the first user query, or revising one or more words from the first user query.
11. The method of claim 9, wherein, The input is further generated based on combining the context with the modified user question and the document set.
12. The method of claim 8, further comprising: Based on the analysis of the user query, it is determined from multiple domains that the user query is associated with the specific domain.
13. The method of claim 8, wherein, The one or more search models include: (i) a text-based search model configured to identify a first document set from the document corpus based on one or more keywords extracted from the user query; and (ii) a semantic-based search model configured to identify a second document set from the document corpus based on contextual meaning derived from the user query, wherein the method further includes: Determine a score for each document in the first document set and the second document set; The first and second document sets are ranked based on the scores determined for each document in the first and second document sets; and One or more documents are selected from the first document set and the second document set based on the ranking.
14. The method of claim 8, wherein, The response includes words in natural language format.
15. A non-transitory machine-readable medium storing machine-readable instructions thereon, the instructions being executable to cause a machine to perform operations, the operations including: During a session with the service provider, user queries are received from the user's device; Use one or more search models to determine one or more documents from a document corpus that are associated with the response to the user query; Using a machine learning model, a response to the user query is generated based on the user query and the one or more documents, wherein the response includes content generated based on information extracted from at least two of the one or more documents; and The response is provided on the user interface of the user device during the session.
16. The non-transitory machine-readable medium of claim 15, wherein, The one or more search models include a text-based search model, which is configured to identify a first document set from the document corpus based on one or more keywords extracted from the user query.
17. The non-transitory machine-readable medium of claim 15, wherein, The one or more search models include a semantic-based search model, which is configured to (i) derive the contextual meaning of the user query by parsing multiple words within the user query, and (ii) identify a second document set from the document corpus based on the contextual meaning of the user query.
18. The non-transitory machine-readable medium of claim 17, wherein, The semantic-based search model is also configured to analyze the multiple words by parsing them forward and backward.
19. The non-transitory machine-readable medium of claim 15, wherein, The user query is a first user query that is part of a conversation between the user of the user device and the knowledge robot during the session, and the operation further includes: Retrieve the chat history associated with the user on the user device, wherein the chat history includes one or more user queries previously submitted by the user and one or more responses generated by the machine learning model for the one or more user queries; The context is derived based on the chat history; and The first user query is modified based on the context, wherein, based on the modified first user query, the one or more documents are determined to be associated with a response to the first user query.
20. The non-transitory machine-readable medium of claim 19, wherein, The modification includes, based on at least one of the one or more user queries or the one or more responses, performing at least one of the following: adding one or more words to the first user query, deleting one or more words from the first user query, or revising one or more words from the first user query.