System, method, and computer program product for single thread messaging using episodic
Provided are systems, methods, and computer program products for single thread messaging using episodic memory. The system includes at least one server computer configured to generate at least one response to at least one user query input into a dialog window displayed on a user device, determine a chatbot episode has ended based on a new user query input into the dialog window, store the plurality of messages in episodic memory for the chatbot episode, search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query, extract messages from the at least one previous chatbot episode, and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
Latest Mistral AI SAS Patents:
This disclosure relates generally to machine-learning and, in some non-limiting embodiments or aspects, systems, methods, and computer program products for single thread messaging using episodic memory.
2. Technical ConsiderationsExisting chatbot interfaces include chat histories listed on a side of a primary chatbot graphical user interface (GUI). These historic chats are not often used and continually accumulate in a manner that clutters the GUI. If a user wishes to revisit an old chat history, it is often difficult and cumbersome for the user to locate the chat from a long list, leading users to initiate a new chatbot interaction that lacks historic context and expends resources by generating content that was already fully or partially generated in a historic chat. Initiating a new chatbot interaction uses recent context from previous interactions, even if such interactions are unrelated to the new interaction, due to limitations on the size (e.g., number of tokens) of the context window.
SUMMARYAccording to non-limiting embodiments or aspects, provided is a method comprising: generating, with at least one computing device and a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determining, with at least one computing device, a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; storing, with at least one computing device, the plurality of messages in episodic memory for the chatbot episode; searching, with at least one computing device and based on the new user query, episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode; extracting, with at least one computing device, messages from the at least one previous chatbot episode; and generating, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
In non-limiting embodiments or aspects, the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and the plurality of messages does not appear in the primary chat dialog interface. In non-limiting embodiments or aspects, wherein determining the chatbot episode has ended comprises: determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and determining the distance satisfies a threshold, the chatbot episode is determined to have ended in response to the distance satisfying the threshold. In non-limiting embodiments or aspects, the method further comprises: generating, with at least one computing device, a summary of the chatbot episode based on the plurality of messages, the summary is stored with the episodic memory for the chatbot episode. In non-limiting embodiments or aspects, the method further comprises: generating at least one embedding based on at least one of the summary and the plurality of messages, the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode. In non-limiting embodiments or aspects, the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold. In non-limiting embodiments or aspects, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model. In non-limiting embodiments or aspects, the method further comprises: generating at least one tag for the chatbot episode, the at least one tag is stored with the episodic memory for the chatbot episode. In non-limiting embodiments or aspects, the method further comprises: automatically displaying the dialog window on a current desktop of the user device in response to a user shortcut action.
According to non-limiting embodiments or aspects, provided is a system comprising: at least one server computer comprising at least one processor, the at least one server computer configured to: generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; store the plurality of messages in episodic memory for the chatbot episode; search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query; extract messages from the at least one previous chatbot episode; and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
In non-limiting embodiments or aspects, the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and the plurality of messages does not appear in the primary chat dialog interface. In non-limiting embodiments or aspects, wherein determining the chatbot episode has ended comprises: determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and determining the distance satisfies a threshold, the chatbot episode is determined to have ended in response to the distance satisfying the threshold. In non-limiting embodiments or aspects, the at least one server computer is further configured to: generate a summary of the chatbot episode based on the plurality of messages, the summary is stored with the episodic memory for the chatbot episode. In non-limiting embodiments or aspects, the at least one server computer is further configured to: generate at least one embedding based on at least one of the summary and the plurality of messages, the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode. In non-limiting embodiments or aspects, the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold. In non-limiting embodiments or aspects, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model. In non-limiting embodiments or aspects, the at least one server computer is further configured to: generate at least one tag for the chatbot episode, the at least one tag is stored with the episodic memory for the chatbot episode. In non-limiting embodiments or aspects, the at least one server computer is further configured to: automatically display the dialog window on a current desktop of the user device in response to a user shortcut action.
According to non-limiting embodiments or aspects, provided is a computer program product comprising at least one non-transitory computer-readable medium including program instructions that, when executed by at least one computing device, cause the at least one computing device to: generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; store the plurality of messages in episodic memory for the chatbot episode; search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query; extract messages from the at least one previous chatbot episode; and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model. In non-limiting embodiments or aspects, the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and the plurality of messages does not appear in the primary chat dialog interface.
Further non-limiting embodiments and aspects are provided in the following clauses:
Clause 1: A method comprising: generating, with at least one computing device and a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determining, with at least one computing device, a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; storing, with at least one computing device, the plurality of messages in episodic memory for the chatbot episode; searching, with at least one computing device and based on the new user query, episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode; extracting, with at least one computing device, messages from the at least one previous chatbot episode; and generating, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
Clause 2: The method of clause 1, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
Clause 3: The method of any of clauses 1-2, wherein determining the chatbot episode has ended comprises: determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and determining the distance satisfies a threshold, wherein the chatbot episode is determined to have ended in response to the distance satisfying the threshold.
Clause 4: The method of any of clauses 1-3, further comprising: generating, with at least one computing device, a summary of the chatbot episode based on the plurality of messages, wherein the summary is stored with the episodic memory for the chatbot episode.
Clause 5: The method of any of clauses 1-4, further comprising: generating at least one embedding based on at least one of the summary and the plurality of messages, wherein the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode.
Clause 6: The method of any of clauses 1-5, wherein the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold.
Clause 7: The method of any of clauses 1-6, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model.
Clause 8: The method of any of clauses 1-7, further comprising: generating at least one tag for the chatbot episode, wherein the at least one tag is stored with the episodic memory for the chatbot episode.
Clause 9: The method of any of clauses 1-8, further comprising: automatically displaying the dialog window on a current desktop of the user device in response to a user shortcut action.
Clause 10: A system comprising: at least one server computer comprising at least one processor, the at least one server computer configured to: generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; store the plurality of messages in episodic memory for the chatbot episode; search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query; extract messages from the at least one previous chatbot episode; and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
Clause 11: The system of clause 10, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
Clause 12: The system of any of clauses 10-11, wherein determining the chatbot episode has ended comprises: determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and determining the distance satisfies a threshold, wherein the chatbot episode is determined to have ended in response to the distance satisfying the threshold.
Clause 13: The system of any of clauses 10-12, wherein the at least one server computer is further configured to: generate a summary of the chatbot episode based on the plurality of messages, wherein the summary is stored with the episodic memory for the chatbot episode.
Clause 14: The system of any of clauses 10-13, wherein the at least one server computer is further configured to: generate at least one embedding based on at least one of the summary and the plurality of messages, wherein the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode.
Clause 15: The system of any of clauses 10-14, wherein the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold.
Clause 16: The system of any of clauses 10-15, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model.
Clause 17: The system of any of clauses 10-16, wherein the at least one server computer is further configured to: generate at least one tag for the chatbot episode, wherein the at least one tag is stored with the episodic memory for the chatbot episode.
Clause 18: The system of any of clauses 10-17, wherein the at least one server computer is further configured to: automatically display the dialog window on a current desktop of the user device in response to a user shortcut action.
Clause 19: A computer program product comprising at least one non-transitory computer-readable medium including program instructions that, when executed by at least one computing device, cause the at least one computing device to: generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; store the plurality of messages in episodic memory for the chatbot episode; search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query; extract messages from the at least one previous chatbot episode; and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages into a context window of the machine-learning model.
Clause 20: The computer program product of clause 19, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
These and other features and characteristics of the present disclosure, as well as the methods of operation and functions of the related elements of structures and the combination of parts and economies of manufacture, will become more apparent upon consideration of the following description and the appended claims with reference to the accompanying drawings, all of which form a part of this specification, wherein like reference numerals designate corresponding parts in the various figures. It is to be expressly understood, however, that the drawings are for the purpose of illustration and description only and are not intended as a definition of the limits of the invention.
Additional advantages and details are explained in greater detail below with reference to the non-limiting, exemplary embodiments that are illustrated in the accompanying schematic figures, in which:
For purposes of the description hereinafter, the terms “end,” “upper,” “lower,” “right,” “left,” “vertical,” “horizontal,” “top,” “bottom,” “lateral,” “longitudinal,” and derivatives thereof shall relate to the embodiments as they are oriented in the drawing figures. However, it is to be understood that the embodiments may assume various alternative variations and step sequences, except where expressly specified to the contrary. It is also to be understood that the specific devices and processes illustrated in the attached drawings, and described in the following specification, are simply exemplary embodiments or aspects of the invention. Hence, specific dimensions and other physical characteristics related to the embodiments or aspects disclosed herein are not to be considered as limiting.
No aspect, component, element, structure, act, step, function, instruction, and/or the like used herein should be construed as critical or essential unless explicitly described as such. Also, as used herein, the articles “a” and “an” are intended to include one or more items and may be used interchangeably with “one or more” and “at least one.” Furthermore, as used herein, the term “set” is intended to include one or more items (e.g., related items, unrelated items, a combination of related and unrelated items, and/or the like) and may be used interchangeably with “one or more” or “at least one.” Where only one item is intended, the term “one” or similar language is used. Also, as used herein, the terms “has,” “have,” “having,” or the like are intended to be open-ended terms. Further, the phrase “based on” is intended to mean “based at least partially on” unless explicitly stated otherwise.
As used herein, the term “computing device” may refer to one or more devices configured to process data. A computing device may include one or more processors, such as Central Processing Units (CPUs), Graphics Processing Units (GPUs), microcontrollers, integrated circuits, field-programmable gate arrays (FPGAs), and/or the like. A computing device may, in some examples, include components to receive, process, and output data, such as a processor, a display, a memory, an input device, a network interface, and/or the like. A computing device may be a mobile device. As an example, a mobile device may include a cellular phone (e.g., a smartphone or standard cellular phone), a portable computer, a wearable device (e.g., watches, glasses, lenses, clothing, and/or the like), a personal digital assistant (PDA), and/or other like devices. A computing device may also be a desktop computer, server computer, or other form of non-mobile computer. In some non-limiting embodiments, a computing device may include a biological or quantum processing device.
As used herein, the term “server” may refer to or include one or more computing devices that are operated by or facilitate communication and processing for multiple parties in a network environment, such as the Internet, although it will be appreciated that communication may be facilitated over one or more public or private network environments and that various other arrangements are possible. Further, multiple computing devices (e.g., servers, mobile devices, etc.) directly or indirectly communicating in the network environment may constitute a “system.” Reference to “a server,” “a processor,” or “a computing device,” as used herein, may refer to a previously recited server, processor, and/or computing device that is recited as performing a previous step or function, a different server, processor, or computing device, and/or a combination of computing devices. For example, as used in the specification and the claims, a first computing device, a first server, and/or a first processor that is recited as performing a first step or function may refer to the same or different computing device, server, and/or a processor recited as performing a second step or function.
Provided herein are systems, methods, and computer program products for single thread messaging using episodic memory. Non-limiting embodiments provide for a message-based chatbot dialog between a user and an automated system controlled by one or more artificial intelligence algorithms. For example, a chatbot dialog may include a conversation between a user and an automated bot (e.g., a chatbot) including text, audio, video, images, and/or the like. In non-limiting embodiments, a chatbot dialog may be conducted through a dialog window, through a primary chatbot interface, and/or the like. As used herein, the term “dialog window” refers to a GUI or portion of a GUI displayed on a user device that includes a chatbot dialog. A dialog window may include input options for the user and a display of responses from the automated system. In non-limiting embodiments, the chatbot may be driven by a language model, such as a Large Language Model (LLM), Small Language Model (SML), and/or text diffusion model, as examples, configured to engage in a conversational dialog with a user through queries (e.g., prompts, commands, requests, questions, and/or the like) input by the user.
Non-limiting embodiments of the systems and methods described herein provide for dynamic context to be provided to new chatbot interactions, allowing for chatbot interactions to have context from historic chatbot interactions in a single thread rather than potentially irrelevant context from recent interactions. As used herein, the term “single thread messaging” refers to an isolated message-based chatbot dialog that exists independent of and separate from a general and/or primary message-based chatbot dialog. For example, a single thread of messages may include a chatbot dialog that does not necessarily use the immediately preceding chatbot dialog as context and is therefore not influenced by previous threads of messages.
Non-limiting embodiments of the systems and methods described herein manage the limited-size context window of a machine-learning model to preserve computational resources, avoid duplicative processing and inferences, and increase the accuracy of the responsive output with respect to the intention and goal of the user. Further, by providing dual chatbot interfaces, non-limiting embodiments described herein allow for users to initiate a new chatbot interaction quickly and efficiently without disrupting an ongoing chatbot interaction in a primary chatbot window and/or without leaving another GUI being interacted with. By providing a floating chatbot dialog in response to a shortcut action, non-limiting embodiments provide streamlined access to machine-learning tools without requiring a user to open a primary chatbot interface through a browser or desktop application and navigate away from a current task. Further benefits and improvements will be apparent to those skilled in the art.
Referring now to
With continued reference to
Still referring to
In non-limiting embodiments, the computing device 100 may generate a response 120 to the user query 112 and communicate the response to the user computing device 102. For example, the response 120 may be generated by generating an inference request 166 and inputting the inference request 116 to a machine-learning model 114 to receive an output 118. In non-limiting embodiments, the computing device 100 may pass the user query 112 to the machine-learning model 114 as the inference request 116 or may generate an inference request 116 based on the user query 112 without including the full user query 112. In non-limiting embodiments, the computing device 100 may pass the output 118 to the user computing device 102 as the response 120 or may generate a response 120 based on the output 118. A chatbot interaction may continue between the user computing device 102 and the computing device 100 with additional user queries (e.g., query 122) and responses (e.g., response 124).
With continued reference to
With continued reference to
Still referring to
With continued reference to
In non-limiting embodiments, the system 1000 may manage limitations on the number of tokens that are input to the machine-learning model 114 as context. For example, the system 1000 may manage a token budget that is divided between messages and metadata (e.g., tags and/or summaries, such as a situation summary, outcome summary, and/or lessons summary) for the chatbot episode. In some non-limiting embodiments, messages or a combination of messages and metadata may be used to limit the amount of tokens. In some non-limiting embodiments, only metadata context may be used. In some non-limiting embodiments, multiple tiers of context (e.g., different ratios and/or combinations of messages and metadata) may be considered for each separate chatbot episode, such that some chatbot episodes may include more metadata context than others.
Referring to
With continued reference to
Referring now to
At step 300, a shortcut action is detected. A shortcut action may include a keyboard shortcut (e.g., combination of keys) or any other action (e.g., a gesture of mouse movement or touchscreen interaction, etc.). In response to the shortcut action, a dialog window may be displayed at step 302 on top of a current GUI being viewed. For example, a dialog window as shown in
With continued reference to
Once the chatbot episode has ended at step 310, the method may proceed to step 312 and the messages for the chatbot episode that was ended may be stored in episodic memory. For example, the messages (e.g., queries and responses) for the ended chatbot episode may be stored in relation to a unique episode identifier and/or in a separate data structure. In non-limiting embodiments, storing the messages in episodic memory may include converting the messages to embeddings and storing the embeddings as episodic memory. In non-limiting embodiments, the messages may be stored as plaintext in episodic memory. In non-limiting embodiments, the messages may be used to generate one or more summaries and/or tags that are stored in episodic memory as metadata. For example, one or more of the messages of a chatbot episode may be input into a machine-learning model to generate a summary of the chatbot episode and/or tags representing the chatbot episode, and the summary and/or tags may be stored in episodic memory as an embedding and/or plaintext. In non-limiting embodiments, messages may be clustered into episodes with one or more clustering algorithms. In non-limiting embodiments, the episodic memory for a chatbot episode may be stored in real-time with the interaction (e.g., during the chatbot dialog as the messages are provided).
In non-limiting embodiments, the episodic memory for a chatbot episode may include a title, an original message (e.g., an initial query or response), other messages (e.g., related queries and/or responses from the same conversation), metadata (e.g., summaries, tags, timestamps, linked applications, user actions during the episode, and/or the like). In non-limiting embodiments, the summary for a chatbot episode may be generated in multiple parts. For example, a summary may be generated with a situation summary, an outcomes summary, and/or a lessons summary to facilitate reuse of the episode. The situation summary may provide a summary of the user queries and/or intentions. The lessons summary may provide patterns and/or user preferences from the chatbot episode, such as user preference of output formats, user preference of acknowledgements of concerns, as well as user technical experience, expected inputs and/or formatting from the user, and/or other user traits and/or preferences. In non-limiting embodiments, the episodic memory for a chatbot episode may include one or more tags. The tags may be generated by inputting the summary and/or messages of the episode into a machine-learning model to return a predetermined number of tags that represent the episode. Tags may include keywords and/or hyphenated phrases and may be identified from a list of tags or may be uniquely generated by a machine-learning model.
Still referring to
In response to identifying one or more episodes, the method may proceed to step 316 to extract the messages and/or metadata from the episode. For example, at step 316 one or more episodes that most closely match (e.g., have the shortest distance from) the query may be retrieved from memory and the messages and/or metadata extracted. The messages and/or metadata may be extracted by retrieving plaintext messages and/or embeddings stored in relation to the searched embeddings (e.g., the embeddings for the summaries, for example) and storing the extracted information in temporary memory. At step 318, a response to the first query for the new chatbot episode may be generated as described in connection with step 306. For example, the extracted messages and/or metadata may be input into a context window of an inference request to a machine-learning model. The method may then return to step 308 to continue the chatbot episode until it ends at step 310.
Referring now to
At step 320, a query may be received from a user. A query may ask a question, request an output, and/or the like. At step 322, it may be determined whether a message (e.g., the query from the user) is related to a previously received message (e.g., a previous query and/or previous response generated in response to the previous query). In non-limiting embodiments, the comparison may be performed by converting the message(s) into one or more embeddings and comparing the embeddings to embeddings for previous messages and/or metadata (e.g., summaries, tags, and/or the like) to determine a similarity. If the message is not related (e.g., similar within a threshold), the method may continue to step 324 and a new episodic memory may be created for the prior messages (e.g., the prior dialog of a chatbot episode). In non-limiting embodiments, the episodic memory for a chatbot episode may include a title, an original message (e.g., an initial query or response), other messages (e.g., related queries and/or responses from the same conversation), metadata (e.g., summaries, tags, timestamps, linked applications, user actions during the episode, and/or the like).
If the message is determined to be related at step 322, the method may proceed to step 328 in some non-limiting embodiments to identify additional context for the ongoing chatbot episode. If the message is not related at step 322, step 328 may be performed to identify context for a new chatbot episode. At step 328, the episodic memory may be searched to identify one or more episodes related to the message(s). For example, the episodic memory may be searched based on the query and/or response analyzed at step 322. At step 330, the episodic memory identified during the search may be used to enrich context data for an inference request to a machine-learning model to determine a response to the user query (e.g., the query received at step 320). At step 332, the response is generated by the machine-learning model based on the enriched context.
Referring now to
Referring now to
With continued reference to
Device 900 may perform one or more processes described herein. Device 900 may perform these processes based on processor 904 executing software instructions stored by a computer-readable medium, such as memory 906 and/or storage component 908. A computer-readable medium may include any non-transitory memory device. A memory device includes memory space located inside of a single physical storage device or memory space spread across multiple physical storage devices. Software instructions may be read into memory 906 and/or storage component 908 from another computer-readable medium or from another device via communication interface 914. When executed, software instructions stored in memory 906 and/or storage component 908 may cause processor 904 to perform one or more processes described herein. Additionally, or alternatively, hardwired circuitry may be used in place of or in combination with software instructions to perform one or more processes described herein. Thus, embodiments described herein are not limited to any specific combination of hardware circuitry and software. The term “programmed or configured,” as used herein, refers to an arrangement of software, hardware circuitry, or any combination thereof on one or more devices.
Although embodiments have been described in detail for the purpose of illustration, it is to be understood that such detail is solely for that purpose and that the disclosure is not limited to the disclosed embodiments or aspects, but, on the contrary, is intended to cover modifications and equivalent arrangements that are within the spirit and scope of the appended claims. For example, it is to be understood that the present disclosure contemplates that, to the extent possible, one or more features of any embodiment or aspect can be combined with one or more features of any other embodiment or aspect.
Claims
1. A method comprising:
- generating, with at least one computing device and a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device;
- determining, with at least one computing device, a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query;
- storing, with at least one computing device, the plurality of messages and associated metadata in episodic memory for the chatbot episode;
- searching, with at least one computing device and based on the new user query, episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode;
- extracting, with at least one computing device and from the at least one previous chatbot episode, a combination of messages from the plurality of messages and metadata from the associated metadata based on a token budget and a token length of the messages and the metadata; and
- generating, with the machine-learning model, a response to the new user query based on inputting the extracted messages and metadata into a context window of the machine-learning model.
2. The method of claim 1, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
3. The method of claim 1, wherein determining the chatbot episode has ended comprises:
- determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and
- determining the distance satisfies a threshold, wherein the chatbot episode is determined to have ended in response to the distance satisfying the threshold.
4. The method of claim 1, further comprising:
- generating, with at least one computing device, a summary of the chatbot episode based on the plurality of messages, wherein the summary is stored with the episodic memory for the chatbot episode.
5. The method of claim 4, further comprising:
- generating at least one embedding based on at least one of the summary and the plurality of messages, wherein the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode.
6. The method of claim 5, wherein the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold.
7. The method of claim 4, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model.
8. The method of claim 1, further comprising:
- generating at least one tag for the chatbot episode, wherein the at least one tag is stored with the episodic memory for the chatbot episode.
9. The method of claim 1, further comprising:
- automatically displaying the dialog window on a current desktop of the user device in response to a user shortcut action.
10. A system comprising:
- at least one server computer comprising at least one processor, the at least one server computer configured to: generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device; determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query; store the plurality of messages and associated metadata in episodic memory for the chatbot episode; search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query; extract, from the at least one previous chatbot episode, a combination of messages from the plurality of messages and metadata from the associated metadata based on a token budget and a token length of the messages and the metadata; and generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages and metadata into a context window of the machine-learning model.
11. The system of claim 10, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
12. The system of claim 10, wherein determining the chatbot episode has ended comprises:
- determining a distance between the new user query and at least one message of the plurality of messages based on comparing the new user query to the at least one message; and
- determining the distance satisfies a threshold, wherein the chatbot episode is determined to have ended in response to the distance satisfying the threshold.
13. The system of claim 10, wherein the at least one server computer is further configured to:
- generate a summary of the chatbot episode based on the plurality of messages, wherein the summary is stored with the episodic memory for the chatbot episode.
14. The system of claim 13, wherein the at least one server computer is further configured to:
- generate at least one embedding based on at least one of the summary and the plurality of messages, wherein the at least one embedding is stored in the episodic memory for the chatbot episode, and wherein searching the episodic memory for a plurality of previous chatbot episodes to identify the at least one previous chatbot episode is based on comparing the at least one embedding to an embedding of a summary for the at least one previous chatbot episode.
15. The system of claim 14, wherein the at least one previous chatbot episode is identified in response to determining that a distance between the at least one embedding and the embedding of the summary for the at least one previous chatbot episode satisfies a threshold.
16. The system of claim 13, wherein generating the summary comprises inputting at least a portion of the plurality of messages into a language model.
17. The system of claim 10, wherein the at least one server computer is further configured to:
- generate at least one tag for the chatbot episode, wherein the at least one tag is stored with the episodic memory for the chatbot episode.
18. The system of claim 10, wherein the at least one server computer is further configured to:
- automatically display the dialog window on a current desktop of the user device in response to a user shortcut action.
19. A computer program product comprising at least one non-transitory computer-readable medium including program instructions that, when executed by at least one computing device, cause the at least one computing device to:
- generate with a machine-learning model, at least one response to at least one user query input into a dialog window displayed on a user device;
- determine a chatbot episode has ended based on a new user query input into the dialog window, the chatbot episode comprising a plurality of messages including the at least one response and the at least one user query;
- store the plurality of messages and associated metadata in episodic memory for the chatbot episode;
- search episodic memory for a plurality of previous chatbot episodes to identify at least one previous chatbot episode based on the new user query;
- extract, from the at least one previous chatbot episode, a combination of messages from the plurality of messages and metadata from the associated metadata based on a token budget and a token length of the messages and the metadata; and
- generate, with the machine-learning model, a response to the new user query based on inputting the extracted messages and metadata into a context window of the machine-learning model.
20. The computer program product of claim 19, wherein the dialog window is independent of a primary chat dialog interface configured to conduct an automated chatbot dialog with the user with the machine-learning model, and wherein the plurality of messages does not appear in the primary chat dialog interface.
| 12524452 | January 13, 2026 | Kranjc |
| 20170019356 | January 19, 2017 | Gilbert |
| 20250103625 | March 27, 2025 | Addanki |
| 20250371449 | December 4, 2025 | Thompson, III |
| 20260064945 | March 5, 2026 | Wang |
| 20260080099 | March 19, 2026 | Bhavani |
| 20260087456 | March 26, 2026 | Yoo |
Type: Grant
Filed: Feb 26, 2026
Date of Patent: Nov 17, 2026
Assignee: Mistral AI SAS (Paris)
Inventor: Octave Raimbault (Paris)
Primary Examiner: Ruolei Zong
Application Number: 19/550,841
International Classification: H04L 51/02 (20220101); H04L 51/216 (20220101);