Datasette Agent: An Open-Source AI Assistant for Querying Databases with Natural Language

Simon Willison launches Datasette Agent, an AI assistant for querying databases via natural language
Simon Willison released the first version of Datasette Agent, merging his LLM library with the Datasette data exploration tool to enable natural language querying of SQLite databases. The system leverages LLM tool-calling capabilities to complete the full pipeline from natural language to SQL to natural language responses. It supports plugin extensions (chart generation, image generation, code execution) and is compatible with both cloud and local open-source models, representing the evolution of tool-augmented AI applications.
Simon Willison just released the first version of Datasette Agent—an extensible AI assistant built for Datasette. This marks the official convergence of his LLM Python library, which he's maintained for over three years, with the Datasette data exploration tool, bringing an entirely new conversational interaction experience to data querying and analysis.
Background on these two tools: Datasette is an open-source data exploration tool Simon created in 2017, designed specifically for SQLite databases. It allows users to browse, query, and publish datasets through a web interface, and has been widely adopted in areas like journalism data analysis and government open data visualization. LLM is a Python command-line tool and library he maintains that provides a unified interface to access major large language models from OpenAI, Anthropic, Google, and others, with plugin support for local models. Both projects use a plugin-based architecture and have cultivated active developer communities. The merging of these two projects is a natural technical integration whose time has come.

Querying Databases with Natural Language
The core capability of Datasette Agent is letting users query data stored in Datasette through natural language conversation. You don't need to know SQL—just ask questions as if you're chatting with a person.
Under the hood, this relies on a combination of Text-to-SQL technology and LLM tool-calling capabilities. Text-to-SQL is a classic NLP task, and modern large language models excel at it, especially for dialects with relatively concise syntax like SQLite. More critically, Datasette Agent leverages LLM Function Calling capabilities—the model doesn't just generate SQL, it can directly execute queries and retrieve results through predefined tool interfaces, forming a complete ReAct (Reasoning + Acting) loop. This is much closer to true agent behavior than simple SQL generation.
In the demo, Simon asked the system: "When was the last time Simon saw a pelican?" The Agent automatically generated a precise SQLite query:
SELECT title, commentary, created
FROM blog_beat
WHERE beat_type = 'sighting'
AND (title LIKE '%pelican%' OR commentary LIKE '%pelican%')
ORDER BY created DESC
LIMIT 5
The system not only returned the query results but also composed a natural language answer: the most recent pelican observation was recorded on May 20, 2026, and California Brown Pelicans, Common Loons, Canada Geese, and other species were also observed. This complete pipeline from natural language to SQL to natural language response demonstrates the practical value of AI in data exploration.
The live demo instance at agent.datasette.io runs on Google's Gemini 3.1 Flash-Lite model. Simon describes it as "cheap, fast, and writes SQLite queries without breaking a sweat."
Plugin Ecosystem: Extensible AI Capabilities
One of the most exciting features of Datasette Agent is that it inherits Datasette's plugin-based architecture. Three official plugins have already been released:
datasette-agent-charts
Built on Observable Plot, this plugin enables the Agent to automatically generate data visualizations from query results. Observable Plot is a declarative charting library led by D3.js creator Mike Bostock, designed specifically for exploratory data analysis. It provides a higher level of abstraction than D3.js, generating statistical charts with less code. The plugin lets AI automatically select appropriate chart types and generate configuration code based on query results, using a server-side config generation and client-side rendering architecture that ensures flexibility while avoiding the complexity of server-side chart rendering. Users only need to describe what kind of chart they want to see, and the Agent handles the entire process from data querying to chart rendering.
datasette-agent-openai-imagegen
Integrates ChatGPT Images 2.0 image generation capabilities, adding AI drawing tools to the Agent. This means you can directly request related image generation during a data analysis conversation.
datasette-agent-sprites
Provides the ability to execute code in Fly Sprites persistent sandboxes, further extending the Agent's computational boundaries.
Simon specifically mentioned that developing plugins has been "a lot of fun," and he has a large number of prototypes that haven't yet reached alpha quality. Even more interesting is that Claude Code and OpenAI Codex can both effectively assist in writing Datasette Agent plugins—just point them at the datasette-agent repository as a reference and describe the feature you want to build.
Local Models Work Too
Datasette Agent isn't locked to any specific cloud model. Simon demonstrated a solution that runs locally with a single uv command, using LM Studio to load Google's gemma-4-26b-a4b open-source model:
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
There are several noteworthy technical details here. The uvx command comes from uv—a next-generation Python package manager written in Rust by Astral, 10-100x faster than pip. Its uvx subcommand is similar to npx, running Python tools without prior installation while automatically handling dependency isolation. It represents a significant improvement in developer experience for the Python ecosystem. LM Studio is a desktop application that provides local model management and an OpenAI-compatible API service, allowing developers to swap cloud models for local models without code changes. The 'a4b' in the model name indicates a Mixture of Experts (MoE) architecture with approximately 4B activated parameters, significantly reducing inference resource requirements while maintaining high capability.
Datasette Agent's core requirements for models are: reliable tool-calling capabilities and the ability to generate correct SQLite queries. Simon notes that open-weight models released in the past six months have been performing increasingly well in this regard—early open-source models showed a noticeable gap compared to GPT-4 in tool-calling reliability, but continued iterations of the Llama 3, Qwen 2.5, Gemma, and other model families have largely closed this gap. This means a fully offline, local data analysis assistant is now a reality.
Future Roadmap: The Seeds of a Personal AI Assistant
The release of Datasette Agent isn't just a product milestone—it opens up numerous possibilities for the LLM and Datasette ecosystems:
LLM library refactoring: Agent development directly drove a major refactoring of LLM 0.32a0. Simon plans to extract some of the "LLM agent" abstractions into a stable release.
Claude Artifacts-like experience: Simon is exploring his own version of Artifacts functionality, developed as a plugin, with good progress so far.
Personal AI assistant "Claw"
Related articles
Tech FrontiersA Rare Quiet Day in AI: Recursive Self-Improvement Stirs Beneath the Surface
A rare quiet day in AI sees multiple sources go silent simultaneously. Behind the calm, Recursive Self-Improvement (RSI) research continues. What this means for the industry.
Tech FrontiersReve 2 vs. Ideogram 4: A Deep Dive into Layout Control in AI Image Generation
A deep comparison of Reve 2 and Ideogram 4's layout control capabilities, covering technical approaches, real-world use cases, and industry trends for designers and creators.
Tech FrontiersIn the Weights: Check Your Influence Score in the AI World
In the Weights is an AI influence search engine that quantifies your presence in the AI world with a score. Explore how it evaluates practitioners and what it means for digital identity.