If your feedback was thumbs down, a new window opens to let you adjust the query accordingly . The more thumbs up/down you provide, the more you will be training the tool to get a high quality correct answer.
Click on the Edit button available for Admins in the chat interface to modify the SQL query that the chatbot generated and make other adjustments such as editing the columns and the general table format. Using this Editor allows you to correct any inaccuracies in the SQL and ensure it accurately answers the intended question.In the window that opens, you will find the Editor and the SQL tabs.
The Editor tab offers detailed data visualization configuration:
Chart Type Selection: Use the dropdown menu to choose the desired visual representation. (e.g., “Line chart”)
Chart/Table Configuration: Drag-and-drop data columns to include in the chart, in this example, a Line Chart with X and Y Axes (e.g., “Region” for categorization, “Total Revenue SUM” for aggregation).
Data Filtering: Apply specific criteria (e.g., “Stage Label: Closed Won”) for precise data segmentation.
Changes Management: The Apply changes button commits configurations, while the Reset one reverts them.
Users can directly define and manipulate the underlying data for visualizations by interacting with the SQL code.
SQL Editor: Craft and modify SQL statements to precisely define your dataset. This includes selecting columns, applying aggregations (e.g., SUM, AVG), joining multiple tables, filtering data with WHERE clauses, and ordering results.
Workflow Management:
Execution & Refresh: Click the Update response button to execute the current SQL query and refresh the associated data visualization with the newly retrieved results.
Review & Validation:
Select Mark as reviewed to confirms that the SQL code has been validated or checked, streamlining collaborative workflows.
After selecting this option, the Review Question window opens where you can add the title of your question.
Once ready, click on Confirm.
This Reviewed Query (a tuple of an SQL code and the question it answers to) will become available within the Domains section. To access it, go to Domains > Access the corresponding Domain > Knowledge > Reviewed Queries.
Go to Domains > (Access the Specific Domain) > Knowledge > Context section to add or modify domain-specific knowledge and information in natural language sentences and click on Add Context.
This helps the system understand your business context and formulate more precise queries. For example, you can define terms like “Regions are same as Territories” or clarify “My sales stages are: Prospect, Negotiation, Closed.” This direct manipulation of the context allows you to guide the chatbot’s understanding and improve its ability to generate relevant SQL queries.
In the text box that appears, add the Context specification.
Click on SAVE to keep your added content.
In all these cases, the system will use the provided data to adjust the context of your database, modelling it further, and making it possible to provide better answers in a future search.
Once you have validated or edited a chatbot response, it is important to test the outcome to ensure the changes improve accuracy and maintain the integrity of the original question. Testing not only verifies that the answer is correct, it also helps train the system to generate more reliable responses in the future.There are several ways you can actively test and refine your interactions:
Retry with Adjustments
After submitting feedback (e.g., via thumbs down), the chat interface offers a Retry option. This allows the system to regenerate the response while incorporating your adjustments or corrections, whether it is a refined SQL query or updated natural language prompt. This is especially helpful for:
Verifying whether your edit resolved the issue.
Comparing original vs. improved outputs.
Seeing how changes affect the data visualization.
Use the Updated SQL to Re-Query the Dataset
If you edited the SQL, click Update response to run the revised query. This re-executes the logic and updates the answer and/or chart accordingly. This step is essential for:
Confirming that syntax and logic errors have been fixed.
Testing if the new query returns accurate and expected data.
Visualizing how different filters or joins affect the results.
You can also validate results by cross-referencing with known values or external reports.
Mark as Reviewed for Future Accuracy
After confirming that the answer and query are correct, select Mark as reviewed. This promotes the question–answer pair (with its SQL) into the Reviewed Queries repository. Reviewed queries serve as a trustworthy reference for similar future questions and strengthen the chatbot’s knowledge within that Domain.This workflow is especially useful for:
Teams collaborating on analytics.
Ensuring consistent outputs over time.
Building a library of validated queries for business-critical topics.
Test for Generalizability
Once an answer is working, try rephrasing your original question to see if the chatbot still returns accurate results. For example:
Original: “Show me revenue by region for last quarter.”
Variation: “How much did each territory earn last Q?”
If the system handles both well, it means it understands your business context. If not, consider refining the Context in the Knowledge section to improve generalization.