Skip to main content

Ask a question over a permitted model

The Ask a question panel in Query Console translates supported wording into read-only SQL over the selected model. It is distinct from editing SQL yourself and starting a durable saved-query run.

Run and inspect an answer​

  1. Select the intended workspace and semantic model, and inspect its available entities, dimensions, metrics and relationships.
  2. Start with an offered example or a concrete question using that model's vocabulary. Include only information approved for the configured service.
  3. Choose Ask once and wait for its outcome. Ask can translate and execute the generated SQL; it is not a preview-only action.
  4. Inspect the interpretation, generated SQL, clarification and actual returned rows. A translation or confidence score alone is not an executed result.
  5. Open the generated SQL in the editor to review or change it. Choosing Execute there is a separate execution.

If a question needs clarification, use the explanation and model vocabulary to revise it. A missing join path or unrecognized value is not permission to query another model or bypass governance. Handle source errors, access refusals and quota responses as their actual outcomes.

Follow-up wording, such as “only paid orders” or “and by region,” refers to earlier answered questions in the conversation. Start a new conversation when changing intent. Keep history within the same user, workspace and model; do not carry another person's questions into an API request.

API users who require translation without execution can use semTranslateQuestion; semAskQuestion is the translate-and-execute operation. See the natural-language API reference for inputs, statuses and limits.

Optional AI assistance (BYOK settings)​

The normal grounded translator is separate from optional provider-assisted rewording. When a question returns NO_MATCH or LOW_CONFIDENCE, an enabled workspace can send the question and the model's vocabulary (never data rows) to its own OpenAI or Anthropic connection so the provider can propose a reworded question.

  1. Connect OpenAI or Anthropic under Integrations in the same workspace. Keys are stored encrypted in the Integrations service, never inside SemanticFed.
  2. In Query Console → AI assistance, toggle Reword unmatched questions with my AI provider, select the connection, and optionally specify a model (defaults: gpt-4o-mini for OpenAI, claude-opus-5-5 for Anthropic).
  3. Select Save. Reading settings (semNlSettings) requires read on semanticfed-model; updating settings (semUpdateNlSettings) requires update on semanticfed-access-policy (held by Federation Owner and Governance Lead). Seeing the panel does not grant write permission.

The provider proposes a reworded question only; replies that look like SQL are discarded, and the deterministic parser still validates and builds the query under workspace access policies.

Assistance status outcomes​

assist statusMeaning
NOT_NEEDEDDeterministic parser answered on its own, or rewording cannot resolve the issue (such as NO_JOIN_PATH).
SKIPPEDCaller set allowAssist: false on the request.
DISABLEDAI assistance is turned off for the workspace.
NOT_CONFIGUREDSelected connection is missing, revoked, or not OpenAI/Anthropic.
QUOTA_EXHAUSTEDWorkspace reached its daily semanticfed.ai.operations allowance.
QUOTA_UNAVAILABLEAllowance check could not complete, so the provider was not called.
PROVIDER_ERRORProvider was unreachable, rejected the key, or returned an error.
NO_IMPROVEMENTProvider returned a rewrite, but it still could not match the model.
REPHRASEDProvider reworded the question and the grounded translator succeeded (engine: semantic-parser-v1+llm-rephrase).

Limits, clarifications and privacy​

  • Question length: maximum 1,000 characters (TOO_LONG otherwise).
  • Conversation history: up to the last 10 prior questions (history, oldest first); keep history strictly within the same user, workspace and model.
  • Execution bounds: maxRows defaults to 1,000 (maximum 10,000); timeoutMs defaults to 30,000 ms (maximum 60,000 ms).
  • Metering: semTranslateQuestion is not metered as a query run; semAskQuestion meters one query run (semanticfed.query_runs.monthly). Each BYOK provider call counts as one semanticfed.ai.operations operation (daily plan allowances: Free 25, Starter 250, Growth 2,500, Business 25,000); inference charges are billed directly by your provider.
  • Privacy and audit: Activity logs record a SHA-256 hash of the question rather than raw question text, alongside follow-up and assist metadata.
  • Clarification reasons (nothing is executed when status is NEEDS_CLARIFICATION): EMPTY_QUESTION, TOO_LONG, NO_MATCH, NO_JOIN_PATH, UNSUPPORTED_AGGREGATION (for example MEDIAN), INVALID_FILTER, LOW_CONFIDENCE, INVALID_QUERY, and UNPLACED_VALUE (a follow-up value without a single text column in context).

What this guide does not demonstrate​

The synthetic SQL recording demonstrates direct SQL over invented records. It does not demonstrate a paid AI provider, first-time provider setup, or durable saved-query execution. Verify provider-connected workflows separately with approved noncustomer fixtures.