> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://github.com/agno-agi/dash) 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  | Agno `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](/tutorials/dash/setup) for detailed instructions.

```bash theme={null}
git clone https://github.com/agno-agi/dash.git && cd dash

cp example.env .env
# Edit .env and add your OPENAI_API_KEY

docker compose up -d --build

# Generate sample data and load knowledge
docker exec -it dash-api python scripts/generate_data.py
docker exec -it dash-api python scripts/load_knowledge.py
```

Confirm Dash is running at `http://localhost:8000/docs`.

### Connect to the Control Plane

1. Open [os.agno.com](https://os.agno.com)
2. Click **Connect OS** → **Local**
3. Enter `http://localhost:8000`

<Frame>
  <video autoPlay muted loop controls playsInline style={{ borderRadius: "0.5rem", width: "100%", height: "auto" }}>
    <source src="https://mintlify.s3.us-west-1.amazonaws.com/agno-v2/videos/dash-ui-demo.mp4" type="video/mp4" />
  </video>
</Frame>

## Deploy to Railway

See [Deploy to Railway](/tutorials/dash/deploy-to-railway) for JWT setup and production configuration.

Railway deployment uses `.env.production` to keep production credentials separate.

```bash theme={null}
cp example.env .env.production
# Edit .env.production — set OPENAI_API_KEY
```

<Steps>
  <Step title="Deploy infrastructure">
    ```bash theme={null}
    railway login
    ./scripts/railway_up.sh
    ```

    The app will crash-loop until the JWT key is added in the next step. That's expected.
  </Step>

  <Step title="Get your JWT key">
    1. Copy your Railway domain from the output (e.g. `dash-production-xxxx.up.railway.app`)
    2. Open [os.agno.com](https://os.agno.com) → **Connect OS** → **Live**
    3. Paste your Railway URL
    4. Go to **Settings** and generate a key pair
    5. Add the public key to `.env.production`:

    ```bash theme={null}
    JWT_VERIFICATION_KEY='-----BEGIN PUBLIC KEY-----
    MIIBIjANBgkq...
    -----END PUBLIC KEY-----'
    ```
  </Step>

  <Step title="Push environment and redeploy">
    ```bash theme={null}
    ./scripts/railway_env.sh
    ./scripts/railway_redeploy.sh
    ```
  </Step>
</Steps>

### Production Operations

Database scripts must run inside Railway's network:

```bash theme={null}
railway ssh --service dash
# Inside the container:
python scripts/generate_data.py
python scripts/load_knowledge.py
```

## Connect to Slack

Dash can receive DMs, @mentions, and thread replies, and can post to channels proactively.

1. Run Dash with a public URL (ngrok locally, or your Railway domain)
2. Create the Slack app from the manifest in `docs/SLACK_CONNECT.md`
3. Set `SLACK_TOKEN` and `SLACK_SIGNING_SECRET` in `.env`
4. Restart Dash

See [Slack setup](/tutorials/dash/connect-slack) 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:

```bash theme={null}
python scripts/load_knowledge.py            # Upsert changes
python scripts/load_knowledge.py --recreate  # Fresh start
```

## Run Evals

Five eval categories using Agno'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   |

```bash theme={null}
python -m evals                      # Run all evals
python -m evals --category accuracy  # Run specific category
python -m evals --verbose            # Show response details
```

## Source

For architecture details, data model reference, and security configuration, see the [GitHub repo](https://github.com/agno-agi/dash).
