A portfolio-quality Text-to-SQL system that turns natural-language questions into safe, schema-aware, read-only PostgreSQL queries. It is designed around guardrails, hallucination detection, confidence scoring, and repeatable evaluation.
backend/— FastAPI service, domain logic, database access, and tests.database/— local database initialization assets.evals/— evaluation cases and generated reports.frontend/— React and TypeScript user interface.docs/— architecture, roadmap, ADRs, and execution plans.
The root-level Python prototype is existing exploratory work; the planned implementation lives in the directories above.
Phase 0 (repository foundation) is complete. The next phase is schema introspection and schema-aware metadata. See docs/STATUS.md, docs/ROADMAP.md, and docs/ARCHITECTURE.md.
Install the backend toolchain with uv:
make backend-installStart local PostgreSQL when you need database-backed checks:
make db-up
make db-smokeThe backend reads TEXT_TO_SQL_DATABASE_* variables and defaults to the local Docker read-only role. Keep real overrides in .env; .env.example lists variable names only.
Start the FastAPI backend locally:
make backend-devRun focused backend checks while developing:
make backend-test
make backend-lint
make backend-typecheckValidate Docker Compose:
make compose-checkRun the opt-in database integration tests after PostgreSQL is running:
make backend-integration-testRun the complete backend check before finishing backend work:
make backend-checkTo include database integration tests in the complete backend pass:
make backend-check-integrationMirror the main CI checks locally:
make check
make db-downmake check validates Compose, runs Ruff, mypy, unit tests, starts PostgreSQL, smoke-tests the seed database, and runs integration tests. make db-down stops the local database afterward.
Placeholder — curated cases and evaluation reports will live under evals/.
Generated SQL must be schema-validated, bounded, and executed only through a least-privilege read-only database role.