IP Library › Granted Patent US 12,711,130
Granted Patent B1
US 12,711,130 · App. 19/185,769 · Granted Aug 18, 2026

Heterogenous data integration for LLM prompting

Inventors: Achille Belly Fokoue-Nkoutche (White Plains, NY); Srideepika Jayaraman (New York, NY); Elham Khabiri (Briarcliff Manor, NY); Jeffrey Owen Kephart (Cortlandt Manor, NY); Yingjie Li (Chappaqua, NY); Dhruv Shah (New York, NY); Youssef Drissi (Peekskill, NY); Fenno F. Heath, III (Woodbridge, CT); Anuradha Bhamidipaty (Yorktown Heights, NY); Fateh A. Tipu (Wappingers Falls, NY)
Assignee: International Business Machines Corporation
G06F16/243G06F16/21
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,711,130
App. No.
19/185,769
Granted
Aug 18, 2026
Kind
B1
Abstract

An embodiment establishes an integrated database comprising data from a set of heterogeneous data sources. The embodiment intercepts, by a database management application, a user input query transmitted to a target system, the user input query written in a natural language format. The embodiment transforms, by a natural language model within the database management application, the user input query into a structured query based on a relational schema, the transforming producing a formatted query. The embodiment modifies the formatted query, the modifying replacing a reference to a virtual table within a call to a user-defined functions (UDF), the modifying producing a final query. The embodiment executes the final query executing the final query, the executing comprising transmitting the final query to the integrated database, the transmitting causing executing a first responsive action based on the final query, the executing the first responsive action producing a first execution result.

Claims (41)

1 . A computer-implemented method comprising:

establishing an integrated database, the integrated database comprising data from a set of heterogeneous data sources;

intercepting, by a database management application, a user input query transmitted to a target system, the user input query written in a natural language format;

transforming, by a natural language model within the database management application, the user input query into a structured query based on a relational schema, the transforming producing a formatted query;

modifying the formatted query, the modifying replacing a reference to a virtual table within a call to a user-defined functions (UDF), the modifying producing a final query, wherein the virtual table corresponds to an application programming interface (API), and wherein modifying comprises replacing the virtual table reference with the user-defined function call that encapsulates an external API request; and

executing the final query, the executing comprising transmitting the final query to the integrated database, the transmitting causing executing a first responsive action based on the final query, the executing the first responsive action producing a first execution result.

2 . The computer-implemented method of claim 1 , wherein the relational schema includes a combination of a database table corresponding to database records and a virtual table corresponding to an application programming interface (API).

3 . The computer-implemented method of claim 1 , wherein the relational schema includes a combination of a database table corresponding to database records and a virtual table corresponding to a set of documents.

4 . The computer-implemented method of claim 1 , the method further comprising:

validating, by a guardrail module within the database management application, the formatted query prior to modifying the formatted query, the validating comprising checking for semantic consistency between the formatted query and the relational schema.

5 . The computer-implemented method of claim 1 , wherein transforming the user input query further comprises:

selecting, using a table selector module within the database management application, a subset of tables from the integrated database based on an analysis of content within the user input query.

6 . The computer-implemented method of claim 1 , wherein the modifying further comprises causing an execution of a first specific program instruction, the execution of the first specific program instruction causing analyzing the formatted query to determine argument values to pass into the UDF corresponding to the virtual table.

7 . The computer-implemented method of claim 1 , wherein the integrated database is configured to execute user-defined functions within SQL queries.

8 . The computer-implemented method of claim 1 , further comprising checking the first execution result against one or more conditions and returning an output based on the checking.

9 . A computer program product comprising one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by a processor to cause the processor to perform operations comprising:

establishing an integrated database, the integrated database comprising data from a set of heterogeneous data sources;

intercepting, by a database management application, a user input query transmitted to a target system, the user input query written in a natural language format;

transforming, by a natural language model within the database management application, the user input query into a structured query based on a relational schema, the transforming producing a formatted query;

