AI Query Writer

The SQL Console includes a built-in AI assistant that writes ClickHouse SQL from plain-language descriptions. Describe what you want to find, and the assistant figures out which tables are relevant, inspects their schemas, and generates a query you can run or refine.
CloudQuery Platform also includes the AI Assistant on the Home page — a full conversational agent that can answer questions directly and supports both schema-only and full data access modes.
How to use it
Click the AI assistant button at the top of the SQL Console, describe what you’re looking for, and submit. The assistant typically responds in a few seconds.
How it works
The assistant is powered by Claude (Anthropic) running on AWS Bedrock. Each request follows this sequence automatically:
- Table discovery — searches the CloudQuery catalog for tables relevant to your question
- Schema inspection — reads the column names and types for those tables
- Syntax validation — checks the generated SQL against the CloudQuery database before returning it
Data privacy
The AI Query Writer can only see the structure of your data — table names and column definitions. It never reads, queries, or transmits the actual contents of your CloudQuery database.
Here is exactly what the model can and cannot access:
| The model can see | The model cannot see |
|---|---|
| Table names in your CloudQuery database | Row data of any kind |
| Column names and their data types | Values stored in any column or field |
| SQL syntax validation results | Credentials, connection strings, or API keys |
This is not configurable — the AI Query Writer always operates in schema-only mode. There is no setting that would allow it to read your data.
AWS Bedrock does not use customer data to train or improve foundation models. Your queries and schema information are not retained for model training purposes.
Conversation context
The assistant remembers the last 20 messages within a session. This means you can iterate — ask a follow-up question to refine a query, correct a mistake, or narrow the scope — without starting over each time.
Limitations
- The model occasionally generates SQL referencing a table or column that doesn’t exist. When this happens it usually self-corrects within the same request after observing the error.
- Tables with many hundreds of columns may require the model to paginate through the schema, which can add a few seconds.
- The assistant is scoped to SQL generation tasks. Off-topic requests are declined.
- Queries involving deeply nested structures — such as AWS resource tags stored as JSON, or arrays of security group rules — may need manual adjustment after generation.
FAQ
How do I access this feature?
This feature is available to all CloudQuery Platform users. Click the AI assistant button at the top of the SQL Console.
Which AI model does this use?
Claude Sonnet 4.5 and Haiku 4.5 (Anthropic), running on AWS Bedrock. The models only receive the information described in the Data privacy section above.
Does the AI have access to my data?
No. The AI Query Writer only sees table names and column definitions — it cannot query or read any row data from your CloudQuery database. See Data privacy for the full breakdown.
Is there an AI feature that can also reason about my actual data?
Yes. The AI Assistant on the Platform Home page supports a Full Access mode where it executes queries and returns results directly in the chat. This mode is enabled by organization administrators in Platform Settings.
The CloudQuery MCP Server is another option — it lets you connect Claude Desktop, Cursor, or other MCP-compatible tools to your CloudQuery database directly and requires a separately issued API key.
Next Steps
- AI Assistant - The conversational AI on the Platform Home page with full data access support
- SQL Console - Save and manage your AI-generated queries
- Query Examples - Browse curated security, compliance, and cost queries
- CloudQuery MCP Server - Use the CloudQuery MCP server with AI assistants that can also read your data
Last updated on