Dash
Self-learning data agent that grounds answers in 6 layers of context.
Dash is a self-learning data agent that gets better with every query.
Traditional Text-to-SQL agents start from scratch on every query. They guess column names, repeat the same mistakes, and never learn from corrections. Your team fixes an error, and the agent makes the same error again tomorrow.
Dash solves this with 6 layers of grounded context and a learning loop that captures every fix. The knowledge base functions like manually-editable model weights: update retrieval context, not neural network parameters.
Checkout the repo for more details.
How It Works
Dash is a team of three agents coordinated by a leader:
| Agent | Role |
|---|---|
| Analyst | Reads company data (read-only), generates SQL, interprets results |
| Engineer | Builds reusable views and summary tables in the dash schema |
| Leader | Routes queries, coordinates the team, posts to Slack |
Schema boundaries: Company data lives in the public schema (read-only). Agent-created views and summary tables live in the dash schema. The Analyst's SQL tools enforce read-only at the PostgreSQL level, not just in prompts.
Six Layers of Context
| 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 | Kern LearningMachine |
| Runtime Context | Live schema changes | introspect_schema tool |
Self-Learning
Two paths run in parallel: the online path answers questions using retrieved context, the offline path captures learnings for future queries. Dash improves without retraining or fine-tuning:
| System | Stores | How It Evolves |
|---|---|---|
| Knowledge | Validated queries, table schemas, business rules | Curated by your team and refined by Dash |
| Learnings | Error patterns, column quirks, team conventions | Managed automatically by the Learning Machine |
When a query fails because position is TEXT and not INTEGER, Dash saves that. Next time, it knows. When your team is focused on IPO prep, Dash learns that "revenue" means ARR, not bookings, and that the board wants cohort retention broken out by enterprise vs SMB.
Insights, Not Just Rows
Dash reasons about what makes an answer useful, not just technically correct.
Question: Who won the most races in 2019?
| Typical SQL Agent | Dash |
|---|---|
Hamilton: 11 | Lewis Hamilton dominated 2019 with 11 wins out of 21 races, more than double Bottas's 4 wins. This performance secured his sixth world championship. |
Run Locally
See Setup guide for detailed instructions.
1git clone https://github.com/kern-agi/dash.git && cd dash23cp example.env .env4# Edit .env and add your OPENAI_API_KEY56docker compose up -d --build78# Generate sample data and load knowledge9docker exec -it dash-api python scripts/generate_data.py10docker exec -it dash-api python scripts/load_knowledge.pyConfirm Dash is running at http://localhost:8000/docs.
Connect to the Control Plane
- Open os.kern.ndx.rocks
- Click Connect OS → Local
- Enter
http://localhost:8000
Deploy to Railway
See Deploy to Railway for JWT setup and production configuration.
Railway deployment uses .env.production to keep production credentials separate.
1cp example.env .env.production2# Edit .env.production — set OPENAI_API_KEYDeploy infrastructure
1railway login2./scripts/railway_up.shThe app will crash-loop until the JWT key is added in the next step. That's expected.
Get your JWT key
- Copy your Railway domain from the output (e.g.
dash-production-xxxx.up.railway.app) - Open os.kern.ndx.rocks → Connect OS → Live
- Paste your Railway URL
- Go to Settings and generate a key pair
- Add the public key to
.env.production:
1JWT_VERIFICATION_KEY='-----BEGIN PUBLIC KEY-----2MIIBIjANBgkq...3-----END PUBLIC KEY-----'Push environment and redeploy
1./scripts/railway_env.sh2./scripts/railway_redeploy.shProduction Operations
Database scripts must run inside Railway's network:
1railway ssh --service dash2# Inside the container:3python scripts/generate_data.py4python scripts/load_knowledge.pyConnect to Slack
Dash can receive DMs, @mentions, and thread replies, and can post to channels proactively.
- Run Dash with a public URL (ngrok locally, or your Railway domain)
- Create the Slack app from the manifest in
docs/SLACK_CONNECT.md - Set
SLACK_TOKENandSLACK_SIGNING_SECRETin.env - Restart Dash
See Slack setup for details.
Example Prompts
Try these on the sample SaaS metrics dataset:
- What's our current MRR?
- Which plan has the highest churn rate?
- Show me revenue trends by plan over the last 6 months
- Which customers are at risk of churning?
Adding Your Own Data
Dash works best when it understands how your organization talks about data:
| Directory | Content |
|---|---|
knowledge/tables/ | Table schemas, column meanings, data quality notes |
knowledge/queries/ | Validated SQL patterns that are known to work |
knowledge/business/ | Metric definitions, business rules, common gotchas |
Load or update knowledge at any time:
1python scripts/load_knowledge.py # Upsert changes2python scripts/load_knowledge.py --recreate # Fresh startRun Evals
Five eval categories using Kern's eval framework:
| Category | What It Tests |
|---|---|
| accuracy | Correct data and meaningful insights |
| routing | Team routes to correct agent/tools |
| security | No credential or secret leaks |
| governance | Refuses destructive SQL operations |
| boundaries | Schema access boundaries respected |
1python -m evals # Run all evals2python -m evals --category accuracy # Run specific category3python -m evals --verbose # Show response detailsSource
For architecture details, data model reference, and security configuration, see the GitHub repo.