Ask questions of your data with LLM assistance
Install this plugin in the same environment as sqlite-utils.
sqlite-utils install sqlite-utils-ask
Ask questions of your database like this:
sqlite-utils ask content.db 'How many repos?'
The tool will use an LLM (gpt-4o-mini
by default) to generate the appropriate SQL query by passing through your question and the database schema, and will then execute the query and return the result.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd sqlite-utils-ask
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest