Datasette Agent 为 Datasette 增加对话式 AI

Simon Willison··作者 Simon Willison

关键信息

现场演示使用的是 Gemini 3.1 Flash-Lite,Willison 说它便宜、速度快,而且能够很好地编写 SQLite 查询。Datasette Agent 的设计强调插件扩展性,目前已发布的早期插件包括基于 Observable Plot 的图表生成,以及基于 ChatGPT Images 2.0 的图像生成工具。

资讯摘要

Simon Willison 表示,Datasette Agent 的首个版本已经发布,这也标志着他长期开发的 LLM 工作与 Datasette 终于结合到了一起。Datasette Agent 是一个可扩展的 AI 助手,运行在 Datasette 之上,允许用户用自然语言询问存储在其中的数据。安装 datasette-agent-charts 插件后,它还可以基于数据生成图表。Willison 录制演示视频时使用的是 agent.datasette.io 这个在线演示站点,其中运行了若干示例数据库,包括经典的 Global Power Plants 数据集,以及他博客的一个备份副本。这个演示使用 Gemini 3.1 Flash-Lite,Willison 说它成本低、速度快,而且编写 SQLite 查询没有问题。

演示中的一个问题是“Simon 最近一次看到鹈鹕是什么时候”,系统据此生成了一条针对他博客数据的 SQL 查询来寻找答案。最终系统回答说,最近一次鹈鹕目击记录发生在 2026 年 5 月 20 日,并列出了那次观察中记录到的鸟类和其他动物。Willison 还强调,插件机制是这个项目最有意思的部分,因为 Datasette Agent 延续了 Datasette 一贯的插件优先设计。目前已经发布了三个插件,其中包括使用 Observable Plot 生成图表的插件,以及基于 ChatGPT Images 2.0 的图像生成工具。

Datasette Agent 为 Datasette 增加对话式 AI

资讯正文

我们刚刚<a href="https://datasette.io/blog/2026/datasette-agent/">宣布了 Datasette Agent 的首个版本</a>,这是一款为 Datasette 设计的新型可扩展 AI 助手。过去三年多来,我一直在开发我的 <a href="https://llm.datasette.io/">LLM</a> Python 库,而 Datasette Agent 标志着 LLM 与 <a href="https://datasette.io/">Datasette</a> 终于走到了一起。我对此感到非常兴奋!

Datasette Agent 提供了一个对话式界面,用于向你存储在 Datasette 中的数据提问。安装 <a href="https://github.com/datasette/datasette-agent-charts">datasette-agent-charts</a> 插件后,它还可以为你的数据生成图表。

The demo

<a href="">公告文章</a>(发布在新的 Datasette 项目博客上)包含了这段 <a href="https://www.youtube.com/watch?v=AFZKp6hbFjI">演示视频</a>:

我用新的 <a href="https://agent.datasette.io/">agent.datasette.io</a> 在线演示实例录制了这段视频,该实例运行的是 Datasette Agent,针对包括经典的由 <a href="https://www.wri.org/research/global-database-power-plants">WRI</a> 提供的 <a href="https://datasette.io/global-power-plants">global-power-plants</a>,以及我博客的一个 <a href="https://datasette.simonwillison.net/">Datasette 备份</a> 等示例数据库。

这个在线演示运行在 <a href="https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite">Gemini 3.1 Flash-Lite</a> 上——它便宜、快速,而且编写 SQLite 查询毫无困难。

我在演示中问了一个问题:

西蒙最近一次看到鹈鹕是什么时候?

系统执行了 <a href="https://datasette.simonwillison.net/simonwillisonblog?sql=SELECT+title%2C+commentary%2C+created+FROM+blog_beat+WHERE+beat_type+%3D+%27sighting%27+AND+%28title+LIKE+%27%25pelican%25%27+OR+commentary+LIKE+%27%25pelican%25%27%29+ORDER+BY+created+DESC+LIMIT+5">这条 SQL 查询</a>:

而它回答说:

西蒙最近一次记录到鹈鹕是在<strong>2026 年 5 月 20 日</strong>。

这次观察中还包括一只加州褐鹈鹕,以及一只普通潜鸟、一只加拿大雁、一只条纹滨蟹和一只加州海狮。

这里有<a href="https://simonwillison.net/2026/May/20/sighting-363395265/">我博客上的那次提及</a>,以及完整对话记录的<a href="https://gist.github.com/simonw/a46d17b69659a4866adb1d868280091d">Markdown 导出</a>。

#### 这些插件

我最喜欢 Datasette Agent 的一点是,和 Datasette 的其他部分一样,它可以通过插件扩展。

到目前为止,我们已经发布了三个插件:

<a href="https://github.com/datasette/datasette-agent-charts">datasette-agent-charts</a>,视频中展示过,它为 Datasette Agent 增加了图表功能,由 <a href="https://observablehq.com/plot/">Observable Plot</a> 提供支持。

<a href="https://github.com/datasette/datasette-agent-openai-imagegen">datasette-agent-openai-imagegen</a> 使用 <a href="https://openai.com/index/introducing-chatgpt-images-2-0/">ChatGPT Images 2.0</a> 为 Datasette Agent 增加了图像生成工具。

<a href="https://github.com/datasette/datasette-agent-sprites">datasette-agent-sprites</a> 提供了在 <a href="https://sprites.dev/">Fly Sprites</a> 持久化沙箱中执行代码的工具。

构建插件真的很有趣。我还有一堆原型,但它们还没到 alpha 级质量。

Claude Code 和 OpenAI Codex 在编写插件方面都表现得非常出色——只要把它们指向 <a href="https://github.com/datasette/datasette-agent">datasette-agent 仓库</a>的一个检出版本作为参考,然后告诉它们你想构建什么就行!

#### 在本地模型上运行它

我也一直在把这个新插件拿来和本地模型一起玩。下面是在 Mac 上通过 <a href="https://lmstudio.ai">LM Studio</a>,用 <a href="https://huggingface.co/google/gemma-4-26B-A4B">gemma-4-26b-a4b</a> 运行该插件的一个 `uv` 单行命令:

```shell

uvx --prerelease=allow \

--with datasette-agent --with llm-lmstudio \

datasette --internal internal.db --root \

-s plugins.datasette-llm.default_model lmstudio/google/gemma-4-26b-a4b \

data.db

```

Datasette Agent 需要可靠的工具调用能力,以及让模型生成可在 SQLite 上运行的 SQL 查询的能力。过去六个月里发布的开源权重模型,越来越能够胜任这件事。

#### 下一步是什么

Datasette Agent 为 LLM 以及更广泛的 Datasette 生态打开了<em>太多太多</em>机会。

它已经影响了<a href="https://simonwillison.net/2026/Apr/29/llm/">LLM 0.32a0 的重大重构</a>,我几乎已经准备好把它纳入稳定版发布,或许还会从 Datasette Agent 本身中提取出一些额外的“LLM agent”抽象层。

我一直在探索自己对 Claude Artifacts 的一种理解,目前作为一个插件的形态进展得相当不错。

我很兴奋能用 Datasette Agent 来构建我自己的 <a href="https://simonwillison.net/2026/May/19/5-minute-llms/#5-minutes-llms.013.jpeg">Claw</a>——这是一个围绕从我数字生活不同部分导入的数据构建的个人 AI 助手,这也给了我一个很好的理由,去重新审视我更早的 <a href="https://dogsheep.github.io">Dogsheep</a> 工具家族。

我们也会面向 <a href="https://datasette.cloud/">Datasette Cloud</a> 的用户推出 Datasette Agent。

如果你想讨论这个项目,欢迎加入我们的 <a href="https://discord.gg/hdxyusUFv">#datasette-agent Discord 频道</a>。

标签:<a href="https://simonwillison.net/tags/projects">projects</a>,<a href="https://simonwillison.net/tags/sqlite">sqlite</a>,<a href="https://simonwillison.net/tags/ai">ai</a>,<a href="https://simonwillison.net/tags/datasette">datasette</a>,<a href="https://simonwillison.net/tags/generative-ai">generative-ai</a>,<a href="https://simonwillison.net/tags/llms">llms</a>,<a href="https://simonwillison.net/tags/llm">llm</a>,<a href="https://simonwillison.net/tags/uv">uv</a>,<a href="https://simonwillison.net/tags/datasette-agent">datasette-agent</a>

来源与参考

  1. 原始链接
  2. Datasette Agent

收录于 2026-05-22