Back office ops · Production

Complex SQL Joins with LangGraph and Waii for Conversational Analytics

The problem

Handling complex SQL joins is a widely unsolved, table-stakes challenge for conversational analytics systems that translate natural language into database queries, limiting data accessibility for non-technical users.

Workflow diagram · grounded in source
1
User inputs question
trigger
“User inputs a question.”
2
Question Classifier routes request
routing
“An LangGraph Question Classifier decides if the request is best answered from memory or from database”
3
Waii SQL Generator creates query
ai_action
“The Waii SQL Generator creates an optimized SQL query.”
4
SQL Executor runs with security
integration
“The Waii SQL Executor injects security constraints, executes the query, and retrieves results.”
5
Result Classifier selects output format
routing
“A Result classifier decides if the output should be data or visualization.”
6
Chart Generator produces visualization
output
“The Waii Chart Generator creates relevant charts from the data and metadata.”
7
Insight Agent synthesizes results
ai_action
“A LangGraph Insight Generation Agent synthesizes the final results for the user”
8
Conversation loop with state
feedback_loop
“Throughout this process, the Conversation Management Agent maintains state, allowing for contextual follow-up questions and a more natural, flowing interaction.”
Reported outcome

The LangGraph and Waii integration handles complex multi-table joins from natural language, making data analysis accessible to non-technical users and dramatically lowering the barrier to high-quality insights from data.

Reported metrics
Barrier to data insightsdramatically lowers the barrier to high-quality insights from data
Reported stack
LangGraphWaiiLangChainChatOpenAIplotlypandas
Source
https://blog.waii.ai/complex-sql-joins-with-langgraph-and-waii-9e3b093b2942
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

The LangGraph and Waii integration handles complex multi-table joins from natural language, making data analysis accessible to non-technical users and dramatically lowering the barrier to high-quality insights from data.

What tools did this team use?

LangGraph, Waii, LangChain, ChatOpenAI, plotly, pandas.

What results were reported?

Barrier to data insights: dramatically lowers the barrier to high-quality insights from data (source-reported, not independently verified).

How is this back office ops AI workflow structured?

User inputs question → Question Classifier routes request → Waii SQL Generator creates query → SQL Executor runs with security → Result Classifier selects output format → Chart Generator produces visualization → Insight Agent synthesizes results → Conversation loop with state.