Skip to content

venkateswarluvajrala/QueryNoteAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QueryNoteAI

QueryNoteAI is an intelligent assistant that interprets user questions, understands their intent, and either provides direct answers or dynamically generates SQL queries to retrieve relevant data from a connected database.


🔄 State Diagram

State Graph


⚙️ Installation

Prerequisites

1. UV

QueryNoteAI uses UV for dependency and environment management. Ensure UV is installed before proceeding.

2. Ollama

Ollama is required for running local LLM models. To install:

brew install ollama

3. graphviz

graphviz is required for displaying state graphs using pygraphviz

brew install graphviz
uv add --config-settings="--global-option=build_ext" \
                   --config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
                   --config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
                   pygraphviz

Setting Up the Local LLM Model

  1. Pull the desired model:
ollama pull qwen2.5-coder:7b
  1. Start the Ollama service:
ollama serve

Configure Database Access

Update the .env file with your database host and credentials. Note: Make sure to not include any strings or comments in .env file

DB_USER="username" #incorrect
DB_USER=username #correct

DB_USER="username" #incorrect

3. Update your schema details and persona details

3.1 Update your table and persona details in src/main/constants.py file

3.2 Update prompts based on your usecase at src/main/common.py


🚀 Running the Application

Command-Line Interface

To launch the CLI version of QueryNoteAI:

uv run cli_app.py

Gradio Web Interface

To start the web-based frontend:

uv run gradio_app.py

Then, open your browser and navigate to: http://127.0.0.1:7860


🛠️ Development Setup

  1. Synchronize the project environment:
uv sync

This command sets up a virtual environment with the appropriate Python version and all required dependencies.

  1. Configure your IDE to use the virtual environment:
  • For JetBrains IDEs like PyCharm, follow this guide.

About

QueryNoteAI is a smart assistant that listens to user questions, figures out the intent behind them, and either provides a direct answer or generates an SQL query to fetch the necessary data from the database.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages