In todayâs data-driven world, data analysts, product managers, and business executives must have efficient tools for managing, analyzing, and visualizing data. Imagine being able to query databases using natural language and then export the results directly into Google Sheets.
Google Sheets has become a popular tool for business analysts to analyze their data, boasting over 900 million monthly users in 2024. With Wren AIâs latest integration, you can quickly query databases and seamlessly visualize data in Google Sheets. This blog post will walk you through using RAG architecture to query databases and export data to Google Sheets, helping you enhance your data management practices.
If you need guidance on using Wren AI to connect to your data sources using OpenAI API or hosting locally with Ollama, please check our previous articles below:
Before we start, if you are unfamiliar with Wren AI, you can check out GitHub first. Wren AI is an open-source text-to-SQL solution for data teams to get results and insights faster by asking business questions without writing SQL. Wren AI supports a wide range of data sources, such as DuckDB, MySQL, Microsoft SQL Server, BigQuery, etc⌠Also, she supports open and local LLM inference endpoints such as OpenAI GPT-3-turbo, GPT-4o, and local LLM hosts via Ollama.
Using Wren AI to implement RAG on your database is very simple. First, select your database and fill in the connection information below.
After setting the connection, you can select which table you want Wren AI to pull in the metadata; based on the table schema, you can add semantics via the UI interface, as shown below, on the modeling page.
Selecting one of the models lets you modify the metadata and semantics.
We will use the Wren AI demo site in this tutorial, which you can also check out here. In the Wren AI demo site, you can see several threads asked by previous users.
Click âExtensionsâ in the toolbar, and select âAdd-onsâ, and then click âGet add-onsâ.
Search for âWren AIâ, and you will see there is a search result for Wren AI, called âWren AI for Google Sheetsâ˘â.
Click âInstallâ to start installing the Google Sheet add-in.
After the installation, you can see a new add-on in your extension dropdown! Click on the âOpen Sidebarâ.
And then you will see a Wren AI sidebar!
Now letâs connect to our Wren AI server. In this tutorial, we will use our demo site as an example: https://demo.getwren.ai/home.
After clicking connect, I can choose whether to export from an answered result or a saved view.
I choose âExport data from an answered resultâ in this example, shown below.
Select one of the thread histories, and you can export it to Google Sheets.
When I clicked into a thread, I could âExport it into the sheetâ.
Click âExport to sheet,â and the data will be exported to your Google Sheets!
After loading data into Google Sheets, you can create a report on Looker Studio in one click to conduct further data analysis.
Hooray! Your Report is here!
And thatâs about it!
Check out Wren AI GitHub (https://github.com/Canner/WrenAI) and start analyzing your data!
You can also check out our Google Sheet add-on document here.
If you are interested in Wren AI integration with Excel, check out our other post here.
â
Supercharge Your Data with AI Today?!