modifying the formatted query, the modifying replacing a reference to a virtual table within a call to a user-defined functions (UDF), the modifying producing a final query, wherein the virtual table corresponds to an application programming interface (API), and wherein modifying comprises replacing the virtual table reference with the user-defined function call that encapsulates an external API request; and

executing the final query, the executing comprising transmitting the final query to the integrated database, the transmitting causing executing a first responsive action based on the final query, the executing the first responsive action producing a first execution result.

10 . The computer program product of claim 9 , wherein the stored program instructions are stored in a computer readable storage device in a data processing system, and wherein the stored program instructions are transferred over a network from a remote data processing system.

11 . The computer program product of claim 9 , wherein the stored program instructions are stored in a computer readable storage device in a server data processing system, and wherein the stored program instructions are downloaded in response to a request over a network to a remote data processing system for use in a computer readable storage device associated with the remote data processing system, further comprising:

program instructions to meter use of the program instructions associated with the request; and

program instructions to generate an invoice based on the metered use.

12 . The computer program product of claim 9 , wherein the relational schema includes a combination of a database table corresponding to database records and a virtual table corresponding to an application programming interfaces (API).

13 . The computer program product of claim 9 , wherein the relational schema includes a combination of a database table corresponding to database records and a virtual table corresponding to a set of documents.

14 . The computer program product of claim 9 , further comprising:

validating, by a guardrail module within the database management application, the formatted query prior to modifying the formatted query, the validating comprising checking for semantic consistency between the formatted query and the relational schema.

15 . The computer program product of claim 9 , wherein transforming the user input query further comprises:

selecting, using a table selector module within the database management application, a subset of tables from the integrated database based on an analysis of content within the user input query.

16 . The computer program product of claim 9 , wherein the modifying further comprises causing an execution of a first specific program instruction, the execution of the first specific program instruction causing analyzing the formatted query to determine argument values to pass into the UDF corresponding to the virtual table.

17 . The computer program product of claim 9 , wherein the integrated database is configured to execute user-defined functions within SQL queries.

18 . The computer program product of claim 9 , further comprising checking the first execution result against one or more conditions and returning an output based on the checking.

19 . A computer system comprising a processor and one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by the processor to cause the processor to perform operations comprising:

establishing an integrated database, the integrated database comprising data from a set of heterogeneous data sources;

intercepting, by a database management application, a user input query transmitted to a target system, the user input query written in a natural language format;

transforming, by a natural language model within the database management application, the user input query into a structured query based on a relational schema, the transforming producing a formatted query;

modifying the formatted query, the modifying replacing a reference to a virtual table within a call to a user-defined functions (UDF), the modifying producing a final query, wherein the virtual table corresponds to an application programming interface (API), and wherein modifying comprises replacing the virtual table reference with the user-defined function call that encapsulates an external API request; and

executing the final query, the executing comprising transmitting the final query to the integrated database, the transmitting causing executing a first responsive action based on the final query, the executing the first responsive action producing a first execution result.

20 . The computer system of claim 19 , wherein the relational schema includes a combination of a database table corresponding to database records and a virtual table corresponding to an application programming interfaces (API).

