Datasette ChatGPT plugin
The datasette-chatgpt-plugin is an innovative tool that converts a Datasette instance into a GPT-3 powered interface capable of querying and interacting with yo...
Last verified:
Visit Datasette ChatGPT plugin
What is Datasette ChatGPT plugin?
The datasette-chatgpt-plugin is a Datasette plugin that transforms any Datasette instance into a ChatGPT plugin, enabling users to ask questions about their data using ChatGPT's natural language interface. Created by Simon Willison, this tool provides a conversational interface for querying SQLite databases hosted in Datasette, making data exploration accessible to users without deep SQL knowledge.
Key features include the ability to execute SQLite SQL queries through ChatGPT conversations, automatic plugin discovery via the /.well-known/ai-plugin.json endpoint, and support for common data queries like listing tables or fetching rows from specific tables. The plugin exposes a single database operation that accepts SQLite SQL queries and returns JSON results, though it does not support PRAGMA statements.
This tool is designed for Datasette users who want to integrate their data with ChatGPT, including data analysts, data journalists, open data researchers, and developers working with SQLite databases. It's particularly valuable for those who want to explore datasets publicly hosted on Datasette instances or who have their own deployed Datasette instances they want to make queryable through AI.
Datasette ChatGPT plugin pricing
Pricing model: Free
Free and self-hostable. The plugin is open source with no paid tiers - users can install it freely on their existing Datasette instances. The cost is zero for the plugin itself, though users need their own ChatGPT Plus subscription to access the ChatGPT plugins feature.
Datasette ChatGPT plugin pros
- Turns any Datasette instance into a ChatGPT plugin
- Enables natural language queries for database questions
- Open source and self-hostable
- Simple installation with datasette install command
- Integrates seamlessly with ChatGPT plugins system
- Supports SQLite SQL query execution
- Returns query results in JSON format
- Automatic plugin discovery via ai-plugin.json endpoint
- Ideal for ad-hoc data analysis
- Perfect for exploring public datasets
- Works with datasette publish for cloud deployment
- Supports deployment on Cloud Run, Vercel, Fly, and Heroku
- Provides conversational interface for databases
- Easy local development setup with virtual environment
- Includes test suite with pytest for validation
Datasette ChatGPT plugin cons
- Limited to single database (first attached to instance)
- ChatGPT can still hallucinate results
- Requires access to ChatGPT plugins preview
- Does not support PRAGMA statements
- Only works with existing Datasette users
- Needs ChatGPT Plus with plugin-compatible plan
- No support for multiple database connections
- Results may not always be entirely accurate
- Limited to SQLite databases only
Frequently asked questions about Datasette ChatGPT plugin
What is datasette-chatgpt-plugin?
It is a Datasette plugin that turns a Datasette instance into a ChatGPT plugin, allowing you to use ChatGPT to ask questions about your data hosted in Datasette. The plugin enables natural language querying of SQLite databases.
How do I install the plugin?
Install it in the same environment as Datasette using the command: datasette install datasette-chatgpt-plugin. For deployed instances using datasette publish, you can add --install datasette-chatgpt-plugin to your publish command for Cloud Run, Vercel, Fly, or Heroku.
How do I add the plugin to ChatGPT?
Click Plugins -> Plugin store -> Install an unverified plugin and enter the URL of your Datasette instance. If that doesn't work, try Develop my own plugin -> My manifest is ready and paste in your URL. ChatGPT will discover the plugin by hitting the /.well-known/ai-plugin.json endpoint.
What databases does the plugin support?
The plugin works with SQLite databases hosted by Datasette. It currently exposes only a single database - the first database attached to your Datasette instance.
Can I use PRAGMA statements with this plugin?
No, PRAGMA statements are not allowed. Instead, you can use select * from pragma_table_info('table_name') as an alternative to PRAGMA table_info(table_name).
What queries can I run through ChatGPT?
You can ask questions like 'Show a list of tables' to see available tables, or 'Show the first 10 rows of the mytable table' to fetch data. The plugin accepts SQLite SQL queries and returns JSON results.
Is the plugin free to use?
Yes, the plugin is free and open source. You can install it on your Datasette instance without any cost. However, you need a ChatGPT Plus subscription with access to the plugins feature to use it.
Can ChatGPT hallucinate results with this plugin?
Yes, ChatGPT can still hallucinate results using this plugin. The website explicitly warns about this limitation, and there is an open issue tracking this problem where users can find more details.
How do I set up the plugin for local development?
Clone the code, create a virtual environment with python3 -m venv venv, source venv/bin/activate, then install dependencies with pip install -e '.[test]'. You can run tests using pytest.
What SQL syntax does the plugin support?
The plugin supports most SQLite syntax through Datasette. It accepts SQLite SQL queries via a GET request and returns JSON. The main limitation is that PRAGMA statements are not allowed, though alternatives like pragma_table_info are supported.