A system for generating query based reports
The system addresses the limitations of existing AI report generation by using an LLM engine and modules to process user queries, enabling efficient and customizable graphical report generation from natural language inputs, improving data visualization and user interaction.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SRIVASTAVA VISHRUT
- Filing Date
- 2025-12-03
- Publication Date
- 2026-06-11
Smart Images

Figure IN2025051993_11062026_PF_FP_ABST
Abstract
Description
[0001] “A SYSTEM FOR GENERATING QUERY BASED REPORTS”
[0002] FIELD OF THE INVENTION:
[0003] The present invention relates to system for generating reports using artificial intelligence and more particularly to systems for generating reports in graphical formats.
[0004] BACKGROUND OF THE INVENTION:
[0005] Currently a Business Intelligence Developer is engaged to build the reports after gathering requirements from business users. Conventionally there have been attempts to reduce the report generation time using various technologies. One such optimized report generation is possible through using LLMs (Large Language Model).
[0006] LLM is a type of artificial intelligence (Al) program that is able to recognize and generate text. LLMs are trained on huge sets of data and are built on machine learning specifically, a type of neural network called a transformer model. The LLM is fed enough examples to recognize and interpret human language or other types of complex data. Many LLMs are trained on data that has been gathered from the Internet thousands or millions of gigabytes' worth of text. LLMs use a type of machine learning called deep learning in order to understand how characters, words, and sentences function together. Deep learning involves the probabilistic analysis of unstructured data, which eventually enables the deep learning model to recognize distinctions between pieces of content without human intervention. There have been attempts in the prior art that generate report using artificial intelligence. Some of the attempts, are discussed mentioned as under. Chinese Patent CN117688930A to artificial intelligence and digital economy guangdong provincial laboratory is a chart generation method, device and equipment. The Chinese patent relates to automatic chart generation method. The chart parser is generated based on chart markup data and a large language model. Artificial intelligence uses the Langchain framework, or other large language models to generate the most suitable charts based on data characteristics and user preferences in language model decisions. Chart types include one or more of a line chart, a column chart, an area chart, a heat map, a scatter chart, or a pie chart.
[0007] A U.S Patent US20170228439A1 to CA, INC. is an automatic natural language processing-based data extraction. U.S Patent relates to a data-driven big data mining and reporting system. The system includes an automated way for accessing the data even if the exact data format / structure is unknown, determining relevant features and generating report using natural language processing. Data analysis server builds dashboards from the data and or the metrics that includes pie charts, bar graphs, analogue data graphs.
[0008] A Chinese Patent CN117745231 A to changsha huoxian cloud network technology co., ltd. is a method and device for realizing real-time security operations using 11ms. The Chinese Patent relates to a method and tool for analysing SQL statements to generate visual report. The method includes data input of table and processed natural language text into the query model to infer relevant SQL statements, data analysis by using the fine-tuned small LLM model, obtaining relevant query results, converting into corresponding report, list or chart information for display according to the natural language input by the user. Hence, there is a need for a system for generating query-based reports. Further, there is also a need for generating reports using artificial intelligence and more particularly systems for generating reports in graphical formats.
[0009] SUMMARY OF THE INVENTION:
[0010] The present invention discloses a system for generating query-based reports including a login module for receiving the user details and authenticating the users with the system characterized in that said system with an input module that receives input data received from a user, a processing unit that processes the input data on a controller and the controller that stores the input data on a memory mounted on a server. The processing unit of the present invention includes a LLM engine for analyzing and generating structured input data. Further, the processing unit includes a view generator module for generating and displaying view corresponding to the input data from predefined tables.
[0011] The present invention includes a view verifier module for verifying the generated views in the view generator module through the LLM engine and a query generator module configured for processing the structured query in the view thereby generating and fetching data from the views verified in the view verifier module. Further, the present invention includes a selector module for selecting views corresponding to the input data and a data generator module that is configured to identify and generate the different output data types through corresponding to the input data. There also includes a fetcher module that is configured to fetch data generated by the controller. Also, the output data is stored on a server and the output data is further displayed on the output module. In accordance with the present invention, the LLM engine is configured to generate data dictionary including description of tables and columns through the LLM engine. The LLM engine of the present invention is configured to analyze and recognize the input data and is configured to selectively identify the input query and is configured to invoke the data history for completing an incomplete query or input data provided by the user. Further, the selector module is configured to select appropriate views as per are given descriptions as part of the data dictionary and the LLM is passed this as context along with user query to a LLM call.
[0012] In this embodiment, the LLM engine is configured through a set of instructions to identify the input provided in a natural language by the users and convert them into machine-readable instructions. The LLM engine also includes the data dictionary that is given as a context to another LLM prompt along with the user queries and a SQL statement is generated. Furthermore, the LLM engine analyzes and recognizes the input data and is configured to selectively identify the input query and is configured to invoke the data history for completing an incomplete query or input data provided by the user.
[0013] In another aspect, a method for generating structured user input data for the present invention is also disclosed. The method includes a first step of receiving an input data from the input module, a second step of analyzing the input data on the LLM engine. The third step includes invoking, OpenAI LLM with prompt instructions through the LLM engine and a fourth step of assessing, the structure of the input data through the LLM engine. The fifth step includes referring, prior chat history for inferring a fully formed input data and a final step of generating, structured input data and sending to the processing unit.
[0014] Another aspect of the present invention discloses a method for generating query-based reports including several steps. The first step includes receiving an input data from the input module and a second step of checking and generating, structured input data through the LLM engine. A third step includes generating a dedicated view through the view generator module and a fourth step of selecting appropriate view through the view selector module. The fifth step includes verifying, the selected view through the view verifier module and a sixth step of processing the structured query on the selected and verified view through the controller. Further, a seventh step includes identifying and generating the output as per the input data through the data generator module and a final step of deciding data format and generating output data on the output module.
[0015] BRIEF DESCRIPTION OF DRAWINGS:
[0016] The objectives and advantages of the present invention will become apparent from the following description read in accordance with the accompanying drawings wherein,
[0017] FIG.1 shows a high-level view of a system for generating query-based reports in accordance with the present invention;
[0018] FIG. 2 is a system architecture of the system for generating query-based reports of FIG.1; and
[0019] FIG. 3 is an operational flow chart of the system for generating query -based reports of FIG.1. DESCRIPTION OF THE INVENTION:
[0020] References in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, characteristic, or function described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
[0021] References in the specification to “preferred embodiment” means that a particular feature, structure, characteristic, or function described in detail thereby omitting known constructions and functions for clear description of the present invention.
[0022] The foregoing description of specific embodiments of the present invention has been presented for purposes of illustration and description. They are not intended to be exhaustive or to limit the present invention to the precise forms disclosed and obviously many modifications and variations are possible in light of the above teaching.
[0023] Referring to FIG.l, a system for generating query-based reports hereinafter referred to as the system 100 is described. In the present embodiment, the system 100 is a web-based portal however, the type of application varies in other embodiments of the present invention. The system 100 is accessed through a plurality of electronic devices 110 for example a laptop, computers, handheld devices or the like by users. The user 105 requests for a required data by entering a data in the form of commands, computer readable queries to the system 100. Accordingly, the system 100 outputs the required data in the form of graphs or text format.
[0024] The system 100 is accessed by individuals i.e., a user 105 through the electronic devices 110 and preferably through the internet 115. It is to be noted that, the users 105 may be individuals, devices, automated services or applications sending and receiving input data 120 and output data file 125 respectively in other embodiments of the present invention The user 105 is preferably accessing the system 100 for sending plurality of input data 120 over browsers. The system 100 is configured for securing and processing the input data 120 received from the first user 105 and producing the desired output in the form of an output data file 125. The input data 120 may be in the form of human readable text language. Accordingly, the output data file 125 may be in the form of graphs, text, scatter plots or the like.
[0025] The system 100 is configured to connect and analyze the enterprise database through custom built ORM (Object Relation Mapping) or the like. In the present embodiment the system 100 is configured with LangChain and OpenAI that facilitates the system 100 to interpret and process the input data file 120 and produce output in the output data file 125. However, the technologies vary in other embodiments of the present invention. The system 100 encrypts and sends back the secured data 125 to the user 105 in the form of a pdf file, graphs or the like.
[0026] Now referring to FIG.2, the system for generating artificial intelligencebased reports is described hereinafter. The system 100 includes a user interface unit 205, a processing unit 210 and a server 215. The user interface unit 205 is configured to receive input from the user 105. The user interface unit 205 also allows the users 105 to view the output data file 125 on the electronic device 110.
[0027] The user interface unit 205 includes a login module 220, an input module 225 and an output module 230. The login module 220 is configured to manage the cryptographic operations required to operate the services. These operations include the authentications with the platform and if necessary, with third-party services. The login module 220 interacts with the processing unit 210 for performing the cryptographic operations and storing the keys.
[0028] The login module 220 receives credentials from the registered users and validates with the data stored in the server 215. The login module 220 allows the registered users to log in to the device 100. The new users are registered based on some registration parameter and are registered with the system 100. The registration parameters include the details for example “name, age, gender, location of device, email id, mobile number”.
[0029] The input data 120 received from the users 105 is stored in the server 215. In accordance with the present invention, the users 105 may log in with device 120 through their social media account or their existing email IDs. In the present invention, the users 105 may reset the forgotten password by receiving new password on the registered email ID or mobile number, message verification, telephonic verification, or the like. The login module 220, authenticates the registered users in the device 100. The login module 220 communicates with the controller 255 and accesses the registered user data and accordingly authenticates the users 105 in the system 100. The controller 255 is configured to process the data received from the input module 225.
[0030] The input module 225 is configured to receive inputs from the user 105 and provide the query in the form of input data 120 to the processing unit 210. The output module 230 is configured, to receive the output data 125 from the processing unit 210 and display the processed data.
[0031] The processing unit 210 is configured to process the input data 120 as received from the user interface unit 205. The processing unit 210 includes a credential validator 235, an LLM (Large Language Model) engine 240, a view generator 245, a view verifier module 250, a controller 255, a query generator 260, a selector module 265, a fetcher module 270, a data generator 275 and a memory 280. The credential validator 235 receives credential from the registered user 105 and raises a request for the verification of the credentials from the server 215 and accordingly validates the user 105.
[0032] The LLM engine 240 is configured to analyze the input data 120 received from user 105. The LLM engine 240 is trained on large datasets using predefined artificial intelligence algorithms, preferably OpenAI algorithms however, the type of algorithms varies in other embodiments of the present invention. Further, the view generator module 245 is configured to generate views for creating a customized, simplified perspective of data from a database by creating virtual tables for displaying specific data from underlying tables. Accordingly, the view verifier module 250 is configured to verify the data i.e., the view identifier chain fetched by the view generator module 245 through the LLM engine 240.
[0033] The query generator module 260 is configured to generate the query understandable by the computer that is equivalent to the user input data 120 entered by the user 105. The query generator module 260 is configured to fetch the data from the views as per the user requirement. Further, the selector module 265 is configured to select appropriate view from an array of views that provides equivalent output data 125 for the requested input data 120 from the user 105. In context of the present invention, the selector module 265 is configured to select appropriate views as per the given descriptions as part of the data dictionary and the LLM is passed this as context along with user query to a LLM call.
[0034] The fetcher module 270 is configured to fetch the data generated by the controller 255 and transmit the output data 125 to the user interface unit 205. The data generator module 275 is configured to generate the output data 120 either in the form of text, graphs, scatter plot or the like. The data generator module 275 is invoked by the controller 255 to display output data 125 on the output module 230. In the data generator module 275, the controller 255 checks if specific response type such as text, pie, bar, line, scatter or the like is requested by the user 105. Further, if a particular format is directly requested or strongly implied, prioritize generation of the requested response type. Further, if the formatted query requests for a high-level overview or summary, the data generator module 275 responds with text. Moreover, if the formatted query is requesting for a SINGLE data value, the data generator module 275 respond with text otherwise, the data generator module 275 analyzes the formatted question and selects the best visualization.
[0035] In the data generator module 275, if the input data query requests to compare CATEGORICAL values, PROPORTIONS or PERCENTAGES, then the data generator module 275 generates pie chart. Accordingly, if the user query requests to compare DISCRETE QUANTITIES for CATEGORICAL data, then the data generator module 275 generates a bar chart. Further, if the user query is requested to show TRENDS or PATTERNS over TIME, the data generator module 275 is configured to output a line chart. If the user query requests to show RELATIONSHIPS between VARIABLES, the data generator module 275 produces a scatter plot. If it is unclear by assessing the user query request on which visualization to select the data generator module 275 selects text output.
[0036] The controller 255 is adapted to control and manage the execution of instructions or software code portions of the programs according to one of the embodiments of the invention, the instructions being stored in one of the storage means. In this embodiment, the device is a programmable device which uses software to implement the invention. However, as an alternative, this invention may be implemented in the hardware (for example as an application-specific integrated circuit (ASIC)). The login module 220 receives the details from the user 105 that are stored in the server 215. The details received are stored in a read-only memory 280, on the hard drive or on a digital removable medium such as a disk inside the sever 215. In another embodiment, the executable codes of the programs are received using a communication network, via the network interface, to be stored in one of the storage means of the communication device, such as the hard drive, before being executed.
[0037] In context of the present invention, the new user 105 registers himself / herself with the device 100 and then logs by entering appropriate credentials. The users 105 enters the credentials that are validated by the credential validator 235. The credential validator 235 verifies the credentials entered by the user 105 with the credentials stored in the server 215. The LLM engine 240 is trained using AI(Artificial Intelligence) and NLP (Natural Language Processing) over large datasets. The LLM engine 240 is configured through a set of instructions to identify the input provided in a natural language by the users 105. In accordance with the present invention, the LLM engine 240 recognizes the users 105 instructions through NLP and converts them into a machine-readable instruction.
[0038] In accordance with the present invention, the LLM engine 240 is configured to generate a data dictionary that includes the description of table and column that is created preferably in English Language however, the type of language varies in other embodiments of the present invention. Some of the data dictionary is auto generated using another LLM call if the table and column names are English words else an option is given to the user 105 to specify the dictionary descriptions in the beginning.
[0039] This data dictionary is input as a context to another LLM prompt along with the user queries and a SQL statement is generated. Another LLM based agent then validates this SQL statement by running the same and validating it gives output, else a retry happens with an altered version of the prompt and the SQL statement is checked again and then run.
[0040] The LLM engine 240 is configured to produce a predefined LLM prompts or LLM instructions that reduce hallucinations, reduce token costs and at the same time increases performance of the system 100.
[0041] The LLM engine 240 is configured to analyze the query as raised by the user 105. The LLM engine 240 analyzes and recognizes the input data 120 and is configured to selectively identify the input query and is configured to invoke the data history for completing an incomplete query or input data 120 provided by the user 105. The LLM engine 240 is configured to first check the query for ambiguity using a LLM prompt-based agent. The LLM engine 240 is configured to check for completeness of the query and upon detecting the incomplete or ambiguous queries prior questions of the user 105 in the history are passed to context to see if it is a follow up question. In accordance with the present invention the data dictionary is passed as context to complete the incomplete queries.
[0042] The LLM engine 240 is configured to reconstruct the query as provided by the input data 120. The LLM engine 240 is further configured to fetch the equivalent view through the selector module 265 for providing output data 125 to the user 105. The LLM engine 240 is further configured to fetch the view verifier module 250 for verifying the data from the views.
[0043] The LLM engine 240 is further configured to generate query on the selected views for fetching the output data 125. The LLM engine 240 is configured to identify the type of output data 125 suitable for the requested input data 120 and accordingly commands the data generator module 275 to generate the output data 125. The output data file 125 includes SQL query and is passed as context to another LLM agent and the corresponding prompt detects the type of graph needed which together with the SQL output generates the code to draw the graph detected.
[0044] Now referring to FIGS. 1 to 3, the system for generating query-based reports 100 is described. In an initial step 305, the user 105 logs in the system 100 through the electronic device 110. The authentication module authenticates the user 105 in the system 100. In this step 305, the user 105 inputs the data file 120 through the input module 225. In a next step 310 the LLM Engine 240 is configured to check the structure of the query i.e., input data 120. In a next step 315, the history data is invoked for reconstructing the structure of the input data 120.
[0045] In a next step 320, the view generator 245 module is configured to create multiple views for capturing data from the datasets. In this step 320, a view selector module 265 is invoked to select appropriate view suitable to the input data 120. In a next step 325 an appropriate query is executed on the selected view to receive the required output data 125. In a further step 330, the output data 125 is generated from the data generator module 275 and is verified through the view verifier module 250.
[0046] In a next step 335, the data generator module 275 is configured to select an appropriate type of output suitable for the received input data 120. The data generator module 275 is configured to display the selected output data 125. In a final step 340 the output data 125 is displayed on the output module 230.
[0047] The system for generating query-based reports 100 advantageously generates the report directly for business users through their Natural Language based requests. The system for generating query-based reports 100 advantageously provides output data in the form of graphs that aids the users 105. The system for generating query-based reports 100 advantageously segregates complex data and provides simplified data to the user.
[0048] The embodiments were chosen and described in order to best explain the principles of the present invention and its practical application, to thereby enable others, skilled in the art to best utilize the present invention and various embodiments with various modifications as are suited to the particular use contemplated.
[0049] It is understood that various omission and substitutions of equivalents are contemplated as circumstance may suggest or render expedient, but such are intended to cover the application or implementation without departing from the scope of the present invention.
Claims
CLAIMS:
1. A system for generating query -based reports 100 including a login module 220 for receiving the user details and authenticating the users 105 with the system 100 characterized in that said system 100 comprising: an input module 225 receiving input data 120 received from a user 105; a processing unit 210 processing the input data 120 on a controller 255; the controller storing the input data on a memory 280 mounted on a server 215; the processing unit 210 including: a LLM engine 240 for analyzing and generating structured input data 120; the processing unit 210 including a view generator module 245 for generating and displaying view corresponding to the input data 120 from predefined tables; a view verifier module 250 verifying the generated views in the view generator module 245 through the LLM engine 240; a query generator module 260 configured for processing the structured query in the view thereby generating and fetching data from the views verified in the view verifier module 250; a selector module 265 for selecting views corresponding to the input data 120; a data generator module 275 configured to identify and generate the different output data types through corresponding to the input data 120; a fetcher module 270 configured to fetch data generated by the controller 255 ; and storing the output data 125 on a server 215 and displaying the output data 125 on the output module 230.
2. The system for generating query-based reports 100 as claimed in claim 1 wherein, the LLM engine 240 is configured to generate data dictionary including description of tables and columns through the LLM engine 240.
3. The system for generating query-based reports 100 as claimed in claim 1 wherein, the LLM engine 240 is configured to analyze and recognize the input data 110 and is configured to selectively identify the input query and is configured to invoke the data history for completing an incomplete query or input data 110 provided by the user 105.
4. The system for generating query-based reports 100 as claimed in claim 1 wherein, the selector module 265 is configured to select appropriate views as per are given descriptions as part of the data dictionary and the LLM is passed this as context along with user query to a LLM call.
5. The system for generating query-based reports 100 as claimed in claim 1 wherein, the LLM engine 240 is configured through a set of instructions to identify the input provided in a natural language by the users 105 and convert them into machine -readable instructions.
6. The system for generating query-based reports 100 as claimed in claim 1 wherein, the LLM engine 240 includes the data dictionary that is given as a context to another LLM prompt along with the user queries and a SQL statement is generated.
7. The system for generating query-based reports 100 as claimed in claim 1 wherein, the LLM engine 240 analyzes and recognizes the input data 120 and is configured to selectively identify the input query and is configured toinvoke the data history for completing an incomplete query or input data 120 provided by the user 105.
8. A method for generating structured user input data 120 as claimed in claim1 comprising method steps of: a. Receiving an input data 120 from the input module 220; b. Analyzing the input data 120 on the LLM engine 240; c. Invoking, OpenAI LLM with prompt instructions through the LLM engine 240; d. Assessing, the structure of the input data 120 through the LLM engine 240; e. Referring, prior chat history for inferring a fully formed input data 120; and f. Generating, structured input data 120 and sending to the processing unit 210.
9. A method for generating query-based reports as claimed in claim 1 comprising method steps of: a. Receiving an input data 120 from the input module 225; b. Checking and generating, structured input data 120 through the LLM engine 240; c. Generating a dedicated view through the view generator module 245; d. Selecting appropriate view through the view selector module 265; e. Verifying, the selected view through the view verifier module 250;f. Processing the structured query on the selected and verified view through the controller 255; g. Identifying and generating the output as per the input data 120 through the data generator module 275; and h. Deciding data format and generating output data 125 on the output module 230.