Scenario Experience


Feishu
Choose your preferred way to join


In a Text-to-SQL stack, every user question becomes a pipeline: intent → schema linking → SQL → execution → presentation. Q2S logs persist that journey so you can audit, debug, and improve the system.
User report: “I asked for last month’s revenue—the number looks wrong.”
Without structured logs you may lack:
With Q2S logging you can reconstruct the session, compare against expectations, and file a precise fix (prompt, schema, or policy).
Each transition stores duration, optional Langfuse trace_id, and compact error text (long messages still live in observability tools).
| Field | Role |
|---|---|
id | Stable Q2S id (q2s_*) |
project_id | Tenant scope |
datasource_id | Which connection |
question | User text (consider masking PII) |
role_id / role_variables | Policy context |
query | Generated SQL + chart config payload |
status | processing / success / failed |
duration_ms | End-to-end latency |
trace_id | Link to Langfuse / LLM traces |
err_msg | Short failure reason |
Writing the row early (status processing) means you still capture prompts when downstream steps crash.
query.sql and compare to the business definition.trace_id for prompts, tool calls, and model output.Aggregate duration_ms by datasource or question template; optimize indexes or tighten semantic hints.
Track success ratio, error classes, and regressions after model or prompt changes.
trace_id when Langfuse (or similar) is enabled.Q2S logging turns Text-to-SQL from a black box into an observable service: you get inputs, outputs, latency, and links to deep traces—the minimum viable foundation for enterprise analytics.
No coding required. Ask questions in natural language and AI generates SQL queries and visualizations automatically.
Start your free trial now and experience AI-powered data analysis with AskTable.