Data Agents
Data agents are AI systems that translate natural language questions into SQL queries, execute them, and deliver insights. They are grounded in layered context to avoid hallucination. OpenAI built one internally, and Ashpreet Bedi open-sourced a version called Dash that implements the same architecture.
Source: Ashpreet Bedi / Dash
The Problem
Most Text-to-SQL agents are stateless. They make mistakes, you fix them, and they make the same mistake again because every session starts fresh. Without context, even strong models hallucinate column names, miss type quirks, and ignore tribal knowledge.
Dash Architecture
Dash is a self-learning data agent that grounds answers in 6 layers of context and improves with every run.
The Six Layers of Context
See context-engineering for the broader theory. Dash implements these six layers:
- Table Usage: Schema, columns, relationships
- Human Annotations: Metrics, definitions, gotchas
- Query Patterns: SQL that's known to work
- Institutional Knowledge: External docs, research
- Memory: Error patterns, discovered fixes
- Runtime Context: Live schema when things change
The agent retrieves relevant context at runtime via hybrid search, generates grounded SQL, then uses results to deliver insights.
The Self-Learning Loop
Instead of fine-tuning or retraining, Dash learns through two complementary systems:
Static Knowledge: Validated queries, business context, table schemas, data quality notes, metric definitions, tribal knowledge, gotchas. Curated by the team and maintained alongside Dash. It also auto-updates successful queries as it discovers them.
Continuous Learning ("GPU-poor continuous learning"): Patterns Dash discovers through trial and error:
- Columns named
statein one table map tostatusin another - The team is preparing for an IPO, so S-1 metrics live in a separate dataset
- "Revenue" means ARR not bookings
- The board wants cohort retention broken out by enterprise vs SMB
Every learning becomes a data point that improves Dash. Implementation is simple: about 5 lines of configuration using a LearningMachine with agentic user profile, user memory, and learned knowledge.
Practical Setup
Dash ships as a Docker container with:
- Sample F1 racing data (1950-2020)
- Knowledge base (table metadata, validated queries, business rules)
- Evaluation suite (string matching, LLM grading, golden SQL comparison)
- UI via Agno (os.agno.com)
GitHub: github.com/agno-agi/dash
The Enterprise Case
"Data agents are one of the best enterprise use cases for AI right now. Every company (over a certain size) should have one." Vercel has d0, OpenAI built one internally, Dash makes it accessible to everyone.
Related Topics
- context-engineering - The six layers of context in depth
- llm-knowledge-bases - Karpathy's related approach to building persistent knowledge
- auto-research - Self-improvement through experimentation loops