Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
13bf9dd
Update _config.yml
jorgerocha10 Jul 24, 2025
319c3ed
Update _config.yml
jorgerocha10 Jul 24, 2025
2ff74ba
Update 2014-3-3-Hello-World.md
jorgerocha10 Jul 24, 2025
2a4a183
Update and rename 2014-3-3-Hello-World.md to 2025-7-24-What-is-text-t…
jorgerocha10 Jul 25, 2025
27f1424
Add files via upload
jorgerocha10 Jul 25, 2025
fc393a2
Update _config.yml
jorgerocha10 Jul 25, 2025
fd27164
Update _config.yml
jorgerocha10 Jul 25, 2025
a43c275
Update _config.yml
jorgerocha10 Jul 25, 2025
5c38ad9
Add files via upload
jorgerocha10 Jul 25, 2025
c340c64
Update about.md
jorgerocha10 Jul 25, 2025
885e8e4
Update 2025-7-24-What-is-text-to-SQL.md
jorgerocha10 Jul 25, 2025
986e839
Update _config.yml
jorgerocha10 Jul 25, 2025
eb83c53
Update about.md
jorgerocha10 Jul 25, 2025
39d3161
Add files via upload
jorgerocha10 Jul 25, 2025
628c370
Add files via upload
jorgerocha10 Jul 25, 2025
d865c28
Update about.md
jorgerocha10 Jul 25, 2025
3abd1a1
Update about.md
jorgerocha10 Jul 25, 2025
fcf9572
Update about.md
jorgerocha10 Jul 25, 2025
ce632d8
Update about.md
jorgerocha10 Jul 25, 2025
77feada
Update about.md
jorgerocha10 Jul 25, 2025
7e8ea76
Update 2025-7-24-What-is-text-to-SQL.md
jorgerocha10 Jul 25, 2025
637d4d7
Update about.md
jorgerocha10 Jul 25, 2025
2128146
Update 2025-7-24-What-is-text-to-SQL.md
jorgerocha10 Jul 25, 2025
093bdce
Update 2025-7-24-What-is-text-to-SQL.md
jorgerocha10 Jul 25, 2025
59f4351
Update CNAME
jorgerocha10 Jul 25, 2025
98e6343
Update CNAME
jorgerocha10 Jul 25, 2025
7ca7db5
Delete CNAME
jorgerocha10 Jul 25, 2025
ac28be9
Create CNAME
jorgerocha10 Jul 25, 2025
a471fe5
Update _config.yml
jorgerocha10 Jul 25, 2025
df360c7
Update about.md
jorgerocha10 Jul 25, 2025
5fda32c
Update CNAME
jorgerocha10 Jul 25, 2025
e7f0ec2
Add files via upload
jorgerocha10 Jul 25, 2025
df11d71
Add files via upload
jorgerocha10 Jul 25, 2025
8766b65
Add files via upload
jorgerocha10 Jul 25, 2025
00b070e
Update _config.yml
jorgerocha10 Jul 28, 2025
6d86aa4
Update _config.yml
jorgerocha10 Jul 28, 2025
27135f9
Update about.md
jorgerocha10 Jul 28, 2025
3336de1
Create 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?
jorgerocha10 Jul 29, 2025
6b9b650
Add files via upload
jorgerocha10 Jul 29, 2025
7316763
Rename 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL? …
jorgerocha10 Jul 29, 2025
4cbec3c
Update 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?.md
jorgerocha10 Jul 29, 2025
589d83f
Update 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?.md
jorgerocha10 Jul 29, 2025
307c253
Add files via upload
jorgerocha10 Jul 29, 2025
cb650b3
Update 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?.md
jorgerocha10 Jul 29, 2025
b185a38
Update style.scss
jorgerocha10 Jul 29, 2025
6ae2c74
Update 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?.md
jorgerocha10 Jul 29, 2025
16b21b4
Update 2025-7-28-What-Is-RAG-and-Why-Does-It-Matter-for-Text-to-SQL?.md
jorgerocha10 Jul 29, 2025
7da5a39
Update style.scss
jorgerocha10 Jul 29, 2025
43629f7
Update style.scss
jorgerocha10 Jul 29, 2025
0aa44d7
Create _dark-code.scss
jorgerocha10 Jul 29, 2025
1ff08e2
Update style.scss
jorgerocha10 Jul 29, 2025
19b60e0
Add blog post: What Is Pydantic and Why Should You Use It?
jorgerocha-beans Feb 28, 2026
423788c
Add blog post: Disposable Pixels - The Future of AI-Generated Data Vi…
jorgerocha-beans Apr 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@

www.cubometrics.ca
17 changes: 9 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#

# Name of your site (displayed in the header)
name: Your Name
name: CuboMetrics

# Short bio or description (displayed in the header)
description: Web Developer from Somewhere
description: Build Smarter, Query Better

# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png
avatar: /images/cubometrics.png
#https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png

#
# Flags below are optional
Expand All @@ -21,12 +22,12 @@ footer-links:
email:
facebook:
flickr:
github: barryclark/jekyll-now
github: jorgerocha10
instagram:
linkedin:
linkedin: jorge-rocha-b863b831
pinterest:
rss: # just type anything here for a working RSS icon
twitter: jekyllrb
twitter:
stackoverflow: # your stackoverflow profile, e.g. "users/50476/bart-kiers"
youtube: # channel/<your_long_string> or user/<user-name>
googleplus: # anything in your profile username that comes after plus.google.com/
Expand All @@ -37,11 +38,11 @@ footer-links:
disqus:

# Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking
google_analytics:
google_analytics: G-C89XSHP9RZ

# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url:
url: cubometrics.ca

# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
Expand Down
10 changes: 0 additions & 10 deletions _posts/2014-3-3-Hello-World.md

This file was deleted.

131 changes: 131 additions & 0 deletions _posts/2025-7-24-What-is-text-to-SQL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
layout: post
title: What is Text-to-SQL?
---

I recently stumbled across a tool called [WrenAI](https://getwren.ai/) that claims you can query any database using plain English. I was a little skeptical at first, but after burning through my free credits, I realized they weren’t bluffing. It felt kind of magical to ask questions in natural language and watch it generate relevant SQL and charts in real time.

As someone who works in data modeling and business intelligence, I know how critical a solid underlying model is. Your semantic and reporting layers are only as good as the foundation they sit on. So when a generative AI tool can consistently return useful SQL, readable tables, and insightful charts, you start to wonder if dashboards as we know them are about to be redefined.

What really caught my attention, though, was how tools like this could help democratize access to data. You don’t need to know SQL or even how to use a BI tool. This abstraction layer means non-technical users can get answers on their own, often in seconds. For data teams, that means fewer repetitive ad-hoc requests like “Can you pull sales by region?” or “Oh wait, can you add distribution channel to that?” and more time spent on better modeling and optimization work.

I was curious enough to dig into [WrenAI GitHub repo](https://github.com/Canner/WrenAI/tree/main) to see how it all worked behind the scenes.

![_config.yml]({{ site.baseurl }}/images/how_wrenai_works.png)

At first glance, it looks a bit overwhelming. But the point of this post, and the ones to follow, is to unpack that complexity and explore how these tools actually work under the hood.

Let’s start by breaking down the architecture diagram above.

![_config.yml]({{ site.baseurl }}/images/diagram_breakdown.png)

---

## 1. Connect (Getting the Data In)

### What it does:

This is where a Text-To-SQL system (e.g. WrenAI) connects to your actual data - databases, data warehouses, and more.

- **Connect**: Add a data source (like Synapse Analytics, Snowflake, Postgres, etc.)
- **Reads Metadata**: Grabs table names, column types, and other schema details

Think of it like introducing the Text-To-SQL system to your data for the first time.

---

## 2. Modeling (Defining the Semantics)

### What it does:

Before WrenAI can do anything useful, you help it understand your data by defining semantics - descriptions, meanings, and relationships.

- You describe what fields mean (e.g., `order_total` = total sales).
- It creates a **semantic model** to guide its understanding.

This is where you teach the system your organization’s vocabulary.

---

## 3. Indexing (Organizing the Knowledge)

### What it does:

WrenAI processes your schema, metadata, and semantics, and stores them in a **vector database** for fast and relevant retrieval.

- **Index Processing**: Converts the model into vectorized data
- **Vector Database**: Makes that knowledge easily searchable

It’s like building a memory of your data that the AI can quickly reference.

---

## 4. Retrieval (Finding the Right Context)

### What it does:

When a user asks a question, WrenAI looks through its vector memory to find the most relevant context - like tables, fields, and relationships.

- **Retrieval Service**: Matches the question to the right metadata

It’s like checking your notes before answering an exam question.

---

## 5. Prompting & Generation (Creating the SQL)

### What it does:

Now WrenAI combines the user’s question with relevant context and forms a prompt for an LLM (like GPT-4, Claude, Gemini, you name it, the frontier models will always return better results) to generate SQL.

- **Prompt**: Merges question + metadata
- **LLM**: Generates the SQL query
- **Output Processing**: Validates the query to make sure it works

This is the smart part — translating natural language into working SQL.

---

## 6. Wren UI (The User Interface)

### What it does:

This is what users see. You type your question into a chat-like interface, and WrenAI handles the rest.

- Sends your question to the backend
- Returns SQL results and visualizations

It’s the conversation window where data questions become answers.

---

## 7. Wren Engine (Query Execution Layer)

### What it does:

Once the SQL is ready, it has to run somewhere. That’s the job of the Wren Engine.

- **Core**: Executes the SQL against the connected data source
- **Metastore**: Stores schema and semantic models for reuse

This is the engine room — quietly powering the results behind the scenes.

---

## Summary in Plain English

> You connect your data → define what it means → WrenAI processes and remembers it → when someone asks a question, it finds the right context → sends it to an AI to generate SQL → runs the SQL → and gives the user an answer.

---

## Wrapping Up

Exploring WrenAI gave me a glimpse into what the future of analytics could look like: a world where anyone in a company can ask a question and get a useful answer instantly, without waiting days for a report or dashboard. Under the hood, it's a blend of old-school data modeling, modern indexing, and generative AI — all working together.

What surprised me most is how much of this relies on concepts we already understand as data professionals: schemas, semantics, metadata, and SQL. The magic is in how they're combined.

This is just the beginning. In upcoming posts, I’ll explore each piece in more depth, from building semantic models to how prompts are structured and validated, and share what I learn along the way. My goal is to better understand how to make data truly AI-ready, and I hope you’ll follow along. If you’re curious about this space or already exploring it yourself, let’s learn together.

Cheers,

Jorge Rocha
Loading