Stats and Quick start
Ask your database a question on a canvas, approve the query an agent writes for it, and keep the answer as a number, a graph or a table. And the ten steps of the guide a new workspace opens on.
A stat is a block on a canvas: one question to a database of yours, shown as a number, a line or bar graph, or a table. You add one the way you add a note, and it stays on the canvas with its last answer.
Add a stat
On any canvas choose Add, then Stat. The form asks for three things:
- Database: a PostgreSQL database connected to the workspace, or Connect a database to add one. Use a read-only user. The address and password are sealed in your browser to your organization's vault: only its runners can open it, Yard's servers cannot; the runner opens them for each query, and nobody reads them back, agents included. The workspace's databases are listed, renamed and removed on the Insights page, under Sources.
- Question: in plain words, such as "How many teams signed up this week?".
- Show as: Let the result decide, Number, Graph or Table.
Ask puts the block on the tab at once. It says Working while an agent writes the query, with what the agent is doing.
Approve the query
Nothing an agent wrote runs against your data until a person approves it. When the agent has a query, the block shows it, names the database, and offers Approve and run. Edit the query lets you change the SQL first; saving your version approves it.
Yard accepts one SELECT (or WITH … SELECT) and nothing else: a DELETE
is refused before it reaches the database. The query runs in the workspace's
box on its runner, in a read-only transaction, with a 60-second limit and at
most 10 000 rows.
Change a stat
A stat's menu ("…" on the selected block, or a right-click) has:
| Entry | What it does |
|---|---|
| Change the question | The new question goes to the stat's agent and comes back as a new query to approve. The answer you have stays on the block until you approve the new one. |
| Edit the query | Change the SQL yourself. Saving it approves it, and it runs. |
| Show as | Number, graph or table. Only the drawing changes; nothing runs. |
| Run again | Runs the approved query now. |
| Refresh | Only when I run it, Every hour or Every day. |
| Open its log | Shows the stat's agent at work, see below. |
| Delete | Removes the block and its query. |
A tab's menu, in the row of tabs above the canvas, has Run all stats again when the tab holds stats.
A stat that fails stays on the canvas and shows the error. Ask the agent to fix it sends the error to the stat's agent, which proposes a corrected query for you to approve.
The log of a stat
Every stat has a chat of its own, apart from the workspace's chats. Open its log shows it in the chat panel, titled with the stat's name: the agent's messages, the commands it ran, and the query it handed in. The line under the composer reads "Reads this stat", and what you write there goes to that stat's agent. Closing the log's tab puts it away; the block keeps it, and it is there again after a reload.
A stat that is working says so on the canvas and in the tab's list view, where a query that waits for you reads Approve.
Insight boards from before
Insights used to be insight boards under Monitors. Each of them is now a canvas of the workspace with the board's name, listed under Canvases, with one stat per card, already approved and with its last result. The old address of an insight board opens its canvas.
The Insights page
Insights in the sidebar shows the workspace's stats as cards, each with the tables its query reads and when it last ran. The cards are every stat of the workspace on a canvas you can open. Add source connects a PostgreSQL database (its address is sealed), and the sources are listed under the cards with Rename, Read tables again and Remove. With a source and no stat yet, Add a stat asks the first question; the query waits on its card until you approve it. A bar graph whose bars are steps one after another is drawn with the bars on their side.
A card's … menu on this page has Edit the query, What the AI may read (below) and All tables in Settings. The rest of a stat's menu (Change the question, Show as, Run again, Refresh, Delete) is on its block on the canvas.
The chat is part of the page. From a window 1150px wide it is a fixed column at the right, headed Ask about Insights: it cannot be floated or minimised. On a narrower window the chat button opens it as a sheet. Its first context chip is Stats: Every canvas, so a question is asked about the stats on the page; Edit context adds a repository or blocks from any canvas, to ask about the numbers together with the code. The button reads Ask. Asking for a new stat there makes one the usual way, with a query for you to approve. See chat.
What the AI may read
Every column is either AI can read or Only people. The values of an "Only people" column are shown to people in the app and are never sent to a model: an agent is told the column's name and type and nothing else. In a table such a column carries a lock.
- When a source's tables are read, columns whose name or type looks personal (a name, an email address, a phone number, an address, a date of birth, an IP address, a token, a password and the like) are detected and start as "Only people". Everything else starts as "AI can read". A choice you made is kept when the tables are read again.
- Field access on the Insights page opens the setting (Workspace settings, Field access): every source with its tables and columns. A table has a switch of its own: turned off, the AI is not told the table exists, and a stat that reads from it sends none of its columns.
- A stat's … menu has What the AI may read with one row per column of its result. A choice there applies to that stat at once and wins over the table's.
- A result column takes the choice of the source column with the same name.
A column the query makes from an "Only people" column under another name
(
email AS contact,lower(email)) is held back as well, until you open it in the stat's menu.
This is enforced by Yard's API, not by the model: the stat's own chat, a chat
message that brings stats as context, and yard insight list in a box all get
the result with those values left out. An answer that was given stats ends
with a line the API writes: "Read: Newest customers. Not read: name and email,
which are set to "Only people"."
A stat's last error is told to its agent so it can fix the query. PostgreSQL can quote the value a query failed on in that error; Yard takes quoted values out of it before an agent reads it and keeps the names of tables and columns.
Agents and stats
Ask the workspace agent in the chat ("add a stat for failed payments per
week") and it adds the stat with yard insight add; the query still waits
for your approval. Projects do not make stats. The agent can see a
database's tables and columns with yard insight tables (never their
values) to plan several stats at once, and a database whose tables were
never read is read when the agent first needs them.
First run
A new workspace opens on three rows: A machine, An agent and Your repositories. A done row says what it is; only the next open one has the filled button. Not now goes to Home for everyone in the workspace, and Show the quick start in the workspace switcher brings the rows back.