GithubHelp home page GithubHelp logo

kaarthik108 / snowbrain Goto Github PK

View Code? Open in Web Editor NEW
115.0 2.0 21.0 1.85 MB

snowBrain - AI-Driven Insights with Snowflake (New version- https://github.com/kaarthik108/snowbrain-AGUI)

Home Page: https://snowbrain.dev

License: Other

JavaScript 2.45% CSS 0.88% TypeScript 88.49% Python 7.65% PLpgSQL 0.53%
data fastapi langchain nextjs pinecone snowflake chatgpt tailwindcss

snowbrain's Introduction

snowBrain

Deploy with Vercel

snowbrain_v2_wide.mp4

SnowBrain is an open-source prototype that serves as your personal data analyst. It converses in SQL, remembers previous discussions, and even draws data visualizations for you.

This project is a unique blend of Snowflake, Langchain, OpenAI, Pinecone, NEXTjs, and FastAPI, among other technologies. It's all about reimagining the simplicity of SQL querying. Dive in and discover a new way of interacting with your data.

Tech Stack

Features

  • Snowflake to Vector Database: Automatic conversion of all Snowflake DDL to a vector database.
  • Conversational Memory: Maintain context and improve the quality of interactions.
  • Snowflake Integration: Integrate with Snowflake schema for automatic SQL generation and visualization.
  • Pinecone Vector Database: Leverage Pinecone's vector database management system for efficient searching capabilities.
  • Secure Authentication: Employ Clerk.dev for secure and hassle-free user authentication.
  • Rate Limit Handling: Utilize Upstash Redis for managing rate limits.
  • Fast API: High-performance Python web framework for building APIs.

Example Queries

snowBrain is designed to make complex data querying simple. Here are some example queries you can try:

  • Total revenue per product category: "Show me the total revenue for each product category."
  • Top customers by sales: "Who are the top 10 customers by sales?"
  • Average order value per region: "What is the average order value for each region?"
  • Order volume: "How many orders were placed last week?"
  • Product price listing: "Display the list of products with their prices."

Installation

Follow these steps to get snowBrain up and running in your local environment.

  1. Update Environment Variables

    Make sure to update the environment variables as necessary. Refer to the example provided:

    .env.example
  2. Auto fetch All Schema DDL

    You can do this by running the following command:

    python3 embed/snowflake_ddl_fetcher.py

    Make sure to install requirements using

    pip3 install -r embed/requirements.txt
  3. Convert DDL Documents to Vector & Upload to Pinecone

    Use the following command to do this:

    python3 embed/embed.py
  4. Install Dependencies for the Code Plugin

    Navigate to the code plugin directory and install the necessary dependencies using Poetry:

    cd code-plugin && poetry install
  5. Deploy FastAPI to Modal Labs

    Run the following command to deploy your FastAPI (make sure to add a secrets file in modal labs):

    modal deploy main.py

    After deploying, make sure to store the endpoint in your environment variables:

    MODAL_API_ENDPOINT=
    MODAL_AUTH_TOKEN=random_secret
  6. Install packages

    Install packages using the following command:

    bun install
  7. Run Locally

    Test the setup locally using the following command:

    bun run dev

    Test the build

    bun run build
  8. Deploy to Vercel

    Finally, when you're ready, deploy the project to Vercel.


Note: Vercel build is automatically blocked on folders code-plugin, embed and readme.md. You can additionally add a build block command in vercel's dashboard.


One-Click Deploy

Deploy with Vercel


Contributing

Here's how you can contribute:


Credits

Thanks to @jaredpalmer, @shuding_, @shadcn, @thorwebdev

snowbrain's People

Contributors

kaarthik108 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

snowbrain's Issues

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.