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:

  1. Table Usage: Schema, columns, relationships
  2. Human Annotations: Metrics, definitions, gotchas
  3. Query Patterns: SQL that's known to work
  4. Institutional Knowledge: External docs, research
  5. Memory: Error patterns, discovered fixes
  6. 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 state in one table map to status in 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
MeProjectsWiki
AI Agents & Agentic Engineering
Context EngineeringContext EngineeringBuilding AI AgentsBuilding AI AgentsAgentic Engineering Best PracticesAgentic Engineering Best PracticesAuto-Research and Self-Improving AgentsAuto-Research and Self-Improving AgentsSelf-Maintaining AgentsSelf-Maintaining AgentsScaling Long-Running Autonomous CodingScaling Long-Running Autonomous CodingData AgentsData AgentsAgent Memory and Harness OwnershipAgent Memory and Harness Ownership
LLM Internals & Training
Reinforcement Learning for LLMsReinforcement Learning for LLMsCursor Composer 2Cursor Composer 2Training-Free GRPOTraining-Free GRPOPrompt Repetition for Non-Reasoning LLMsPrompt Repetition for Non-Reasoning LLMsLLM QuantizationLLM QuantizationLLM Knowledge BasesLLM Knowledge Bases
AI Safety & Security
Constitutional ClassifiersConstitutional ClassifiersProject GlasswingProject Glasswing
Personal Development & Mindset
Deep Focus and ProductivityDeep Focus and ProductivityIdentity and Life DesignIdentity and Life DesignSelf-Competition and EntrepreneurshipSelf-Competition and Entrepreneurship
GitHubLinkedIn