Player not loading? Watch on YouTube
Cainã Max Couto da Silva explains how to build an AI agent that turns plain English questions into SQL and executes queries against a live database. The tutorial uses Brazilian Olist e-commerce and marketing data, with PostgreSQL available locally or on AWS. Docker supports the local database and n8n setup; the model calls in the demonstrations use OpenAI, so this is not an offline walkthrough.
The session compares n8n's visual workflow, Vanna AI's retrieval-based approach, and SQL abstractions in LlamaIndex and LangChain. In the Vanna demo, a question initially produces guessed table and column names before the speaker adds schema context through Vanna’s Chroma-backed retrieval setup. This training step stores retrieval context rather than fine-tuning model weights. He later identifies an incorrect chart in the app, although he judges the query and table output correct. These are observations from the demonstration, rather than general reliability tests.
His preferred LangGraph design routes small talk separately from database questions. The SQL path combines selected schema details with similar question-and-query examples retrieved through RAG, and calls for syntax and safety validation followed by human approval before execution. The final code tour covers configuration, memory and supporting notebooks rather than a full implementation walkthrough.
The Q&A addresses complex joins and inconsistent answers. The speaker reports that examples helped his own system, recommends evaluating expected results, and says engineers still review outputs used in scientific papers.