Choose the Right Mode
Query Writer
Default mode focused on generating optimized SQL. Ideal for analysts who want a ready-to-run statement.
Analyst
Adds written commentary and requires an Exa API key for external research augmentation.
mode field in the request body (query_writer or analyst).
Streaming Integration
POST /api/assistant/generate/stream emits Server-Sent Events (SSE) so you can render incremental updates:
Guardrails & Validation
Behind the scenes the assistant calls:GET /api/tablesand/api/table/{namespace}/{table}for schema metadataPOST /api/query/validateto confirm syntax- Optional semantic search utilities when your prompt references similar markets
Rate Limits & Cost Awareness
- 20 assistant requests per minute per API key
- Streaming responses return within ~3–6 seconds for typical prompts
- Claude usage is metered on Tremor’s side, so high-frequency automation should cache outputs when possible
Productive Workflows
- Explain existing SQL: add conversation history containing the original query so the assistant can annotate or optimize it.
- Iterate on prompts: supply previous turns via
conversation_historyto refine results without losing context. - Auto-execution: chain the assistant with
/api/queryonce afinalevent arrives to deliver charts or dashboards on the fly.
See the API reference entry for exact response fields, or pair the assistant with query recipes when you need deterministic baselines.