Troubleshooting Q&A Accuracy Issues

When Analytics Agent's response does not meet expectations, do not only look at the final text answer. The correct approach is to trace through the execution pipeline step by step: how the user's question was understood, which knowledge and configurations were matched, what SQL was generated, which fields were used, and what filters, groupings, and metrics were applied.

This guide is based on actual configuration and Q&A validation, and is applicable for troubleshooting issues such as "wrong numbers, wrong fields used, missing filters, incorrect grouping, metrics or answer builders not matched, unclear definition explanation".


Troubleshooting Order

The recommended troubleshooting order is:

StepWhat to CheckPurpose
1. Check final answerValues, explanations, charts, tablesIdentify the type of problem.
2. Check SQL statementTables, fields, filters, groupings, aggregations, JOINsDetermine if the SQL matches the business definition.
3. Check logsKnowledge, metrics, answer builders, tool callsDetermine if the system matched the correct configurations.
4. Check field semanticsAliases, descriptions, types, usage, hidden status, virtual columnsDetermine if fields are correctly understood.
5. Check knowledgeBusiness terms, definitions, synonymsDetermine if there is an explanation basis for the user's expressions.
6. Check metrics and answer buildersExistence, enabled status, definitions, parametersDetermine if calculation logic should be solidified.
7. Check table relationshipsAuto-association, manual relationships, JOIN pathsDetermine if multi-table queries are correct.
8. Check health scoreAnomalies and warningsIdentify configuration gaps affecting Q&A accuracy.

Do not immediately modify SQL or configuration. First confirm through SQL and logs which layer the error occurred at.


Common Problem Types

Problem SymptomTypical Cause
Numbers are wrongWrong field used, missing filter, incorrect aggregation function, JOIN fan-out, metric definition error.
SQL uses wrong fieldMissing field alias/description, similar fields exist, field usage unclear.
Did not filter as user requestedFilter field not configured, actual field value casing inconsistent, ${filters} not bound.
Did not group as user requestedDimension field not configured, ${dims} not bound, field not suitable as dimension.
Knowledge not matchedKnowledge not configured, not enabled, or doesn't include user's common expressions.
Metric not matchedMetric not added to analytics domain, not enabled, name/alias doesn't match.
Answer builder not matchedBuilder name, alias, description unclear, output metric name unclear, or parameters not configured.
Multi-table results anomalousMissing table relationship, JOIN error, join field not unique.
Chart doesn't match expectationsSQL output columns not suitable for chart, dimension or measure selection unreasonable.
Explanation is unclearField descriptions, knowledge, metric descriptions insufficient.

Step 1: Check the Final Answer

First determine where the final answer is wrong.

Focus on:

  • Whether numbers meet expectations.
  • Whether the correct definition was used.
  • Whether filtering was done as the user requested.
  • Whether grouping was done as the user requested.
  • Whether table and chart fields match the question.
  • Whether the natural language explanation states the definition.

For example, the user asks:

If the answer only returns overall active rate without grouping by plan, it may indicate the dimension was not passed in or was not configured. If the answer groups by plan but doesn't filter source = Google, the filter condition may not have taken effect.


Step 2: Check the SQL Statement

Click SQL Statement below the answer to check the actual executed SQL.

Key checks:

Check ItemHow to Determine
Is the table correct?Is the table in FROM the expected table?
Are the fields correct?Are fields in SELECT, WHERE, GROUP BY consistent with the business definition?
Is the filter correct?Does WHERE include the conditions the user requested?
Is the grouping correct?Does GROUP BY include the dimensions the user requested?
Is the aggregation correct?Are COUNT, SUM, AVG, MAX, MIN consistent with the metric definition?
Is the JOIN correct?In multi-table queries, are ON conditions correct? Could it cause data fan-out?
Are LIMIT / ORDER BY reasonable?Do they affect detail or TopN queries?

In practice, after an answer builder is matched, the SQL will show the template has been substituted. For example:

WHERE active_subscription = TRUE AND `plan` = 'Basic'

This shows that the user's "Basic Plan" has been converted into a filter condition.

If the SQL does not include the filter or grouping field the user requested, continue checking logs to confirm whether filters or dims were passed in.


Step 3: Check the Logs

Click Logs below the answer to view the complete execution pipeline.

