Event-triggered question generation for multi-modal content retrieval
Devices and techniques are generally described for event-triggered multimodal enrichment and question generation in search. First event data may be received from an event stream. A first prompt for a first language model may be generated. The first prompt may include the first event data and a first request to generate at least a first question associated with the first event data. The first language model may generate the first question and a first answer to the first question based at least in part on the first prompt. A first entry for a search index may be generated. The first entry may include the first question as a key value and the first entry may associate the first question with the first answer.
1 . A computer-implemented method comprising:
receiving, using an asynchronous event driven architecture, a first event stream comprising a plurality of event messages;
determining first event message data of the plurality of event messages, the first event message data describing a first event of the first event stream;
retrieving past event data by performing a first semantic search using the first event message data as a first query to query a first data structure;
determining past question data and past answer data associated with the past event data in the first data structure;
inputting first prompt data into a language model, the first prompt data comprising the first event message data, the past event data, the past question data, the past answer data, and an instruction to generate a new question that is answerable using the first event message data;
generating, by the language model in response to the first prompt data, the new question and a new answer for the new question using the new question and the first event message data; and
generating an entry in a first search index comprising the new question, the new answer, and a first timestamp, wherein the new question is a key value in the first search index, and wherein the first timestamp identifies a time associated with the first event message data.
2 . The computer-implemented method of claim 1 , further comprising:
receiving a first query from a first device associated with a first account;
determining that the first query matches the new question key value in the first search index;
determining, using the first timestamp, that the new answer in the first search index is a most recent answer associated with the new question; and
sending data representing the new answer to the first device in response to the first query.
3 . The computer-implemented method of claim 1 , further comprising:
determining that the first event message data lacks image content;
performing a second semantic search of a multi-modal data structure using the first event message data;
determining that no results are retrieved from the second semantic search;
generating a missing content event;
receiving, in response to the missing content event, first image data relevant to the first event message data; and
storing the first image data in association with the key value.
4 . A computer-implemented method comprising:
receiving, by a first computing device from an asynchronous interface, first event data from an event stream;
generating a first prompt for a first language model, the first prompt comprising the first event data and a first request to generate at least a first question associated with the first event data;
generating, by the first language model based at least in part on the first prompt, the first question and a first answer to the first question; and
generating a first entry for a search index, the first entry comprising the first question as a key value, wherein the first entry associates the first question with the first answer.
5 . The computer-implemented method of claim 4 , further comprising:
receiving, by the first computing device from a second computing device, first query data comprising a second question;
identifying the first entry in the search index based at least in part on a correspondence between the second question and the first question; and
retrieving, from the search index, the first answer to the first question.
6 . The computer-implemented method of claim 4 , further comprising:
receiving, by a second language model, first query data comprising a second question;
identifying a set of questions in the search index based at least in part on a first semantic search of the search index using the first query data;
determining, for each question of the set of questions, a respective answer stored in the search index;
sending, to the second language model, the set of questions and the respective answer for each question of the set of questions; and
generating, by the second language model, a response to the second question based at least in part on the set of questions and the respective answer for each question of the set of questions.
7 . The computer-implemented method of claim 4 , further comprising:
receiving, by the first computing device, second event data from the event stream;
generating a second prompt for the first language model, the second prompt comprising the second event data and a second request to generate at least a second question associated with the second event data;
generating, by the first language model based at least in part on the second prompt, the second question and a second answer to the second question;
determining, by the first language model, that the second question corresponds to the first question; and
generating an updated first entry for the search index based at least in part by storing the second answer in association with the key value, wherein a timestamp associated with the second answer indicates that the second answer is a more temporally recent answer to the first question than the first answer.
8 . The computer-implemented method of claim 4 , further comprising:
determining, for the first event data, past event data based on a semantic search of a past event database using the first event data;
determining, for the past event data, a past question and a past answer associated with the past event data; and
sending the past event data, the past question, and the past answer to the first language model, wherein the generating, by the first language model, the first question and the first answer to the first question is further based at least in part on the past event data, the past question, and the past answer.
9 . The computer-implemented method of claim 8 , wherein the past question and the past answer were generated by the first language model based on receipt of the past event data.
10 . The computer-implemented method of claim 4 , further comprising:
searching, using a second question generated by the first language model and the first event data, at least one database for applicable image data;
determining that no image data that is permissible for use is available in the at least one database;
generating first data representing a missing content request; and
storing the first data in a first memory.
11 . The computer-implemented method of claim 10 , further comprising:
determining that first image data associated with the first event data has become available; and
generating an updated entry in the search index by adding identifier data associated with the first image data to the first entry.
12 . The computer-implemented method of claim 4 , further comprising:
receiving first query data comprising a second question;
determining, by a second language model using the first query data, a set of questions stored in the search index that are similar to the second question;
determining, for each question of the set of questions, a respective answer and a respective timestamp associated with the respective answer; and
generating, by the second language model, a response to the first query data based at least in part on the respective answers and the respective timestamps.
13 . A system comprising:
at least one processor; and
non-transitory computer-readable memory storing instructions that, when executed by the at least one processor, are effective to:
receive, by a first computing device from an asynchronous interface, first event data from an event stream;
generate a first prompt for a first language model, the first prompt comprising the first event data and a first request to generate at least a first question associated with the first event data;
generate, by the first language model based at least in part on the first prompt, the first question and a first answer to the first question; and
generate a first entry for a search index, the first entry comprising the first question as a key value, wherein the first entry associates the first question with the first answer.
14 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
receive, by the first computing device from a second computing device, first query data comprising a second question;
identify the first entry in the search index based at least in part on a correspondence between the second question and the first question; and
retrieve, from the search index, the first answer to the first question.
15 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
receive, by a second language model, first query data comprising a second question;
identify a set of questions in the search index based at least in part on a first semantic search of the search index using the first query data;
determine, for each question of the set of questions, a respective answer stored in the search index;
send, to the second language model, the set of questions and the respective answer for each question of the set of questions; and
generate, by the second language model, a response to the second question based at least in part on the set of questions and the respective answer for each question of the set of questions.
16 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
receive, by the first computing device, second event data from the event stream;
generate a second prompt for the first language model, the second prompt comprising the second event data and a second request to generate at least a second question associated with the second event data;
generate, by the first language model based at least in part on the second prompt, the second question and a second answer to the second question;
determine, by the first language model, that the second question corresponds to the first question; and
generate an updated first entry for the search index based at least in part by storing the second answer in association with the key value, wherein a timestamp associated with the second answer indicates that the second answer is a more temporally recent answer to the first question than the first answer.
17 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
determine, for the first event data, past event data based on a semantic search of a past event database using the first event data;
determine, for the past event data, a past question and a past answer associated with the past event data; and
send the past event data, the past question, and the past answer to the first language model, wherein the generating, by the first language model, the first question and the first answer to the first question is further based at least in part on the past event data, the past question, and the past answer.
18 . The system of claim 17 , wherein the past question and the past answer were generated by the first language model based on receipt of the past event data.
19 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
search, using a second question generated by the first language model and the first event data, at least one database for applicable image data;
determine that no image data that is permissible for use is available in the at least one database;
generate first data representing a missing content request; and
store the first data in the non-transitory computer-readable memory.
20 . The system of claim 19 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:
determine that first image data associated with the first event data has become available; and
generate an updated entry in the search index by adding identifier data associated with the first image data to the first entry.