raedmajid/schema-aware-ai-sql-agent
This project enables users to **generate SQL queries from natural language** using **LLM** of their choice while enforcing **Role-Based Access Control (RBAC)** and **Row-Level Security (RLS)**. It also includes **SQL injection detection** and **sensitive data logging** for compliance and security.
Built on LangChain with FastAPI and Streamlit, it delivers schema-aware query generation through a memory-aware chat agent that maintains conversation context while validating queries against database schemas. The architecture chains LLM inference with parameterized query execution and enforces access control through RBAC/RLS filters applied before results return to users. Supports multiple LLM backends (OpenAI, OpenRouter, Ollama) and includes a sample Northwind PostgreSQL database for immediate testing.
No commits in the last 6 months.
Stars
5
Forks
—
Language
Python
License
MIT
Category
Last pushed
Aug 12, 2025
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/rag/raedmajid/schema-aware-ai-sql-agent"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.