Logs are critical for troubleshooting accuracy because they show:

  • Whether knowledge was searched.
  • Whether knowledge was matched.
  • Whether metrics were found.
  • Whether an answer builder was found.
  • Whether metric calculation was executed.
  • Whether it fell back to table structure and SQL query.
  • Whether it first queried actual field values.
  • Whether a chart or table was generated.

Common Signals in Logs

Log SignalMeaning
search_knowledge found 0 resultsNo knowledge available to explain the user's business term.
get_knowledge_detailThe system has read the knowledge details.
Found N metricsAvailable metrics or answer builder outputs exist in the current analytics domain.
Execute metric calculationThe system is attempting to use a configured metric or answer builder.
Metric calculation failed, falling back to SQL queryThe configured object was recognized but execution failed; system fell back to SQL.
View table structureThe system needs to rely on field structure for ad hoc inference.
Query DISTINCT field valuesThe system is confirming enumeration value casing or actual values.

Log Characteristics When an Answer Builder Is Matched

When an answer builder is matched, logs typically show:

  • Found matching metric or answer builder.
  • metricType = SQL.
  • metricId pointing to the SQL metric generated by the answer builder.
  • Parameters including dims, filters, or outputColumns.

For example:

ParameterMeaning
dims = planGroup by Plan.
filters: source = GoogleFilter for Google source only.
outputColumns = active_account_rate, active_seatsReturn only active rate and active seats.

If the user's question is suitable for an answer builder but logs show no builder was matched, typically check the builder's name, alias, description, and output metric names.


Troubleshooting Field Semantics

Field semantic issues are one of the most common causes of Q&A errors.

Typical Problems

ProblemSolution
User says "plan", SQL doesn't use planAdd "subscription plan, version" and similar aliases to plan.
User says "active accounts", SQL doesn't use active_subscriptionSupplement field description and configure knowledge explaining the active account definition.
SQL uses wrong time fieldDistinguish descriptions and usage for created_at, trial_ends_at, canceled_at.
Grouping by ID or email makes results very granularAdjust field usage to avoid high-cardinality fields as default dimensions.
Field doesn't appear in filters or dimsCheck field type, field usage, and hidden status.

Eliminating Field Ambiguity

When similar fields exist in one or multiple tables, prioritize supplementing field semantics.

For example, when an account table has:

  • active_subscription
  • trial_converted
  • canceled_at
  • legacy_plan

If a user asks "active accounts", use field descriptions and knowledge to clarify:

This reduces the model's chance of selecting the wrong field.


Troubleshooting Knowledge Configuration

Knowledge is used to explain business terms, definitions, and synonyms.

When to Check Knowledge

SymptomDescription
User used a business termKnowledge is needed to explain the term.
Same concept has multiple namesKnowledge needs to maintain synonyms.
Field description cannot fully express the definitionKnowledge needs to supplement cross-field or business rules.
Answer explanation is unclearKnowledge needs to support natural language explanation.

Troubleshooting Methods

Check logs for:

  • search_knowledge
  • get_knowledge_detail
  • Matched Knowledge ID

If no knowledge was matched:

  • Check whether knowledge has been added to the current analytics domain.
  • Check whether knowledge is enabled.
  • Check whether the knowledge name and description include the user's common expressions.
  • Check whether abbreviations, aliases, and English expressions need to be added to the knowledge.

In practice, after configuring "active user definition" knowledge, when a user asks "How many active accounts are there?", logs show the knowledge was matched and active_subscription = TRUE was used as the definition.


Troubleshooting Metric Configuration

Metrics are suitable for solidifying simple aggregation definitions.

Common Problems

SymptomPossible CauseSolution
System didn't use the metricMetric not added to analytics domain or alias doesn't matchCheck metric status, name, alias.
Metric calculation failed and fell back to SQLProblem with metric definition or execution parametersCheck logs and SQL, fix metric definition.
Metric definition doesn't match businessAuto-generated metric not manually reviewedModify metric or switch to answer builder.
User expression doesn't match metricMissing metric aliasesAdd common business expressions.

In practice, auto-generated metrics are only candidate suggestions, not final business definitions. The system may generate COUNT(canceled_at), MIN(created_at), SUM(seats) and similar candidate metrics — users should review before adopting them.


Troubleshooting Answer Builders

Answer builders are suitable for complex SQL, multi-metrics, dynamic filters, and dynamic dimensions.

Key Checks

