Skip to content

ymc9/llm-data-query

Repository files navigation

LLM-Based Data Query Demo

A demo project for leveraging LLM to query a database with natural languages, and render charts for the results. The implementation also takes care of access control and ensures users only see data they are allowed to see.

Find more information in this blog post.

Stack

Run the project

  1. npm install

  2. Prepare environment variables copy ".env.example" to ".env" and fill in OPENAI_API_KEY

  3. Run ZenStack code generation

    npm run generate

  4. Deploy Prisma migrations

    npx prisma migrate deploy

  5. Seed the database

    npx prisma db seed

  6. Start dev server

    npm run dev

Login with one of the following users:

  • Username: "tom@test.com", Password: "12345678". This user only sees orders from "Washington" region.
  • Username: "jerry@test.com", Password: "12345678". This user only sees orders from "California" region.

About

LLM-Based Data Query Demo (LangChain, Prisma, ZenStack)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published