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

# Visualization Agent

> The Visualization Agent creates interactive charts and dashboards from your data — just describe what you want to see.

## Overview

The Visualization Agent transforms your data into interactive charts and visualizations. Describe what you want to see in plain English, and it analyzes your data, selects the right chart type, generates a validated **Vega-Lite** specification, and renders it directly in the BrightAgent interface — with tooltips, responsive layouts, and proper formatting.

## Demo: Visualization Agent in Action

<iframe className="w-full aspect-video rounded-xl" src="https://www.loom.com/embed/3c52b03b08434967bae5850d053911bd?sid=946bb8e2-ae73-461e-bb36-cd667dee3721&t=855" title="Brighthive E2E Demo - Visualization Agent" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

*This demo starts at 14:15 and shows the visualization agent creating charts and dashboards.*

## What You Can Ask

* *"Show me a bar chart of sales by region"*
* *"Create a trend line of customer acquisition costs over the past year"*
* *"Display the correlation between marketing spend and revenue"*
* *"Generate a breakdown of our top product categories"*
* *"Compare this quarter's metrics to last quarter as a pie chart"*
* *"Show me a heatmap of activity by day and hour"*

## How It Works

```mermaid theme={null}
graph TD
    A[Your Request] --> B[Data Retrieved or Prepared]
    B --> C["Phase 1: Analyze Data + Plan Chart"]
    C --> D["Phase 2: Generate Vega-Lite Spec"]
    D --> E{Schema Valid?}
    E -->|No| D
    E -->|Yes| F[ChartViewer Rendered in BrightAgent]
```

1. **You describe what you want** — Natural language request for any visualization, with optional chart type preferences.
2. **Data is prepared** — The Analyst or Retrieval Agent queries your warehouse and returns results, or the agent reads from existing artifacts.
3. **Phase 1: Planning** — An LLM analyzes a data sample to understand column types, distributions, and patterns. It selects the optimal chart type and maps columns to visual encodings.
4. **Phase 2: Generation** — A more capable LLM produces a complete Vega-Lite v6 specification following the plan — including axes, colors, tooltips, and responsive layout.
5. **Validation** — The specification is validated against the Vega-Lite schema. If invalid, the agent applies a retry strategy with error context until the specification passes.
6. **Rendered in BrightAgent** — The chart appears as an interactive **ChartViewer** component with hover tooltips, responsive scaling, and proper formatting.

## Chart Type Selection

The agent automatically recommends the best visualization based on your data characteristics:

| Data Pattern          | Chart Type               | When Used                                 |
| --------------------- | ------------------------ | ----------------------------------------- |
| Categories + numbers  | **Bar chart**            | Comparing values across groups            |
| Time series           | **Line chart**           | Showing trends over time                  |
| Filled time series    | **Area chart**           | Emphasizing volume or cumulative trends   |
| Two numeric variables | **Scatter plot**         | Exploring relationships and correlations  |
| Part-of-whole         | **Arc / donut**          | Showing composition or proportions        |
| Distributions         | **Histogram / box plot** | Understanding data spread and outliers    |
| Dense matrices        | **Heatmap**              | Showing patterns across two dimensions    |
| Geographic data       | **Map-based**            | Spatial analysis and regional comparisons |

You can always override the recommendation — just specify the chart type you want.

## Interactive Features

Every chart includes built-in interactivity:

<CardGroup cols={2}>
  <Card title="Tooltips" icon="message">
    Hover over any data point to see detailed values. Tooltips automatically include relevant fields from your data.
  </Card>

  <Card title="Responsive Layout" icon="arrows-left-right">
    Charts automatically scale to fit the available space — from full-width dashboards to mobile views.
  </Card>

  <Card title="Color Encoding" icon="palette">
    Categories are automatically distinguished by color using accessible palettes. Numeric values can use gradient scales.
  </Card>

  <Card title="Intelligent Formatting" icon="hashtag">
    Numbers, dates, currencies, and percentages are formatted appropriately based on data type — no manual configuration needed.
  </Card>
</CardGroup>

## Data Sources

The Visualization Agent receives data through multiple pathways:

* **From the Analyst Agent** — Pre-analyzed data ready for charting, often as part of a multi-step workflow
* **From the Retrieval Agent** — Raw query results from your warehouse, passed as artifacts with full metadata
* **From S3 files** — Data files generated by other agents or uploaded directly, read from your organization's storage

The agent handles data loading, type detection, and any necessary transformations before generating the chart.

## Works With Other Agents

* **Analyst Agent** provides aggregated query results and statistical insights that feed directly into visualizations.
* **Retrieval Agent** identifies and fetches the right data assets, creating artifacts the Visualization Agent can consume.
* **BrightAgent** coordinates multi-step workflows like *"analyze sales by region and chart it"* — routing through Retrieval, Analyst, and Visualization in sequence.

<Callout type="info">
  The Visualization Agent is part of the [BrightAgent architecture](/brightagent/architecture). See [capabilities](/brightagent/capabilities) for the full list of what BrightAgent can do.
</Callout>