References Cited (34)
US 12135768B2 · Ailawadi et al. · 2024 [cited by applicant]
US 20170199910A1 · Konik · 2017 [cited by examiner]
US 20210034636A1 · Waas · 2021 [cited by examiner]
US 20240303235A1 · Kulkarni et al. · 2024 [cited by applicant]
US 20250291772A1 · Hoang · 2025 [cited by examiner]
CN 117131070A · 2023 [cited by applicant]
CN 118151904A · 2024 [cited by applicant]
CN 118427207A · 2024 [cited by applicant]
CN 118939679A · 2024 [cited by applicant]
CN 119005340A · 2024 [cited by applicant]
CN 119203232A · 2024 [cited by applicant]
CN 119312927A · 2025 [cited by applicant]
EP 4428710A1 · 2024 [cited by applicant]
FR 3150317A1 · 2024 [cited by applicant]
Fokoue-Nkoutche, et al., “Preventing Data Exposure During Retrieval Augmented Generation”, U.S. Appl. No. 19/203,268, filed May 9, 2025, 32 Pages. [cited by applicant]
Allemang et al., “Increasing the LLM Accuracy for Question Answering: Ontologies to the Rescue!”, arXiv:2405.11706v1 [cs.AI], May 20, 2024, 16 pages. [cited by applicant]
Gao et al., “Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation”, arXiv:2308.15363v4 [cs.DB], Nov. 20, 2023, 22 pages. [cited by applicant]
Jiang et al., “Mixtral of experts”, arXiv:2401.04088v1 [cs.LG], Jan. 8, 2024, 13 pages. [cited by applicant]
Li et al., “API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMs”, arXiv:2304.08244v2 [cs.CL], Oct. 25, 2023, 15 pages. [cited by applicant]
Li et al., “Can LLM already serve as a database interface? A BIg bench for large-scale database grounded Text-to-SQLs”, arXiv:2305.03111v3 [cs.CL], Nov. 15, 2023, 28 pages. [cited by applicant]
No Author, “Build a Question/Answering system over SQL data”, https://python.langchain.com/v0.2/docs/tutorials/sql_qa/, dated Jun. 2, 2025, 18 pages. [cited by applicant]
No Author. “Berkeley Function-Calling Leaderboard”, BFCL Leaderboard, Retrieved from web gorilla.cs.berkeley.edu/leaderboard.html, Apr. 13, 2025, 3 pages., gorilla.cs.berkeley.edu/leaderboard.html. [cited by applicant]
No Author. “langchain_community 0.2.19”, retrieved from https://web.archive.org/web/20250414215716/https://api.python.langchain.com/en/latest/community_api_reference.html, Apr. 14, 2025, 47 pages. [cited by applicant]
No Author. “ReAct”, Longchain, retrieved from web python.langchain.com/v0.1/docs/modules/agents/agent_types/react/, Mar. 19, 2025, 5 pages. [cited by applicant]
Patil et al., “Gorilla: Large Language Model Connected with Massive APIs”, arXiv:2305.15334v1 [cs.CL], May 24, 2023, 18 pages. [cited by applicant]
Pourreza et al., “CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL”, arXiv:2410.01943v1 [cs.LG], Oct. 2, 2024, 30 pages. [cited by applicant]
Wang et al., “Traffic Performance GPT (TP-GPT): Real-Time Data Informed Intelligent ChatBot for Transportation Surveillance and Management”, arXiv:2405.03076v1 [cs.MA], May 5, 2024, 8 pages. [cited by applicant]
Xue et al. “Db-gpt: Empowering database interactions with private large language models”, arXiv:2312.17449v2 [cs.DB], Jan. 3, 2024, 16 pages. [cited by applicant]
Yan et al. “On protecting the data privacy of large language models (llms): A survey”, arXiv:2403.05156v2 [cs.CR], Mar. 14, 2024. [cited by applicant]
Yao et al., “React: Synergizing Reasoning and Acting in Language Models”, arXiv:2210.03629v3 [cs.CL], Mar. 10, 2023, 33 pages. [cited by applicant]
Ye et al. “DataFrame QA: A Universal LLM Framework on DataFrame Question Answering Without Data Exposure”, arXiv:2401.15463v1 [cs.CL], Jan. 27, 2024, 24 pages. [cited by applicant]
Yu et al., “Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task”, arXiv:1809.08887v5 [cs.CL], Feb. 2, 2019, 11 pages. [cited by applicant]
Zhong et al., “Semantic Evaluation for Text-to-SQL with Distilled Test Suites”, arXiv:2010.02840v1 [cs.CL], Oct. 6, 2020, 16 pages. [cited by applicant]
Zhong et al., “Seq2sql: Generating structured queries from natural language using reinforcement learning”, arXiv:1709.00103v7 [cs.CL], Nov. 9, 2017, 12 pages. [cited by applicant]