Data Retrieval¶
TOBY AI TruePilot can help users write query statements and convert natural language into Explorer filter conditions. In Explorers and the Query Workbench that provide AI-assisted Query, it can also directly generate editable DQL drafts, reducing the effort of writing queries from scratch.
DQL / PromQL Assistant¶
The DQL / PromQL Assistant generates, explains, fixes, and reviews query statements, and can also rewrite DQL suitable for conversion into platform PromQL. When generating a new DQL query, TOBY AI TruePilot checks the data sources and fields in the current Workspace, uses field definitions to confirm semantics and units, and validates the result through syntax checks and actual queries.
This capability does not return DQL by default just because a user says "view recent logs". It enters the query language workflow only when you explicitly ask to write, explain, fix, review, or convert DQL / PromQL.
It is suitable for the following query tasks:
- Generating queries based on a goal when you are unfamiliar with DQL or PromQL syntax;
- An existing query fails validation, the result semantics are unclear, or risks need to be checked;
- Understanding the filtering, aggregation, grouping, and time window of an existing query;
- Converting metrics DQL to platform PromQL;
- Obtaining queries based on actual fields in the current Workspace rather than generic examples.
Write or Check Queries¶
Describe the query goal directly in TOBY AI TruePilot, and provide the following information where possible:
- Data Domain: Metrics, logs, events, traces, RUM, or other data types;
- Data Object: A known measurement, source, service, or field;
- Time Range: For example, the last 30 minutes or the past 7 days;
- Aggregation Semantics: Total, rate, average, percentile, TopN, or grouping dimensions;
- Output Type: DQL, platform PromQL, or a standard Prometheus query.
Example:
Generate a DQL query for the current Workspace: count the number of error logs for each service in the last 30 minutes, and return the top 10 services in descending order by count.
If you need to fix or explain a query, paste the original statement directly and describe the expected result. If the data domain, time range, or aggregation semantics are ambiguous, TOBY AI TruePilot will first ask for more information instead of guessing data sources and fields.
Query Results and Validation¶
When generating a new DQL query, TOBY AI TruePilot first confirms the query goal, data sources, and fields, then performs a syntax check on the final statement and actually queries within the specified time range to verify the result's fields, groupings, and aggregation semantics. When delivering, it briefly explains the data sources, filter conditions, aggregation, and time range; if fields or data sources cannot be confirmed, it explains the limitations or asks you to choose.
Field definitions can help you understand aliases, units, and business meaning, but they do not prove that reported data actually exists. Passing the syntax check does not mean the result is correct or complete: cases such as no data, access failure, and truncated results need to be checked separately. Do not treat technical failures as "no data".
When only explaining a query or field meaning, you do not need to actually execute the query; fixing an existing expression may only require a syntax check and should not be regarded as having verified business results. When generating PromQL, the platform-supported measurement:field metric semantics are used by default. This process does not actually execute PromQL; run it on the target query page and confirm the data results.
Note
The DQL / PromQL Assistant is used to generate query language and is not equivalent to page data analysis. If your goal is to determine what happened with the current logs, traces, or alerts, use Observability Analysis on the corresponding page.
Explorer Natural Language Search¶
Explorer natural language search converts a user description into query conditions that the current Explorer can recognize, and passes them to the page for execution together with existing queries and the time range. It is suitable for users who are unfamiliar with Explorer syntax but already know which objects, statuses, or value ranges they want to filter.
The current capability applies to Log, Trace, RUM, Basic Object, Resource Catalog, Event, Synthetic Monitoring, Security, Cloud Billing, Agent Monitoring, and LLM Explorers that provide the AI-assisted Query entry. Shared pages, SLS query mode, and the Backup Log Explorer do not provide this entry.
Set Filter Conditions¶
In an Explorer that supports this capability, describe the filtering goal in natural language. For example:
Find data where service is checkout, status is abnormal, and duration is greater than 2 seconds; only look at the last 3 hours.
You can express conditions such as equals, not equals, contains, wildcard, regex, numeric comparison, range, field existence, and combinations using AND, OR, and NOT. The operations actually available depend on the current field type.
By default, TOBY AI TruePilot retains the conditions already in the query box and appends new conditions after them. If you want to replace existing conditions, explicitly use expressions such as "re-query", "clear original conditions", "query only", or "replace with".
Condition Conversion Rules¶
TOBY AI TruePilot generates query conditions based on the field list provided by the current Explorer:
- Content that clearly corresponds to a current field or field alias is converted into structured filter conditions;
- Keywords whose fields cannot be confirmed are retained as plain text search and are not forcibly mapped to similar fields;
- Business values such as service names, resource names, IDs, URLs, paths, and error text are retained as-is where possible;
- Time expressions explicitly provided by the user are handled by the Explorer Time Widget.
When you select Generate Query Conditions, the result is used for filtering in the current Explorer; it does not create DQL or modify data. If a field does not appear in the fields available on the current page, it is not used as a structured condition even if another Explorer has a field with the same name.
AI-Assisted DQL Generation¶
When you need grouped statistics, trend analysis, or a more complex query, you can generate a complete DQL query in natural language in an Explorer or the Query Workbench. For example: "Count the number of error logs for the payment service in the last 30 minutes, group by host, and return the top 10 hosts by count."
| Entry | Query Scope and Generation Result |
|---|---|
| AI-assisted Query > Generate DQL in the Explorer search bar | Applies to Explorers that provide this entry, such as Log, Trace, RUM, Basic Object, Resource Catalog, and Event Explorers. Retains the current data type, index, and already scoped sources, generates a draft using the page time range, and fills it into the query editor. |
| DQL edit mode in the Query Workbench | After you describe the data type, data sources, filtering, and aggregation goals, click Generate DQL, and the result is written to the corresponding query tab. If no time is specified, the page time range is used, and the query is not limited by the data type of a particular Explorer. |
After generation, you can continue editing or copy the query; it is not automatically executed and does not refresh existing results. Pages that support DQL execution require confirmation before execution; Explorers that support only drafts provide editing and copying, and you can take the statement to the Query Workbench for execution. When executed in an Explorer, the statement must still conform to the current data type, index, and source scope.
These two entries are used to quickly generate query drafts. They do not discover and verify Workspace fields one by one, and may use common naming when business fields are insufficient. Before execution, verify the fields, units, aggregation semantics, and time range; passing the syntax check does not mean the current Workspace has corresponding data, nor does it mean the results have been verified. When you need to generate and validate queries using real metadata, you can use the DQL / PromQL Assistant in a conversation with TOBY AI TruePilot.