RECURSIVE DATA ANALYSIS THROUGH AUTOMATED DATABASE QUERY GENERATION

Gespeichert in:
Bibliographische Detailangaben
Titel: RECURSIVE DATA ANALYSIS THROUGH AUTOMATED DATABASE QUERY GENERATION
Document Number: 20240370478
Publikationsdatum: November 7, 2024
Appl. No: 18/656490
Application Filed: May 06, 2024
Abstract: An online system performs a recursive process for analyzing data using an LLM. The online system receives an initial analysis prompt from a user's client device. The online system repeatedly retrieves data from a database of the online system that can be useful for answering the prompt provided by user's analysis prompt. In one of these iterations, the online system generates a recursive prompt for an LLM of a model serving system and generates database queries that correspond to these generated text prompts. The online system can thereby apply these dynamically-generated database queries to its database to retrieve data to answer the generated text prompts. The online system repeatedly performs this process until an end condition is met. The online system generates a final prompt based on the retrieved data, the generated prompts, and the initial analysis prompt, and receives the prompted analysis from the model serving system.
Claim: 1. A method comprising: receiving, at an online system, an analysis prompt from a client device of a user, wherein the analysis prompt comprises free text requesting analytics of data stored by the online system in a database; repeatedly retrieving data from the database for performing the requested analytics by: generating a recursive prompt based on the analysis prompt from the user, wherein the recursive prompt comprises text requesting that a model serving system generate a plurality of text prompts, wherein each text prompt comprises a request for data stored in the database, and wherein the recursive prompt comprises previously retrieved data; transmitting the recursive prompt to the model serving system; receiving generated text prompts from the model serving system; and retrieving data from the database based on the generated text prompts; responsive to determining that an end condition is met, ending the repeated retrieval of data from the database; generating a final prompt based on the retrieved data from the database and the received analysis prompt, wherein the final prompt comprises text requesting that the model serving system generate the requested analytics; receiving an analysis response from the model serving system comprising the requested analytics; and transmitting the analysis response to the client device for display to the user.
Claim: 2. The method of claim 1, wherein receiving the analysis prompt comprises: receiving the analysis prompt through a user interface of a client application operating on the client device of the user.
Claim: 3. The method of claim 2, wherein receiving the analysis prompt comprises: receiving the analysis prompt through a chatbot interface of the user interface.
Claim: 4. The method of claim 1, wherein the user and the database are associated with a third-party entity that is associated with data stored in the database.
Claim: 5. The method of claim 1, wherein the recursive prompt comprises a role indicator indicating a real-world perspective for generating text prompts.
Claim: 6. The method of claim 1, wherein retrieving data from the database based on the generated text prompts comprises: generating a database query for each of the generated text prompts.
Claim: 7. The method of claim 6, wherein generating a database query for each of the generated text prompts comprises: accessing a set of prompt examples stored by the online system, wherein each prompt example comprises: a free text prompt describing a request for data stored by the online system in a database; and a database query to retrieve the data stored by the online system from the database; generating a prompt example embedding for each prompt example of the set of prompt examples based on the free text prompt of the prompt example; and for each of the generated text prompts: generating a prompt embedding for the generated text prompts, wherein the prompt embedding for the generated text prompt is in the same latent space as the prompt example embeddings; identifying prompt examples that are similar to the generated text prompt based on the prompt example embeddings and the prompt embedding for the generated text prompt; transmitting a structured prompt to a model serving system, wherein the structured prompt comprises the generated text prompt and the database queries corresponding to the identified prompt example embeddings; and receiving, from the model serving system, a generated database query corresponding to the generated text prompt, wherein the generated database query is a query for collecting data from the database that was requested by the generated text prompt.
Claim: 8. The method of claim 1, wherein determining that the end condition is met comprises: receiving a stop instruction from the client device of the user.
Claim: 9. The method of claim 1, wherein determining that the end condition is met comprises: determining that the repeated retrieval of data from the database has been performed a threshold number of times.
Claim: 10. The method of claim 1, wherein the model serving system is a third-party system.
Claim: 11. A non-transitory computer-readable medium storing instructions that, when executed by a processor, cause the processor to perform steps comprising: receiving, at an online system, an analysis prompt from a client device of a user, wherein the analysis prompt comprises free text requesting analytics of data stored by the online system in a database; repeatedly retrieving data from the database for performing the requested analytics by: generating a recursive prompt based on the analysis prompt from the user, wherein the recursive prompt comprises text requesting that a model serving system generate a plurality of text prompts, wherein each text prompt comprises a request for data stored in the database, and wherein the recursive prompt comprises previously retrieved data; transmitting the recursive prompt to the model serving system; receiving generated text prompts from the model serving system; and retrieving data from the database based on the generated text prompts; responsive to determining that an end condition is met, ending the repeated retrieval of data from the database; generating a final prompt based on the retrieved data from the database and the received analysis prompt, wherein the final prompt comprises text requesting that the model serving system generate the requested analytics; receiving an analysis response from the model serving system comprising the requested analytics; and transmitting the analysis response to the client device for display to the user.
Claim: 12. The computer-readable medium of claim 11, wherein receiving the analysis prompt comprises: receiving the analysis prompt through a user interface of a client application operating on the client device of the user.
Claim: 13. The computer-readable medium of claim 12, wherein receiving the analysis prompt comprises: receiving the analysis prompt through a chatbot interface of the user interface.
Claim: 14. The computer-readable medium of claim 11, wherein the user and the database are associated with a third-party entity that is associated with data stored in the database.
Claim: 15. The computer-readable medium of claim 11, wherein the recursive prompt comprises a role indicator indicating a real-world perspective for generating text prompts.
Claim: 16. The computer-readable medium of claim 11, wherein retrieving data from the database based on the generated text prompts comprises: generating a database query for each of the generated text prompts.
Claim: 17. The computer-readable medium of claim 16, wherein generating a database query for each of the generated text prompts comprises: accessing a set of prompt examples stored by the online system, wherein each prompt example comprises: a free text prompt describing a request for data stored by the online system in a database; and a database query to retrieve the data stored by the online system from the database; generating a prompt example embedding for each prompt example of the set of prompt examples based on the free text prompt of the prompt example; and for each of the generated text prompts: generating a prompt embedding for the generated text prompts, wherein the prompt embedding for the generated text prompt is in the same latent space as the prompt example embeddings; identifying prompt examples that are similar to the generated text prompt based on the prompt example embeddings and the prompt embedding for the generated text prompt; transmitting a structured prompt to a model serving system, wherein the structured prompt comprises the generated text prompt and the database queries corresponding to the identified prompt example embeddings; and receiving, from the model serving system, a generated database query corresponding to the generated text prompt, wherein the generated database query is a query for collecting data from the database that was requested by the generated text prompt.
Claim: 18. The computer-readable medium of claim 11, wherein determining that the end condition is met comprises: receiving a stop instruction from the client device of the user.
Claim: 19. The computer-readable medium of claim 11, wherein determining that the end condition is met comprises: determining that the repeated retrieval of data from the database has been performed a threshold number of times.
Claim: 20. The computer-readable medium of claim 11, wherein the model serving system is a third-party system.
Current International Class: 06
Dokumentencode: edspap.20240370478
Datenbank: USPTO Patent Applications
Beschreibung
Abstract:An online system performs a recursive process for analyzing data using an LLM. The online system receives an initial analysis prompt from a user's client device. The online system repeatedly retrieves data from a database of the online system that can be useful for answering the prompt provided by user's analysis prompt. In one of these iterations, the online system generates a recursive prompt for an LLM of a model serving system and generates database queries that correspond to these generated text prompts. The online system can thereby apply these dynamically-generated database queries to its database to retrieve data to answer the generated text prompts. The online system repeatedly performs this process until an end condition is met. The online system generates a final prompt based on the retrieved data, the generated prompts, and the initial analysis prompt, and receives the prompted analysis from the model serving system.