Giter Site home page Giter Site logo

benderv / olympe Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 264 KB

Query your database in plain english

Home Page: https://www.olym.pe

JavaScript 1.98% TypeScript 62.86% Dockerfile 0.44% HTML 0.63% Vue 29.31% EJS 1.38% Python 3.33% CSS 0.04% Shell 0.03%
analytics deep-learning openai sql

olympe's Introduction

Olympe

A natural language interface to query databases

Try it here ๐Ÿ‘‰ olym.pe

If you are interested in this project, or just want to discuss, contact me on twitter

๐Ÿšง It's a proof-of-concept, there is lots of work to be done here... ๐Ÿšง

Features

  • Support high number of tables
  • Syntax support for entities ("Netflix" will match "net-flix")
  • Use of database values and types to improve the query generation

Nice to have

  • Multiple databases support
    • Postgres
    • BigQuery (wip)
  • Plot results in a table or in a chart depending on the query/results
  • Possibility to edit & correct the sql query
  • Upload of CSV
  • Support multiple profils and organisations

Preview

image

Tech stack

  • AI based on OpenAI's GPT-3 API
  • Frontend: Vue3, Vite
  • Backend: NestJS
  • Database: Postgres
  • Upload Service: sanic (python)

Code structure

โ”œโ”€โ”€ service: backend in nestjs
โ”‚ย ย  โ”œโ”€โ”€ src/databases
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ implementatons (postgres, bigquery)
โ”‚ย ย  โ”œโ”€โ”€ src/files
โ”‚ย ย  โ”œโ”€โ”€ src/queries
โ”‚ย ย  โ”œโ”€โ”€ src/tables
โ”‚ย ย  โ”œโ”€โ”€ src/users
โ”œโ”€โ”€ uploader: micro service to upload data to the playground
โ”œโ”€โ”€ view: frontend in vue3

Setup

Back-end

in /service

  • create a .env file with the following content:
OPENAI_API_KEY=sk-...
DATABASE_URL=postgres://...
  • yarn -- install dependencies
  • yarn typeorm migration:run -- run migrations
  • yarn start:dev -- run the backend

Front-end

in /view

  • yarn -- install dependencies
  • yarn dev -- run the front

Database

You will need to add a database to start using the service

Upload service

Check README.md in /uploader for more details

Auth (optional)

You can add users management with Propelauth by adding the following env variables:

/service/.env

PROPELAUTH_URL=
PROPELAUTH_APIKEY=
PROPELAUTH_VERIFIER_KEY=
PROPELAUTH_ISSUER=

/view/.env

VITE_PROPELAUTH_URL=

Docker compose (alternative)

If you prefer to use docker-compose, you can use the following command:

docker-compose up --build

You can modify the docker-compose.yml file to add variables or modify the database url.

NL2SQL pipeline

  1. getDatabaseSchema
  2. selectTables (openai.select_tables.ejs)
  3. extractConditionsValues (openai.where.ejs)
  4. fetchClosedValues (from database)
  5. getValidatedQueriesExamplesOnDatabase (openai.default.ejs)

olympe's People

Contributors

benderv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.