Prerequisites
- You must have Administrator permissions. For details, see Access Management.
1. Edit the SQL Query
When an answer is incorrect, you can directly edit the underlying SQL query.- Click the Edit button on the answer card in the chat interface.

- The Editor window will open. Go to the SQL Code tab.
- Modify the SQL statement to fix inaccuracies, add joins, or correct filters.
- Click Update response to run the revised query and refresh the data.
- (Optional) Switch back to the Editor tab to configure chart types, add filters, or drag-and-drop columns for visualization.

2. Test the Updated Answer
After editing the query, you must test the new response.- Retry with Adjustments: Use the Retry option in the chat window to have the system regenerate the response using your new SQL.
- Cross-Reference: Validate the new result by cross-referencing it with a known value or an external report.
- Test for Accuracy: Try rephrasing the original question in a few different ways (e.g., “revenue by region” vs. “how much did each territory earn?”). If the system doesn’t return the correct answer, you may need to Add Knowledge to help it with precise queries.
3. Add Knowledge (Context)
If the system consistently misunderstands terms, you can add explicit context.- Navigate to Domains > (Select your Domain) > Knowledge > Context and click Add Context.
- Add natural language sentences to define business terms.
- Example 1:
Regions are the same as Territories. - Example 2:
My sales stages are: Prospect, Negotiation, Closed.
- Example 1:
- Click SAVE. This helps the system formulate more precise queries.

4. Mark the Answer as Reviewed
Once you have confirmed the SQL is correct and the answer is accurate, save it to the system’s knowledge base.- From the SQL Code tab in the Editor window, click Mark as reviewed.
- In the Review Question window, add a clear title for the question (e.g., “Official Quarterly Revenue by Region”).
- Click Confirm.

- Test and validate both natural language responses and SQL query results directly within the chat interface.
- Review the generated output by providing feedback.
- Edit or vet the SQL query when necessary.
