The Problem

Text-to-SQL agents fail in production because raw LLMs write SQL against schemas that lack meaning. Column names like position are ambiguous, types mislead (TEXT vs INTEGER), and tribal knowledge about metrics and business rules never reaches the model. Every failure repeats because there is no memory. The result: technically valid queries that produce wrong or useless answers.

What This Does

Dash is a self-learning data agent that grounds SQL generation in six layers of context: table schemas, human annotations, validated query patterns, institutional knowledge, learned error patterns, and live schema introspection. The context lives in dash/knowledge/ as JSON and SQL files, and the agent retrieves relevant pieces at query time via hybrid search before generating SQL.

The self-learning loop is the core differentiator. When a query fails—say, because position is TEXT not INTEGER—the agent saves that lesson and never repeats the mistake. Validated queries can be curated into dash/knowledge/queries/ for future reuse. The architecture is in dash/agents.py, with tools for schema introspection (dash/tools/introspect.py) and query persistence (dash/tools/savequery.py).

The system also distinguishes between returning rows and returning insight. Instead of "Hamilton: 11", Dash produces "Lewis Hamilton dominated 2019 with 11 wins out of 21 races, more than double Bottas's 4 wins." That interpretation layer is what makes it useful to business users.

How To Use It

Setup: Docker is the primary path. Copy example.env to .env, add your OPENAIAPIKEY, then build and start.

cp example.env .env docker compose up -d --build

docker exec -it dash-api python -m dash.scripts.loaddata docker exec -it dash-api python -m dash.scripts.loadknowledge

Running: The API serves at http://localhost:8000/docs (FastAPI docs). The entry point is app/main.py. The web UI connects via os.agno.com by adding a local OS pointing to http://localhost:8000.

Configuration: app/config.yaml holds application settings. The dash/knowledge/ directory is the knowledge base—you extend it by adding table definitions, business metrics, and validated SQL queries. The bundled sample data is Formula 1 racing.

Real-World Use

A financial analytics team deploys Dash against their reporting database. They seed dash/knowledge/business/metrics.json with their revenue definitions and dash/knowledge/queries/commonqueries.sql with approved reporting queries. When an analyst asks "What was our Q3 net revenue by region?", Dash retrieves the metric definition, matches the query pattern, and returns a formatted insight rather than a raw table. When a query fails on a schema quirk, the error is diagnosed and saved as a learning, so the same question works on the next attempt.

Code Health & Issues

Med - No dependency lockfile: pyproject.toml and requirements.txt declare dependencies without pinning exact versions. Builds are not reproducible. scripts/generaterequirements.sh exists but doesn't solve the lockfile problem. Med - Hardcoded sample data: The knowledge base ships with F1 data (dash/knowledge/tables/, dash/knowledge/business/metrics.json). Production use requires replacing this, but there's no documented migration path beyond the loadknowledge.py script. Low - Minimal test coverage: 3 test files exist, but for a system that learns from errors, the evaluation harness (dash/evals/) is the critical piece. Its coverage and rigor are unclear from the structure. Low - External dependency on Agno platform: The "Learning Machine" and web UI integration depend on Agno's hosted services. Self-hosting is not fully documented.

The Bottom Line

Dash is a well-architected answer to a real problem: LLM-generated SQL that doesn't learn from mistakes. The six-layer context approach and self-learning loop are genuinely useful patterns for any team building a data agent. It's best suited to teams that want a working starting point and are willing to curate their own knowledge base—the F1 sample data is a demo, not a production dataset. The missing lockfile and platform dependency are worth noting before committing to production use.