agentao

Blueprint D · Data Analyst Workbench

A DuckDB + matplotlib workbench: ask a natural-language analytical question; the agent writes SQL, runs it, and optionally produces a PNG chart.

Corresponds to Part 7.4 of the developer guide.

What it demonstrates

How to run

cp .env.example .env                    # add OPENAI_API_KEY
uv sync
uv run python -m src.workbench \
  "Which 3 products had the largest total revenue? Render a bar chart."

On first run the entry point seeds ./data/sales.parquet with 10 rows of fake sales data, then drives the agent. Expected tail of stdout:

...
[CHART] chart-revenue.png

Generated charts:
  - /.../examples/data-workbench/workspaces/demo/chart-revenue.png

Open the PNG to inspect the chart.

File map

Path Role
src/workbench.py Entry point — seeds fake data, builds agent, activates both skills, parses [CHART] marker
.agentao/skills/duckdb-analyst/SKILL.md How to query parquet with DuckDB + print the SQL
.agentao/skills/matplotlib-charts/SKILL.md Chart format + [CHART] … return contract
data/sales.parquet Seeded on first run (git-ignored)
workspaces/demo/ Per-session workdir with skill symlinks + data symlink (git-ignored)

Not included