GCP – How to tap into natural language AI services using the Conversational Analytics API
AI is making it easier than ever to get clear, reliable answers from your data. With intelligent tools like the Conversational Analytics API, powered by Gemini, you no longer need intricate systems to get insights.
The Conversational Analytics API lets you use everyday language to ask questions of your data in BigQuery or Looker, with more sources to come. This brings powerful business intelligence to your entire organization through the apps you already use, like Slack. Developers can also build custom data agents that understand your business and provide answers where they’re needed.
Now in preview, this API transforms unstructured conversation and structured data into actionable insights, accessible through natural language. You can create custom data agents, map business terms, and define calculations to empower your users and analysts.
- aside_block
- <ListValue: [StructValue([(‘title’, ‘Try Google Cloud for free’), (‘body’, <wagtail.rich_text.RichText object at 0x3e6c936c53d0>), (‘btn_text’, ‘Get started for free’), (‘href’, ‘https://console.cloud.google.com/freetrial?redirectPath=/welcome’), (‘image’, None)])]>
Conversational Analytics API’s intelligent toolkit
The Conversational Analytics API integrates multiple AI-powered tools to process user requests, including Natural Language to Query (NL2Query) and a Python code interpreter for generating responses. A critical context retrieval tool is also utilized to ensure the API’s answers are accurate and relevant by incorporating details about your specific datasets.
Let’s take a peek under the hood:
The engine that powers the Conversational Analytics API
Context retrieval: The key to unlocking relevant answers
For intelligent conversational data interactions, leveraging the context retrieval tool is essential. For BigQuery, the tool meticulously pulls schema information, detailed column, table descriptions from Dataplex. When interacting with Looker, it accesses the LookML model, retrieving field definitions, labels, and defined measures. This deep, accurate understanding of your data’s structure, relationships, and inherent business logic is critical as it enables the agent to become an expert in your data landscape. This ensures every response is firmly grounded, highly relevant, and ultimately, a trusted answer for your business, providing reliable and trusted answers.
NL2Query engine: Turning questions into queries
At the core of the Conversational Analytics API lies a robust NL2Query engine, designed to support both BigQuery and Looker data sources. This engine translates user-provided natural language questions into semantically equivalent and syntactically correct queries appropriate for the specified data source.
For instance, a user could pose a question such as, “What is the average sales value per order item broken down by payment method?” and the engine would process this to generate and execute the necessary query, providing a precise answer without requiring the user to write any SQL. The NL2Query engine’s capability includes handling ambiguity and inferring the customer’s intent from natural language input, ensuring accurate mapping to the underlying dataset structure.
NL2Query transforms natural language to data queries
Python code interpreter: Unleash advanced analytics
Building upon basic query capabilities, the code interpreter functionality within the Conversational Analytics API leverages Python to facilitate advanced analytical tasks. This allows the API to generate and execute Python code for complex calculations and statistical analyses, going beyond what standard query languages can achieve. Users can address intricate scenarios that would be difficult or impossible with SQL alone, accessing sophisticated analyses like statistical modeling and data transformations through Python libraries, all via a conversational interface without needing direct Python coding.
For instance, a user could request to “Calculate churn rate by customer segment, and show me the distribution.” In response, the code interpreter would automatically generate and execute the necessary Python code to perform this analysis and deliver insightful visualizations and statistics.
Code interpreter simplifies data science, leveraging Python code for complex calculations
If you are Interested in testing out the code interpreter tool, currently in preview. Learn more here.
Intelligent visualization engine for data stories that pop
Data in its raw form can often be challenging to interpret. The visualization engine within the Conversational Analytics API addresses this by transforming the results of your queries into compelling visual representations. This capability streamlines the data visualization process, providing benefits such as instant chart generation without the manual steps of selecting data, labeling axes, or choosing chart types and colors. The result is the transformation of numerical data into visually engaging and easily digestible insights that effectively highlight hidden patterns and trends.
For example, a user could request to “Plot total orders by month,” and the system would instantly generate a relevant visualization, such as a line chart, effectively illustrating sales performance over time, ready for sharing and analysis.
Gemini powers smart visualizations to quickly illustrate your data
Start having intelligent conversations with your data
Stop struggling with data complexity. Request a demo today or turn on Conversational Analytics in Looker to begin chatting with your data. You can even bring Conversational Analytics to your own application with this API. Get started in minutes with our quickstart application here.
Read More for the details.