Skip to content
DataLayer
Product
On this page

AI Workspace

The AI Workspace turns a question into an answer you can audit:

  1. Generate — your question is converted into DuckDB SQL using the data dictionary.
  2. Show — the SQL is displayed in an editor. You can change it.
  3. Validate — the SQL passes through the same guard as the SQL Explorer.
  4. Execute — it runs on the read-only snapshot.
  5. Visualize & explain — a chart is suggested and the result is summarized. The explanation only describes rows that were actually returned.

Engines

EngineWhenNotes
llmAn AI provider is configured (AI_PROVIDER, AI_API_KEY) and the daily budget is not exhausted.OpenAI-compatible, OpenRouter or Anthropic. If the model produces SQL that fails validation, it gets one retry with the error.
templateNo provider configured, budget reached, or provider error.A deterministic engine that recognizes a fixed set of question patterns. It is labeled clearly and will tell you when it cannot answer.

The engine used is returned with every answer (engine field) and shown in the interface.

Quotas

AI questions count against a daily quota per tier (see tiers). Administrators also set a global daily budget in USD for the LLM provider; when it is reached, DataLayer falls back to the template engine instead of failing silently.

Tips

  • Name the time window ("in the last hour", "today", "this week").
  • Use the vocabulary of the schema: launches, trades, migrations, creators, wallets.
  • If an answer looks wrong, read the SQL first — it is the ground truth of what was computed.