## What ships

- **Chart** — a saved SQL query against one database Connection plus a visualization choice (table, scalar, bar, line, area, pie).
- **Dashboard** — a grid of Charts, each one a `DashboardCard` with its own size and position.
- **Run** — every execution (ad-hoc from the editor or from a saved Chart) goes through the same executor with a 30s wall-clock timeout and a 5,000-row cap.
- **Data browser** — the Chart editor reads the tables, views, columns, and data types visible to the selected Connection. Search it, expand a table, insert a quoted column name, or preview a table without writing the starter query yourself.
- **AI-native workflow** — grant an AI Employee a database Connection, then ask them to inspect its schema, validate SQL, save Charts, and assemble a Dashboard that appears in the same Explore UI Members use.

## What you need first

Explore reads from [Integrations](/content/docs/integrations/index.html) — specifically Connections of provider `postgres`, `mysql`, or `clickhouse`. Set one up under `Explore → Integrations`, then it shows up in the Connection picker inside Explore. To delegate analytics, click `Build with AI`, choose the Connection and an AI Employee, and Genosyn can create the Connection Grant before opening Chat.

## Building with an AI Employee

1. Open `Explore` and click `Build with AI`.
2. Choose a connected database and an AI Employee. If they do not already hold its Connection Grant, the action is labelled `Grant & open chat` and creates it before continuing.
3. Review or edit the starter request. Chat opens with the request as a draft; no model runs and no data is queried until you send it.
4. The employee lists its granted Explore Connections, inspects the selected schema, validates each query, saves reusable Charts, creates a Dashboard, and pins the Charts in a readable order. The results appear immediately in Explore and every write carries the AI employee in its audit trail.

## Authoring a Chart

1. Open `Explore` from the sidebar, click `New chart`.
2. Pick the Connection that holds the data.
3. Use the `Data` browser to search the Connection's visible tables and columns. Expand a table to inspect its data types. Click a column to insert its safely quoted name at the SQL cursor, or click the eye beside a table to build and immediately run a `SELECT * … LIMIT 100` preview.
4. Write or refine the SQL, then click `Run`. `Cmd/Ctrl + Enter` runs from the editor; `Cmd/Ctrl + S` saves. Query errors and the elapsed time stay inline so you can iterate without leaving the page.
5. After a successful Run, Explore may suggest a Number, Line, or Bar visualization from the result shape. Accept it in one click or choose any visualization yourself; nothing changes automatically behind your back.
6. Configure the visualization (dimension column, measure column(s), stacking, prefix or suffix), then `Save`. Explore warns before a link takes you away from unsaved edits.

### The six visualization types

- **table** Raw rows. Good fallback when the data doesn't have an obvious shape — and useful as a sanity check before picking a richer viz.
- **scalar** A single big number. Reads the first cell of the first row. Use for KPIs: MRR, weekly signups, p99 latency.
- **bar** Categories on one axis, measure on the other. Configurable orientation (vertical / horizontal) and stacking when there are multiple measure columns.
- **line** Time on the x-axis, measure on the y-axis. Best for any series indexed by a date or timestamp.
- **area** Like line, but filled. Better for cumulative or volume-style series where you want the whole shape to feel weighty.
- **pie** Share of total across a single dimension. Don't reach for it when bar would do — pie is rarely the right call for more than four or five slices.

## Building a Dashboard

1. From `Explore`, click `New dashboard`. Add a title and an optional description, then create it.
2. Click `Add chart` and choose a saved Chart. Charts already on the Dashboard are marked and cannot be added twice. If none exists yet, jump straight to the Chart editor from the picker.
3. In `Edit` mode, use the arrow controls to move a card and the named size menus to resize it. Edit the title in place when the Dashboard needs a shorter label than the saved Chart. Cards collapse into a readable single column on smaller screens.
4. Hit `Done`. `Refresh` reloads every card, while the refresh button on an individual card reloads just that Chart — both use the same 30s / 5,000-row envelope as the editor.

## Sharing with AI Employees

Explore has two grant boundaries. A Connection Grant lets an AI Employee inspect that database, run ad-hoc SQL, create a Chart against it, and change that Chart's SQL. A Chart or Dashboard Grant controls access to the saved Explore row. Charts and Dashboards default to `read` for every employee in the company; their AI author receives `write`.

Open the `Share` menu on any Chart or Dashboard to change a teammate's level, revoke a grant, or invite an employee who didn't default to access. Manage a database Connection Grant from `Build with AI`, the Connection's `Manage access` view, or the employee's Settings → Connections.

### MCP tools

Every employee gets these via the built-in `genosyn` MCP server (subject to the grants above):

- `list_explore_connections`, `get_explore_schema`, and `run_explore_query` — the discovery and validation loop over database Connections explicitly granted to that employee. Credentials are never returned.
- `list_charts`, `get_chart`, `run_chart` — read paths. The `run_chart` tool is the one most teams hit: a teammate asks "what was MRR last month?", the employee finds the right Chart and runs it.
- `create_chart`, `update_chart`, `delete_chart` — write paths. Create requires a Grant on the bound Connection; changing SQL requires both that Connection Grant and `write` on the Chart. Other edits and deletion require `write` on the Chart.
- `list_dashboards`, `get_dashboard`, `create_dashboard`, `add_dashboard_card` — dashboard authoring.

## Limits

- **Query timeout** 30 seconds, wall-clock. Long-running analytical scans should hit a precomputed table, not the live OLTP db.
- **Row cap** 5,000 rows per query. Larger result sets are truncated server-side. Aggregate before you return, or paginate via SQL OFFSET.
- **Connectors** Postgres, MySQL, ClickHouse. Snowflake / BigQuery / Redshift are on the roadmap.
- **No parameters yet** Charts run their SQL verbatim — no :start_date / :customer_id placeholders. Use a SQL view that joins against a date table if you need parameterization today.

## Quick recipes

### Recurring revenue scalar

```sql
SELECT
  ROUND(SUM(amount_cents) / 100.0, 0) AS mrr_usd
FROM subscriptions
WHERE status = 'active'
  AND interval = 'monthly';
```

Viz: `scalar`. Pin to a dashboard alongside other finance KPIs.

### Weekly signups, bar

```sql
SELECT
  date_trunc('week', created_at) AS week,
  COUNT(*) AS signups
FROM users
WHERE created_at >= NOW() - INTERVAL '12 weeks'
GROUP BY 1
ORDER BY 1;
```

Viz: `bar` with dimension `week`, measure `signups`. Switch to `line` to see the trend without the buckets.

### Plan mix, pie

```sql
SELECT plan, COUNT(*) AS customers
FROM subscriptions
WHERE status = 'active'
GROUP BY plan;
```

Viz: `pie`, dimension `plan`, measure `customers`.

## What's deferred

These are on the roadmap but not in v1 — call them out in an issue if you need one:

- Parameters / filters (date range, dropdown bound to a column).
- Scheduled deliveries — email a dashboard PNG at 9am.
- Embedded views — public read-only links, signed.
- Snowflake / BigQuery / Redshift connectors.
- Native (no-SQL) query builder over a column picker — for teammates who don't write SQL.
- AI-suggested charts on a freshly-added connection.
