Microsoft Patents a Two-Step AI System That Turns Plain English Into Database Queries
Asking a database a question in plain English sounds simple — but the gap between how humans speak and how databases think is enormous. Microsoft's new patent describes an AI system that bridges that gap in two deliberate steps, using the database itself to fill in what the AI doesn't know yet.
What Microsoft's AI-powered query converter actually does
Imagine asking your company's database, "Show me sales from last quarter by region" — without knowing SQL, table names, or how the data is structured. Right now, that requires a developer or a BI tool someone already configured.
Microsoft's patent describes a system where a generative AI model receives your plain-English question, realizes it needs more context to write a proper query (like what columns or filters actually exist), and automatically calls the database to fetch that context — before writing the final query.
The clever part is the two-pass approach: a first query gathers the missing structural information, and a second query does the actual work you asked for. You ask once; the system figures out everything it needs behind the scenes.
How the two-prompt loop bridges language and query logic
The patent describes a Query Converter pipeline sitting between a user and a database engine. When it receives a natural language question, it doesn't immediately try to translate it into SQL (or another query language). Instead, it goes through a two-stage process.
Stage one: The system builds a prompt that includes your question and a reference to a relevant function call — a pre-defined operation exposed by the database engine. It sends this prompt to a generative AI model. The model recognizes that it's missing information (like schema details, valid filter values, or table relationships) and generates a first data query designed specifically to retrieve that missing context from the database.
Stage two: The database executes that first query and returns the structural information. The system feeds this back into the AI model, which now has everything it needs. It generates a second data query — the real one — that accurately answers the original question and gets executed against the database.
The patent also mentions a query plan concept, where the model outlines its translation strategy before writing any query. The pipeline includes a Pre-Processor (formats the initial prompt), a Model Interface (manages back-and-forth with the AI), and a Post-Processor (handles the final output).
What this means for natural-language database interfaces
Natural language interfaces to databases are a crowded space — Copilot, Databricks Assistant, and a dozen startups all do versions of this. What's notable here is the explicit two-query loop: rather than assuming the AI has full schema knowledge baked into its context window, the system dynamically fetches what it needs at runtime. That's a more robust architecture for large or constantly changing databases where pre-loading all schema info would be impractical.
For enterprise customers using Microsoft's data stack — Azure SQL, Fabric, Synapse — this pattern could let non-technical users query live databases without a BI layer in between. Whether it ships as a Copilot feature or a developer API, the underlying plumbing described here is clearly aimed at making AI database access less brittle.
This is a solid, practical engineering patent — not a moonshot. The two-pass approach to query generation is a real solution to a real problem (AI models hallucinating column names or filter syntax they don't actually know), and the architecture is clean enough that you can imagine it shipping in something like Microsoft Fabric's Copilot within a product cycle or two. It's not a fundamental research advance, but it's the kind of careful systems work that actually makes AI features reliable in production.
Get one Big Tech patent every Sunday
Plain English, intelligent commentary, no hype. Free.
Editorial commentary on a publicly published patent application. Not legal advice.