Check ItemDescription
Does SQL include ${filters}?Missing this may prevent dynamic filtering; validation will report an error.
Does SQL include ${dims}?Required when dynamic grouping is needed.
Are filter fields bound?Affects whether filtering works when users say "only show condition X".
Are dimension fields bound?Affects whether grouping works when users say "show by field X".
Are output field names clear?Affects whether Q&A can select the correct output columns.
Is the description clear?Affects whether the system can select this builder.

Typical Matched Case

The user asks:

Logs show:

  • Found answer builder "Account Health Overview".
  • Passed in dims = plan.
  • Multiple output metrics returned.
  • Automatically generated table and combination chart.

The user continues:

Logs show:

  • First queried actual value of source, confirmed as Google.
  • Passed in filters: source = Google.
  • Passed in dims = plan.
  • Passed in outputColumns = active_account_rate, active_seats.

This shows that answer builders can not only fix SQL but also dynamically respond to users' filter, grouping, and output column requirements.


Troubleshooting Table Relationships

Multi-table Q&A errors usually come from JOIN relationships.

Situations That Need Attention

  • The user's question spans multiple tables.
  • SQL contains JOINs.
  • Results are significantly inflated or duplicated.
  • Table relationships not configured or auto-association returned no results.
  • Same-name fields exist in multiple tables.

In practice, auto-association is not available with a single table; after adding multiple tables, you can click "Auto Associate" and the system will open a confirmation window. Auto-association may return "No table associations found" — in this case you cannot assume multi-table Q&A is reliable.

Recommendations:

  • Manually confirm fact table and dimension table relationships.
  • Check whether JOIN fields are unique.
  • Avoid confirming associations solely because field names are identical.
  • Validate JOINs in SQL using typical multi-table questions.

Using Health Score Scans

Analytics domain health score scans for configuration items that affect Q&A accuracy.

In practice, the health score may flag:

  • Table fields missing description information.
  • No metrics exist in the domain.
  • Table relationship anomalies.
  • Large number of null values in a field.

Health score is not a formality check. The issues it flags — missing field descriptions, no metrics, incorrect joins — can directly affect Q&A accuracy.

Before launch:

  • Click "Re-scan".
  • Address anomalies.
  • For issues not immediately addressed, document the reason.
  • After addressing, re-test with typical questions.

Symptoms and Treatments

SymptomPriority CheckRecommended Action
Numbers obviously wrongSQL, metrics, answer buildersCheck aggregation functions, filter conditions, and definitions.
Wrong field usedField semanticsAdd aliases, descriptions, field usage; hide interfering fields if necessary.
Missing filterSQL, logs, field usageCheck whether filters were passed in, whether the field is filterable.
Missing groupingSQL, logs, dimension configurationCheck whether dims were passed in, whether the field can serve as a dimension.
Knowledge not matchedLogs, knowledge configurationSupplement knowledge synonyms and business definitions.
Metric not matchedMetric status, name, aliasAdd to analytics domain, enable metric, add aliases.
Answer builder not matchedBuilder name, description, output metricsAdd business-friendly name, alias, description.
Multi-table results inflatedTable relationships, JOINsCheck join fields and cardinality.
Chart unreasonableSQL output columnsAdjust dimension and measure fields.
Explanation unclearKnowledge, field descriptions, metric descriptionsSupplement business definition explanations.

After configuration is complete, prepare a fixed set of test questions.

Validation TargetExample Question
Field mappingShow account count by plan.
Filter conditionShow active account count for Google source only.
Business definitionWhat is the current active account count?
Dynamic dimensionShow account health overview by plan.
Dynamic output columnsShow active rate and active seats by plan.
Knowledge matchHow many active users are there?
Answer builder matchShow account health overview by plan, including account count, active account count, active rate, total seats, and active seats.
Multi-table relationshipShow order amount by category.

For each question, check the final answer, SQL Statement, and Logs.


Pre-Launch Checklist

  • Do core fields have aliases and descriptions?
  • Have core business terms been configured with knowledge?
  • Have commonly used metrics been created and added to the analytics domain?
  • Have complex definitions been solidified using answer builders?
  • Do answer builders have ${filters} and ${dims} configured?
  • Do output metrics have business-friendly names, aliases, and descriptions?
  • Have table relationships been confirmed?
  • Have health score anomalies been addressed?
  • Have typical questions been used for validation?
  • Have SQL and logs been checked to confirm the matching path?

The core principle of Q&A accuracy troubleshooting is: don't just look at the answer — look at SQL and logs; don't just fix a single question — fix the reusable configurations like field semantics, knowledge, metrics, answer builders, and table relationships.