datasette-charts 0.2a0
- Source
- simonwillison.net
- Date
Context
datasette-charts 0.2a0 lets you ask Datasette Agent for a chart in the chat, and the chart it draws is computed by Datasette from the database, not written out by the model. Datasette is Simon Willison's open-source for exploring and publishing SQLite databases. datasette-charts, which he introduced a day earlier, suggests charts for any table or query and compiles each chart into a SQL query that aggregates across every row, where earlier Datasette charting plugins plotted only the page of results on screen. Datasette Agent is his plugin that adds a to Datasette (earlier coverage of its 0.4a0 release explains how it lets plugins hand work to the browser). The new release connects the two, using what Willison calls the same chart suggestion and generation tools.
According to the pull request, the plugin gives the agent two tools. `suggest_charts` returns ranked chart ideas for a table, view, stored query or SQL query. `chart` takes a spec in the plugin's own chart format, which names the source, chart type, columns and aggregation; the plugin runs the query, draws the chart in the conversation and returns up to 100 of the plotted rows to the model, plus a link that opens the chart in the chart builder beside the chat. If a spec does not fit the data, the tool returns errors so the model can fix it. Both tools run with the permissions of the person chatting, so charting a table needs only permission to view it, not permission to run arbitrary SQL. A chart saved in a conversation redraws from the current data when it is viewed again.
Willison's exported chat shows the sequence. Asked to chart sqlite-utils downloads over time from a `stats` table, the agent first called `suggest_charts` with that package as a filter, then called `chart` with a spec for a line chart of downloads summed by week, and the tool returned the weekly totals it plotted. The model chose what to plot; the totals came from the query. This is an alpha release, and the pull request notes its tests drove the tools with a scripted test model rather than a real .
- Tool — An operation that the software around a model makes available for the model to request, with a name, expected inputs and a kind of result.
- Database and SQL — Persistent structured storage queried and changed through explicit operations.
- Chat assistant — A conversational model that answers questions without directly owning repository changes.
- Large language model — A model trained on large amounts of data to process and generate language.
Checking sign-in…
Loading comments…

