Ask your data anything. Get charts, tables, and insights — in plain English.
QueryMind AI is a full-stack natural language data platform that lets you query MySQL databases, MongoDB collections, and files (CSV, Excel, PDF) without writing a single line of SQL or code.
| App | URL |
|---|---|
| Workspace | https://sql-agent-omega-olive.vercel.app |
| Chat | https://sql-agent-chat-frontend.vercel.app |
- Natural language → SQL / MongoDB pipeline / Pandas code generation
- Auto chart selection — bar, donut, area, grouped bar, metric cards
- Schema explorer with table/collection relationships
- Saved queries with history
- Dashboard with query analytics
- File uploads — CSV, Excel, PDF querying
- Settings — accent theme, layout density, profile management
- Conversational interface over all data sources
- Session management with clusters and folders
- Voice input (Web Speech API)
- Follow-up questions with conversation memory (Pinecone RAG)
- Shareable chat links (public read-only)
- Intent classification — answers greetings conversationally, queries the DB for data questions
- Download chat as JSON
- Multi-source query routing — MySQL, MongoDB, CSV, Excel, PDF
- LLM-powered SQL generation, auto-fix on failure, query decomposition
- RAG pipeline — schema embeddings + conversation history in Pinecone
- JWT + Google OAuth authentication
- File storage on Cloudinary
- Privacy-first —
db_urlnever stored in backend DB, passed per-request
| Layer | Tech |
|---|---|
| Backend | FastAPI, SQLAlchemy, PyMySQL, Motor |
| LLMs | Groq (Llama 3.3 70B), NVIDIA (Llama 3.1 8B) via LangChain |
| Vector DB | Pinecone |
| File Storage | Cloudinary |
| Main Frontend | React 18, Vite, Tailwind CSS, Recharts, Framer Motion |
| Chat Frontend | React 18, Vite, Tailwind CSS, Recharts, Framer Motion |
| Auth | JWT + Google OAuth 2.0 |
| App DB | MySQL |
querymind/
├── backend/ FastAPI backend (port 8000)
│ ├── agents/ LLM agents — SQL gen, chart selector, decomposer, suggestions
│ ├── auth/ JWT handler, Google OAuth, dependencies
│ ├── connectors/ MySQL, MongoDB, CSV, Excel, PDF connectors
│ ├── rag/ Pinecone client, schema RAG, history RAG, memory
│ ├── routes/ API routes — auth, chat, query, uploads, schema, dashboard
│ ├── db.py SQLAlchemy engine, schema loader, query runner
│ └── main.py FastAPI app, startup (MySQL + Pinecone init)
│
├── frontend/ Main workspace (port 5173)
│ └── src/
│ ├── api/ axios clients — authApi, schemaApi, queryApi, uploadsApi
│ ├── context/ AuthContext, SourceContext, QueryContext
│ ├── pages/ Workspace, Dashboard, Schema, Saved, Uploads, Settings
│ └── components/ AppShell, charts, query UI, source management
│
└── chat-frontend/ Chat app (port 5174)
└── src/
├── api/ chatApi, uploadsApi, schemaApi
├── context/ AuthContext, ChatContext, SourceContext
├── hooks/ useChat, useSource, useAuth, useVoice, useToast
├── pages/ ChatPage, ConnectionsPage, LoginRedirectPage
└── components/ Chat bubbles, SmartChart, ResultTabs, Sidebar, Source dropdown
- Python 3.10+
- Node.js 18+
- MySQL 8.0+
- Groq API key — console.groq.com
- NVIDIA API key — integrate.api.nvidia.com
- Pinecone API key — pinecone.io
- Cloudinary account — cloudinary.com
- Google OAuth client ID (optional, for Google login)
git clone https://github.com/venkateshpaila72-dev/querymind.git
cd querymindcd backend
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linuxsource venv/bin/activate
pip install -r requirements.txtCreate backend/.env:
# MySQL (app database)DB_HOST=localhostDB_PORT=3306DB_USER=rootDB_PASSWORD=yourpasswordDB_NAME=sql_agent# LLMsGROQ_API_KEY=your_groq_keyGROQ_API_KEY_CHAT=your_groq_key_for_chat# optional separate keyGROQ_API_KEY_SUGGESTIONS=your_groq_key_for_suggestions# optional separate keyNVIDIA_API_KEY=your_nvidia_keyNVIDIA_API_KEY_CHAT=your_nvidia_key_for_chat# optional# Model names (optional — these are the defaults)CHAT_QUERY_MODEL=llama-3.3-70b-versatileCHAT_CONV_MODEL=meta/llama-3.1-8b-instruct# PineconePINECONE_API_KEY=your_pinecone_keyPINECONE_INDEX=querymind# CloudinaryCLOUDINARY_CLOUD_NAME=your_cloud_nameCLOUDINARY_API_KEY=your_cloudinary_keyCLOUDINARY_API_SECRET=your_cloudinary_secret# AuthJWT_SECRET=your_jwt_secret_keyJWT_ALGORITHM=HS256ACCESS_TOKEN_EXPIRE_MINUTES=60REFRESH_TOKEN_EXPIRE_DAYS=30# Google OAuth (optional)GOOGLE_CLIENT_ID=your_google_client_idRun database migrations (create tables):
mysql -u root -p sql_agent < schema.sqlStart the backend:
uvicorn main:app --reloadcd frontend
npm installCreate frontend/.env:
VITE_API_URL=http://localhost:8000VITE_GOOGLE_CLIENT_ID=your_google_client_idnpm run dev
# Runs on http://localhost:5173cd chat-frontend
npm installCreate chat-frontend/.env:
VITE_API_URL=http://localhost:8000npm run dev
# Runs on http://localhost:5174User types question
↓
Intent classifier (chat vs data query)
↓
RAG — retrieve relevant schema tables + similar past queries
↓
LLM generates SQL / MongoDB pipeline / Pandas code
↓
Query executed on user's database
↓
Chart auto-selected based on columns + data shape
↓
LLM generates plain-English summary
↓
Result shown as chart + table + SQL + summary
User logs in on main frontend (port 5173)
↓
JWT stored in localStorage as qm_access_token
↓
Chat button → opens http://localhost:5174/?token=JWT
↓
Chat frontend reads token from URL → saves → redirects to /chat
Database credentials (db_url) are never stored in the backend database. They live only in the browser's localStorage and are passed with every query request. This means:
- Credentials are never logged server-side
- Deleting your browser data removes all credentials
- The backend only stores session metadata and message history
Run this in MySQL to create a test database:
CREATEDATABASEIF NOT EXISTS querymind_test;
USE querymind_test;
CREATETABLEemployees (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100), department VARCHAR(50),
salary DECIMAL(10,2), hired_date DATE, status VARCHAR(20)
);
INSERT INTO employees (name, department, salary, hired_date, status) VALUES
('Alice Johnson', 'Engineering', 95000, '2021-03-15', 'active'),
('Bob Smith', 'Marketing', 72000, '2020-07-01', 'active'),
('Carol White', 'Engineering', 88000, '2022-01-10', 'active'),
('Grace Kim', 'Finance', 78000, '2020-09-05', 'active'),
('Iris Chen', 'Finance', 84000, '2021-12-01', 'active');
CREATETABLEproducts (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100), category VARCHAR(50),
price DECIMAL(10,2), stock INT
);
INSERT INTO products (name, category, price, stock) VALUES
('Laptop Pro', 'Electronics', 1299.99, 45),
('Wireless Mouse','Electronics', 29.99, 200),
('Office Chair', 'Furniture', 349.00, 30),
('Monitor 27"', 'Electronics', 399.99, 60),
('Desk Lamp', 'Furniture', 49.99, 90);Try asking: "What is the average salary by department?" or "Which products have stock less than 50?"
Full interactive docs at http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register | Register with email/password |
| POST | /auth/login | Login |
| POST | /auth/google | Google OAuth login |
| GET | /auth/me | Get current user |
| PATCH | /auth/me | Update profile name |
| POST | /query/ | Run a natural language query |
| GET | /schema/ | Get database schema |
| GET | /uploads/ | List uploaded files |
| POST | /uploads/ | Upload a file |
| POST | /chat/sessions | Create chat session |
| POST | /chat/sessions/{id}/message | Send a message |
| GET | /chat/shared/{share_id} | Get shared chat (public) |
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY | ✅ | Main Groq key for SQL generation |
NVIDIA_API_KEY | ✅ | NVIDIA key for summaries and chat |
PINECONE_API_KEY | ✅ | Pinecone vector DB |
PINECONE_INDEX | ✅ | Pinecone index name |
CLOUDINARY_CLOUD_NAME | ✅ | Cloudinary for file storage |
CLOUDINARY_API_KEY | ✅ | Cloudinary API key |
CLOUDINARY_API_SECRET | ✅ | Cloudinary secret |
JWT_SECRET | ✅ | Secret for JWT signing |
GOOGLE_CLIENT_ID | ⬜ | Only needed for Google login |
GROQ_API_KEY_CHAT | ⬜ | Separate Groq key for chat (avoids rate limits) |
GROQ_API_KEY_SUGGESTIONS | ⬜ | Separate Groq key for suggestions |
Venkatesh Paila GitHub: @venkateshpaila72-dev
QueryMind AI — your data, your questions, instant answers.