Datasette Agent: ask SQLite a question, annotate the chart
Simon Willison's Datasette Advent video shows Datasette Agent analyzing SQLite data and drawing and annotating charts via Datasette Charts.
You can now ask an AI assistant questions about a SQLite database in Datasette, have it draw a chart, then ask it to mark up that chart: in the demo, an annotation explaining a gap in the data. Simon Willison walked through it in a video published December 5, 2026, as an entry in the Datasette Advent calendar. His post calls it Day 4; the datasette.io calendar lists it as Day 5.
The charting comes from the datasette-charts plugin. When it's installed alongside datasette-agent, the agent gets three tools: suggest_charts, chart and annotate_chart. The model writes a chart as a JSON spec, with no JavaScript and no SQL unless it charts a query. Each chart compiles to a SQL query that returns a small aggregated result, so charts never fetch every row. The tools run with the permissions of whoever is chatting, and a chart in the conversation is redrawn from current data each time it's opened. An annotation that names a category the chart doesn't show is returned in an annotation_warnings list instead of being drawn.
Our reading: this design keeps the agent's output checkable. You get a declarative spec and a compiled query you can open in the chart builder. The flip side of live redraws is that an annotation written for last month's data can drift out of place as rows change.
Setup is lighter than it was. The datasette-llm 0.2a0 release adds a datasette llm sub-command, so datasette llm keys set openai works even when the LLM tool isn't on your $PATH. An earlier release added OpenAI-compatible endpoints, letting you run the agent against a local model in LM Studio, Ollama or llama.cpp.
The datasette-charts README says its Python API for agent and plugin use is "not stable yet", and none of these pages list the minimum versions the integration needs.
Try it: sign in with GitHub at the preview instance linked from Willison's post (he says the login is there "purely to discourage abuse"), ask for a chart of a table, then ask the agent to annotate an odd spike or gap. Open the chart in the builder: the note should appear under Annotations.
Sources
- Datasette Agent—an AI assistant for analyzing data in SQLite (Datasette Advent Day 4) · Simon Willison’s Weblog
- GitHub - datasette/datasette-charts: A charting plugin for Datasette · GitHub
- Release: datasette-llm 0.2a0 · Simon Willison’s Weblog
- Release: datasette-llm 0.1a11 · Simon Willison’s Weblog
- Datasette · Datasetteproj