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.

15
/ 100
Experimental

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.

Stale 6m No Package No Dependents
Maintenance 2 / 25
Adoption 4 / 25
Maturity 9 / 25
Community 0 / 25

How are scores calculated?

Stars

5

Forks

Language

Python

License

MIT

Last pushed

Aug 12, 2025

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/prompt-engineering/raedmajid/schema-aware-ai-sql-agent"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.