The backend (app/) currently lacks structured logging and error handling,
making it difficult to trace failures across the AI query pipeline.
Proposed Changes
- Add Python's built-in
logging module across the backend pipeline
- Wrap critical operations in
try/except blocks with errors logged at
appropriate levels (DEBUG, WARNING, ERROR)
Target Areas
app/services/ — LLM calls, SQL generation, and self-correcting SQL retries
app/handlers/ — Business logic execution
app/api/ — Route-level request/response logging
app/db/ — Database connection and session errors
Benefits
- Easier to trace where failures occur in the NL → SQL → execution pipeline
- No new dependencies — stdlib
logging only
- Improves long-term maintainability of the backend
I'd like to work on this if you're open to it.
The backend (
app/) currently lacks structured logging and error handling,making it difficult to trace failures across the AI query pipeline.
Proposed Changes
loggingmodule across the backend pipelinetry/exceptblocks with errors logged atappropriate levels (
DEBUG,WARNING,ERROR)Target Areas
app/services/— LLM calls, SQL generation, and self-correcting SQL retriesapp/handlers/— Business logic executionapp/api/— Route-level request/response loggingapp/db/— Database connection and session errorsBenefits
loggingonlyI'd like to work on this if you're open to it.