Dash: A Self-Learning Data Agent That Remembers Its SQL Mistakes
Watch on TikTok
Agno open-sourced Dash, a data agent that fixes the core problem with text-to-SQL tools: they are stateless. A typical text-to-SQL agent hallucinates a column name, crashes, and makes the same mistake again the next day. Dash stores context, learns from errors, and grounds its queries in patterns that already work. It was inspired by OpenAI's internal data tooling.
The Problem with Stateless Text-to-SQL
Raw LLMs writing SQL hit a wall fast. Schemas lack meaning. Types are misleading. Tribal knowledge is missing. Without that context, the model guesses at column names, joins, and business logic, and gets them wrong repeatedly.

Six Layers of Grounded Context
Dash solves this with six layers of context that the agent retrieves at query time via hybrid search:
| Layer | Purpose | Source |
|---|---|---|
| Table Usage | Schema, columns, relationships | knowledge/tables/*.json |
| Human Annotations | Metrics, definitions, business rules | knowledge/business/*.json |
| Query Patterns | SQL that is known to work | knowledge/queries/*.sql |
| Institutional Knowledge | Docs, wikis, external references | MCP (optional) |
| Learnings | Error patterns and discovered fixes | Agno Learning Machine |
| Runtime Context | Live schema changes | introspect_schema tool |

The agent retrieves relevant context at query time, then generates SQL grounded in patterns that already work. This is not just RAG over documentation. It includes validated queries, business definitions, and error corrections.
The Self-Learning Loop
Dash calls this "GPU-poor continuous learning." It improves without retraining or fine-tuning. The system learns through two complementary systems:
- Knowledge: Validated queries and business context, curated by you and Dash together.
- Learnings: Error patterns and fixes, managed by the Learning Machine automatically.
When Dash writes bad SQL, it logs the error and the fix. Over time, it stops making the same mistakes. The learning persists across sessions, so the agent gets better with use.
Quick Start
Setup runs through Docker:
git clone https://github.com/agno-agi/dash.git && cd dash
cp example.env .env
docker compose up -d --build
docker exec -it dash-api python -m dash.scripts.load_data
docker exec -it dash-api python -m dash.scripts.load_knowledge

Once running, connect via the Web UI at os.agno.com or localhost:8000. The included sample dataset is F1 race data, and you can test with questions like "Who won the most F1 World Championships?" or "Compare Ferrari vs Mercedes points 2015-2020."
Key Takeaways
- Dash grounds SQL generation in six layers of context including schema knowledge, validated queries, and learned error corrections
- The self-learning loop logs SQL errors and their fixes, so the agent stops repeating the same mistakes across sessions
- No fine-tuning or retraining required. The agent improves through use.
Resources
- agno-agi/dash -- GitHub repository with full documentation and sample dataset
Published May 25, 2026. Writeup generated from a favorited TikTok.