Anyone in your team can now query the database. No SQL. No waiting. No dependency.
PiperQL is an open-source AI agent that connects to your PostgreSQL databases and lets anyone on your team get answers using plain English. Ask a question, get tables, charts, and insights — no SQL knowledge required.
- Founders & Managers — See your business numbers without waiting for your dev team
- Data Analysts — Skip writing SQL, go straight to insights
- Business Analysts — Get the exact data you need, right now
- Developers — Stop being your team's human data API
- Small Teams — Get a data team powered by one AI agent
- Natural language queries — Ask questions in plain English, get SQL results
- 10+ chart types — Bar, line, pie, area, scatter, radar, and more — generated automatically
- Safe by default — Write operations require explicit confirmation
- Real-time streaming — Watch responses appear as the AI thinks
- Self-hosted — Your data never leaves your servers
- AI memory — Remembers context across conversations
- Multi-database — Connect and switch between multiple PostgreSQL databases
- Web search — AI can look up SQL syntax and database help online
git clone https://github.com/ajaysharmadeveloper/piperql.git
cd piperql
cp backend/.env.example backend/.env
# Edit backend/.env with your API keys and database credentials
docker compose up -dOpen http://localhost:3000 and start chatting with your database.
Prerequisites: PostgreSQL, Python 3.12+, Node.js 20+
git clone https://github.com/ajaysharmadeveloper/piperql.git
cd piperql
# Install dependencies
make install
# Configure environment
cp backend/.env.example backend/.env
cp frontend/.env.local.example frontend/.env.local
# Edit both files with your settings
# Run database migrations
make migrate
# Create your first admin user
make create-admin
# Start the app
make runBackend runs on http://localhost:8000, frontend on http://localhost:3000.
| Mode | What's Allowed | Confirmation Required |
|---|---|---|
| Read Only | SELECT queries | No |
| CRUD | SELECT, INSERT, UPDATE, DELETE | Yes (for writes) |
| Full Access | All SQL including DDL | Yes (for writes/DDL) |
┌─────────────────┐ ┌─────────────────────────────────────┐
│ Next.js App │────▶│ FastAPI Backend │
│ (Port 3000) │ SSE │ │
│ │◀────│ ┌─────────┐ ┌──────────────────┐ │
│ Chat UI │ │ │ Auth │ │ LangGraph Agent │ │
│ Charts │ │ │ (JWT) │ │ ┌────────────┐ │ │
│ SQL Results │ │ └─────────┘ │ │ Tools: │ │ │
└─────────────────┘ │ │ │ - query_db │ │ │
│ │ │ - schema │ │ │
│ │ │ - charts │ │ │
│ │ │ - search │ │ │
│ │ └────────────┘ │ │
│ └──────────────────┘ │
│ │ │
│ ┌────────▼─────────┐ │
│ │ PostgreSQL DB │ │
│ └──────────────────┘ │
└─────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Frontend | Next.js, TypeScript, Tailwind CSS, Recharts |
| Backend | FastAPI, SQLAlchemy, Alembic, Pydantic |
| AI Agent | LangGraph, LangChain, OpenAI |
| Memory | mem0 |
| Database | PostgreSQL |
| Auth | JWT, bcrypt |
| Streaming | Server-Sent Events (SSE) |
| Deployment | Docker, Docker Compose |
| Command | Description |
|---|---|
make run |
Start both backend + frontend |
make stop |
Stop all services |
make install |
Install all dependencies |
make migrate |
Run database migrations |
make create-admin |
Create admin user |
make test |
Run all tests |
make docker-up |
Start with Docker |
make docker-down |
Stop Docker |
make help |
Show all commands |
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the GNU Affero General Public License v3.0.
Copyright (C) 2026 Ajay Kumar Sharma
Built by Ajay Kumar Sharma
If PiperQL helps you, give it a star!