datasette-agent
An LLM-powered agent assistant plugin for Datasette that chats with your databases, runs SQL, and supports extensible tools.
At a Glance
Self-hosted Datasette plugin licensed under Apache License 2.0. Language model usage requires a configured model via datasette-llm, whose provider API costs are external.
Engagement
Available On
Alternatives
Listed Nov 2026
About datasette-agent
datasette-agent is a plugin for Datasette, published under the datasette GitHub organization, that adds an LLM-powered chat assistant to a Datasette instance. Users start conversations at /-/agent, and the agent can explore databases, run SQL, and save queries, with human approval required for sensitive actions. It is released under the Apache 2.0 license.
What It Is
datasette-agent is an AI assistant embedded in Datasette. It calls language models through the datasette-llm plugin and requires models that support tool calling. The agent can list databases and tables, describe tables, run read-only SQL with named parameters, and execute write SQL against mutable databases. A command-line mode (datasette agent chat) offers the same agent in a terminal.
How a Conversation Works
Each conversation pins the model chosen when it starts, and a model picker appears when several tool-capable models are available. Typing # in the chat input autocompletes tables, views, stored queries and databases the user may see, and attaches their schema or details to the message for the model. A side panel can display Datasette pages such as tables and query results next to the chat. Background agents can be launched from /-/agent/background and run toward a goal without further input.
Permissions and Approval
Saving queries and executing write SQL always require explicit user approval, and the approval prompt shows the SQL, parameters, required permissions and destructive-operation warnings. Actions run as the requesting actor through Datasette's own endpoints. Two independent permissions, datasette-agent and datasette-agent-background, control access to the chat and to background agents.
Extending the Agent
Other Datasette plugins can register tools through the register_agent_tools hook, optionally gated by a permission. Tools can return inline HTML for the chat UI, ask the user yes/no, multiple-choice or free-text questions, and run work in the user's browser through browser tasks. Plugins can also register their own #-taggable reference types. The README lists datasette-agent-charts and datasette-agent-openai-imagegen as example plugins.
Community Discussions
Be the first to start a conversation about datasette-agent
Share your experience with datasette-agent, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache-2.0)
Self-hosted Datasette plugin licensed under Apache License 2.0. Language model usage requires a configured model via datasette-llm, whose provider API costs are external.
- Apache License 2.0
- Install with `datasette install datasette-agent`
- Chat assistant at /-/agent
- Model picker and background agents
- Tagging tables, queries and databases with #
Capabilities
Key Features
- Chat assistant at /-/agent
- Model picker with per-conversation pinned model
- # tagging of tables, views, stored queries and databases
- Side panel for showing Datasette pages
- Read-only SQL queries with named parameters
- Write SQL execution with human approval
- Save queries as Datasette stored queries
- Background agents
- Plugin hook for registering agent tools
- Ask-user questions and browser tasks from tools
- Custom reference types for # tagging
- CLI chat and tool listing
- Permission-gated tools
