QueryData has launched in preview, offering a powerful tool that translates natural language into database queries with near-perfect accuracy. This tool enhances user experiences across AlloyDB, Cloud SQL (for MySQL and PostgreSQL), and Spanner (for GoogleSQL), building on Google Cloud's top ranking in the BiRD benchmark for natural-language-to-SQL translation.
Organizations like Hughes Network Systems have already implemented QueryData, reporting significant improvements in their user support operations. Amarender Singh Sardar, Director of AI at Hughes, noted that the tool has been crucial in achieving near-100% accuracy in their production environment, highlighting the potential of agentic systems.
The Rise of Agentic Systems
Agentic systems are evolving from merely advising humans to actively making decisions. For these systems to function effectively, they need precise data from operational databases, such as pricing and inventory records. The ability to convert natural language requests into accurate database queries is essential for these agents to perform their tasks.
Challenges in Natural Language Processing
There are three main challenges when agents query enterprise data:
- Accuracy: Inaccurate responses can lead to poor business decisions and financial losses. A 90% accuracy rate is often insufficient for effective action.
- Security: Ensuring that agents only access authorized data is critical. Traditional probabilistic access controls can fall short, leading to potential security breaches.
- Ease of Use: High accuracy requires extensive contextual information about the data, which can be cumbersome for developers to provide.
Bridging the Accuracy Gap
While large language models (LLMs) excel at generating query code, crafting precise queries requires more than just coding skills. Key factors include:
- Schemas: Often unclear, schemas can use abbreviations that confuse developers.
- Ambiguous Values: Numeric values in columns can represent different statuses, complicating query accuracy.
- Business Logic: Schemas may not capture specific business definitions, leading to misunderstandings.
- Underspecified Queries: Natural language questions can be vague, making it difficult to ascertain the intended meaning.
How QueryData Achieves High Accuracy
QueryData utilizes the Gemini LLM and contextual information about the database to enhance accuracy. This includes:
- Schema Ontology: Provides detailed descriptions of data meanings, helping to resolve ambiguities.
- Query Blueprints: Offers guidelines for writing specific queries based on common question types.
When necessary, QueryData can prompt for clarifying questions to ensure accuracy.
Ensuring Security
For agentic applications, deterministic and auditable security is essential. Developers can implement Parameterized Secure Views (PSVs) to control agent access based on fixed parameters like user ID. This method ensures that agents cannot access restricted data, even if they attempt to do so. PSVs are currently supported in AlloyDB and will be available soon for Cloud SQL and Spanner.
Simplifying Integration
Integrating QueryData into workflows is straightforward. The QueryData API can be directly utilized or accessed via the open-source Model Context Protocol (MCP) Server. This API works across various database dialects, eliminating the need for database-specific code.
Additionally, developers benefit from tools that support context engineering, which is vital for optimizing query accuracy:
- Context Generation: The Context Engineering Assistant helps create initial context sets for databases.
- Evaluation Framework: The Evalbench framework allows developers to measure accuracy against specific tests.
- Optimization: The Assistant reviews evaluation results and recommends adjustments to improve accuracy.
Applications of QueryData
Developers are already leveraging QueryData for various applications, including:
- Customer-Facing Tools: A real estate search engine that converts user prompts into database queries and schedules appointments.
- Internal Applications: An AI-driven staffing app that queries HR data to assist managers in scheduling shifts.
- Multi-Agent Systems: A trade compliance workflow where an agent verifies customer identity through database queries.
Next Steps
Organizations can start using QueryData for accurate database calls today. For further information, developers are encouraged to explore the technical documentation for AlloyDB, Cloud SQL for PostgreSQL, Cloud SQL for MySQL, and Spanner.