Giter VIP home page Giter VIP logo

reason-act-sqlite-py's Introduction

Reason-Act SQLite Demo

Reason and Act Flow Chart

This is a demonstration of how to use reason and act with llama.cpp and a LLM to pose plain english queries to a SQLite database using one of two strategies:

  1. Actions that mimic interaction with a frontend like Datasette. Actions: list tables, list table columns, facet, filter
  2. Let the LLM use SQLite queries directly. Actions: list tables, list table schema, execute sql

The things you'll need to do are:

  1. Provide a SQLite database (named example.db or you need to change the name in the Python files)
  2. Change the prompts in both Python scripts (the prompt string inside the execute functions) to be specific to your data and problems. You'll also want to date the DATA_HELP table and column descriptions in run-sql-queries.py.
  3. Download a GGUF model for use, change the MODEL_PATH variable in both scripts to point at its location.

There are minimal dependencies for this project, just sqlite-utils and llama.cpp-py. You can install with using pip:

pip install -r requirements.txt

Once you have everything installed and configured, you can kick off a session by coming up with a question and asking it on the command line:

python run-interface.py "What kind of data do I have available?"
python run-sql-queries.py "What are some interesting records in the database?"

The model output will be printed to stdout.

reason-act-sqlite-py's People

Contributors

brandonrobertz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.