simonw / sqlite-utils-ask

Ask questions of your data with LLM assistance
Apache License 2.0
7 stars 0 forks source link

sqlite-utils-ask

PyPI Changelog Tests License

Ask questions of your data with LLM assistance

Installation

Install this plugin in the same environment as sqlite-utils.

sqlite-utils install sqlite-utils-ask

Usage

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.

Development

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