Écrire et vérifier un modèle › Construire des applications de données › Ask the data

Écrire et vérifier un modèle › Construire des applications de données

Cette page n’est pas encore traduite : voici la version anglaise.

Ask the data

A box that takes a question in words, such as "max motor temp by board, weekly". The page reads it with no AI, and draws the chart it asks for. It does the job of the anfra NLQ Explorer.

archec new my-app --kind data-app --template ask-the-data
archec ui preview my-app/main.arche --serve

What it shows#

  • A filter bar: the last 30 days, a site.
  • ask q "Ask the data" { rows Telemetry; text "…" }: the box, a few questions to try, what it understood, and the chart.
  • Three tiles under it.

What a question may say#

Words Read as
max, highest, peak · min, lowest · average, mean · total, sum · count, how many · median · p95 the aggregation
a metric's name or label, a measure's name or label what it is about; temp matches temperature
by board, by board and site, per site the dimensions
hourly, daily, weekly, monthly · per week the time grain: a line
a value of a dimension (esp32-c3) only those rows
last 7 days, past 2 weeks only the latest rows

With a grain it is a line, split by the first dimension. With a dimension and no grain it is a bar, or a heatmap for two. With neither it is one number. Words it did not read are written under the box.

The data#

  • data/telemetry.csv: every two hours for a month, per board and site: at, board, site, firmware, motor_temp, current, rpm, faults.

Limits#

  • The words are English. A question with two metrics shows the first.
  • A condition on a number (temp above 70) is not read.

The model is lib/data-apps/ask-the-data/main.arche, and the gallery lists the other templates.