IQuerio is a next-gen database assistant (Phase 1 MVP) for devs and AI builders. It optimizes SQL queries, performs vector-based similarity searches, and supports natural language queries using Postgres with pgvector and a FastAPI backend.
Discover IQuerio’s AI-powered tools in the Features Overview.
- Clone repo:
git clone https://github.com/pranavkp71/IQuerio - Install PostgreSQL dev libraries:
sudo apt install libpq-dev python3-dev - Create a virtual env:
python3 -m venv .venvand activate it usingsource .venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Start Postgres with pgvector:
docker-compose up -d - Set up DB:
python backend/setup_db.py - Install CLI:
pip install . - Run server:
uvicorn backend.main:app --reload
-
SQL Optimizer:
- CLI:
db-toolkit optimize --query "SELECT * FROM users WHERE age + 1 > 30" - API:
curl -X POST "http://127.0.0.1:8000/optimize" -H "Content-Type: application/json" -d '{"query": "SELECT * FROM users WHERE age + 1 > 30"}' - Output:
{"query": "...", "optimized_query": "SELECT id, name FROM users WHERE age > 29", "issues": [...], "suggestions": [...], "explain_plan": [...]}
- CLI:
-
Vector Playground:
-
Upload:
db-toolkit upload --user-id 1 --description "AI researcher" -
API:
curl -X POST "http://127.0.0.1:8000/upload-embedding" -H "Content-Type: application/json" -d '{"user_id": 1, "description": "AI researcher"}' -
Output:
{"status": "Embedding uploaded successfully", "user_id": 1} -
Search:
db-toolkit search --description "Tech enthusiast into AI" --limit 2 -
API:
curl -X POST "http://127.0.0.1:8000/search-similar" -H "Content-Type: application/json" -d '{"description": "Tech enthusiast into AI", "limit": 2}' -
Output:
{"results": [{"id": 1, "name": "Soman", "description": "...", "distance": 0.66}, ...]} -
NL Query:
db-toolkit nl-query --query "Show users over 30 similar to Tech enthusiast into AI" -
API:
curl -X POST "http://127.0.0.1:8000/nl-query" -H "Content-Type: application/json" -d '{"query": "Show users over 30 similar to Tech enthusiast into AI"}' -
Output:
{"results": [{"id": 3, "name": "Chandran", "description": "...", "distance": 0.98}, ...], "sql": "...", "params": [...]}
-
-
Test DB:
curl http://127.0.0.1:8000/db-test- Output:
{"status": "Connected", "version": "..."}or{"status": "Failed", "error": "..."}
- Output:
- Run tests:
pytest backend/ - CI/CD: GitHub Actions runs tests and linting on push/PR.
- GET
/: Returns{"message": "IQuerio MVP is alive."} - GET
/db-test: Returns{"status": "Connected", "version": "..."}or{"status": "Failed", "error": "..."} - POST
/optimize:- Input:
{"query": "<SQL>"} - Output:
{"query": "...", "optimized_query": "...", "issues": [...], "suggestions": [...], "explain_plan": [...]}
- Input:
- POST
/upload-embedding:- Input:
{"user_id": int, "description": string} - Output:
{"status": "...", "user_id": int}
- Input:
- POST
/search-similar:- Input:
{"description": string, "limit": int} - Output:
{"results": [{"id": int, "name": string, "description": string, "distance": float}, ...]}
- Input:
- POST
/nl-query:- Input:
{"query": string} - Output:
{"results": [{"id": int, "name": string, "description": string, "distance": float}, ...], "sql": string, "params": [...]}
- Input:
- Backend: FastAPI,
psycopg2,sentence-transformers - Database: Postgres with
pgvector - CLI:
db-toolkit(installed viapip install .) - Testing:
pytestwith GitHub Actions CI