3k Log in Get Started

GenBI - one-click dashboards with generative AI and BI-as-code

GenBI - one-click dashboards with generative AI and BI-as-code

How LLM code generation speeds up dashboard creation

Rill’s vision is not only to deliver blazingly fast dashboards for end users, but to make the act of creating dashboards fast for developers. Below, we show how Rill Developer, Rill’s open-source IDE, uses AI to transform an S3 data source into an operational dashboard in one click.

We’re thrilled to introduce this creative magic in today’s newest 0.41 release of Rill, which is made possible by combining two powerful ideas:

  • Rill’s BI-as-code philosophy means dashboards are defined entirely in code
  • Large language models, like OpenAI’s GPT series, excel at code generation

Rill’s operational dashboards put time-series metrics and dimensions at the center. These are metrics like total revenue, user count, or average revenue per user, which are aggregate measure expressions in SQL. [1]

Given the massive corpus of openly available developer code that large language models (LLMs) have been trained on, prompting an AI to generate syntactically correct SQL expressions for these aggregate measures is straightforward. LLMs have scoured millions of StackOverflow posts so you don’t have to.

Things to know

Incorporating code generation into development environments is not a gimmick, but a trueproductivity accelerator, as evidenced by the impact and success of GitHub Copilot.

  1. Beyond generating BI-as-code with this OpenAI integration, Rill Developer also provides software engineers a fast feedback loop to rapidly edit the code, visualize metrics, and
  2. instantly preview dashboards before deploying them into Rill Cloud or a self-managed environment.

OpenAI + BI-as-code: a synergistic architecture

In Rill, dashboards are defined by a combination of SQL and YAML files, which contain a list of dimensions and measures. Measures are defined by four fields:

  1. Name: A distinctive name for the measure.
  2. SQL expression: The SQL command used for measure evaluation.
  3. Label: A user-friendly, succinct label for end-user display.
  4. Description: An elaborate explanation of the measure.

Below we illustrate the four-step flow that we implemented to enable OpenAI’s GPT-3.5 Turbo to programmatically generate the dashboard YAML spec that underlies Rill’s dashboards.

Our learnings: Trust but validate generated code

Our initial findings revealed that OpenAI models can process a dataset with 50 columns in approximately 10-20 seconds, suggesting up to 10 measures. However, not all suggested measures are valid, primarily due to invalid SQL expressions or non-compliance with the specific SQL dialect of the underlying OLAP engine.

To address this, we introduced a validation phase where we validate by preparing a query against the OLAP engine and refine any invalid AI-generated measures. This ensures the final architecture always produces accurate and valid dashboard specifications.

Future directions

The integration of OpenAI into Rill Developer highlights our dedication to finding leading edge technologies to radically simplify the data-to-dashboard journey. Want to see a list of suggested business KPIs you should add to your dashboards? You can get started in less than two minutes with our install script below, connect with us in our Discord channel to share your feedback.

{{code-block}}

Notes

[1] Language choice matters because the training data for widely adopted languages like SQL is larger, thus LLMs are better at generating BI-as-code in SQL than DAX, LookML, or VizSQL. This is why our friends at Omni embraced a dialect of Excel and Google Sheets’ expressions for their calculations feature .

More Posts

Rill’s Agentic Architecture: Analytics for the AI Era

Rill’s Agentic Architecture: Analytics for the AI Era

From prompt hacks to a unified agentic runtime for analytical work.

Video: Building Fast Agentic Analytics with Google Antigravity and Rill

Video: Building Fast Agentic Analytics with Google Antigravity and Rill

In this walkthrough, we explore how developers and data teams can use the combination of Rill Data + Google Antigravity to build, modify, and scale analytics workflows entirely in code.

Feeding the agentic beast: Building a data stack that AI loves

Feeding the agentic beast: Building a data stack that AI loves

At Rill, we’ve been building for high-concurrency, high-volume analytics workloads from the start. In this post, I’ll focus on the semantic layer — because in agentic analytics it’s the only layer that can simultaneously understand user intent, data topology, and execution cost.