# What are cards, and how do agents use them?

**A card is an interactive answer drawn right in the chat — a chart, a quiz, a decision matrix, today's weather — instead of a wall of text. Seven agents can show one of 81 built-in cards with a single tool, and the agent then talks you through it like a teacher talking over a figure. Some cards fetch their own live data, some let you answer back, and some can be kept in your vault.**

---

## What makes it different

| what it does | the primitive behind it | what that buys you |
|---|---|---|
| **The card is the answer** | A card rides on the tool call itself; the call is hidden and only the card shows | No "called a tool, got a result" row. The figure is the answer |
| **Live data, no keys** | 7 cards (weather, stock, news, info, word, YouTube, song) fetch their own data in a sandbox with Irene's keys stripped out | Real numbers on screen, and none of your credentials ever reach a card's code |
| **The agent sees what you see** | A fetch card's data comes back to the agent too | It reasons over the same live facts it just showed you |
| **You can answer back** | 39 cards post your own words to the chat (quiz, teach-back, roleplay, critique, inbox triage…) | The agent grades *your* answer in its next reply |
| **Keep what matters** | 26 cards have a keep button that saves what the card shows now into your vault | A useful card doesn't vanish with the chat |
| **It always says something** | Every card carries a one-line plain-text fallback | If a card can't draw, you still get the answer |

---

## How it works

### Showing a card

The agent picks a card from the catalogue, checks the card's shape (`schema`), then fills it (`render`) with the data and a one-line fallback. The data is checked before anything is drawn. A wrong shape is rejected with the exact field that failed, and never quietly patched.

**Why check every time:** a card filled with the wrong shape draws wrong silently. A loud, specific error lets the agent fix it in one step.

### When an agent shows one unasked

Agents are told to show a card **when the answer is something to see**: a comparison, a trend, a plan, a set of steps, a quiz. They never mention the tool, and never use the word "card". They talk over it as if pointing at a figure. Each card carries a "when to use" line, so the right one turns up at the right moment.

### What a card can and can't do

- A card runs in a **sandbox**: it can draw, react to clicks and play sound, but can't reach the network by itself.
- **Fetch cards** get their data from a small program that runs on Irene's side with **Irene's keys stripped out**. It has 20 seconds to answer.
- A card's buttons can run that card's own actions (25 seconds each), but **only the actions it declared**. Nothing else is reachable.
- Images come through Irene, and only from addresses written into the card itself.
- Cards follow your app theme, light or dark, from the first frame.
- Irene keeps a record of every card shown in a chat, with the chat, so it can be shown again; it is small (roughly 250 KB a year) and is removed when you delete the chat.

**Why the sandbox:** a card is code drawn inside your chat. Keeping it away from your keys and the network means a card can be useful without being trusted.

---

## The 81 built-in cards

| family | cards |
|---|---|
| **everyday** (15) | weather · map · place · world clock · contacts · info · news · stock · song · YouTube · gallery · recipe · QR · convert · loan |
| **language & learning** (15) | French · word · flashcards · quiz · recall · teach-back · adaptive · derivation · walkthrough · practice exam · exam review · chord · 3D model · diagram · mind map |
| **decide & plan** (12) | decision matrix · compare · the trade-off · preflight · day brief · week plan · prep brief · notes → actions · inbox triage · roleplay · objection · deal scorecard |
| **research** (12) | research findings · paper TL;DR · literature matrix · citation graph · figure · evidence ledger · methods · novelty · rebuttal · authorities · chronology · safe to file |
| **numbers & money** (8) | chart · formula · what moves · reconcile · runway · statement · funnel · money gate |
| **build & ship** (8) | error autopsy · what changed · build review · journey · page watch · launch gate · design critique · mockup |
| **writing & documents** (7) | critique · tracked changes · redline · fine print · pick a look · storyboard · novice read |
| **teaching** (4) | answer autopsy · grading anchors · misconception predictor · viva |

**Who can show cards:** the main agent, Browser, Document, Slides, Spreadsheets, Coding, and Design & Media. Helpers and agents you build don't get them, since a helper hands back text and there'd be nowhere for a card to go.

---

## Its tools

| tool | does |
|---|---|
| `render_card` | **list** cards matching a few words (up to 12), get a card's **schema**, or **render** it with data and a fallback line |
| `build_card` *(card_builder, added when needed)* | **build** a new card from an HTML file (plus a small program if it fetches or acts), or read the **errors** cards logged when they failed to draw |

**Why two toolkits:** showing a card is frequent, so `render_card` stays loaded (about 154 tokens a turn). Building one is rare and heavy, so `card_builder` is added only when needed. Folding it in would have doubled that cost on every turn.

---

## Making your own card

1. Ask for one ("make me a card that tracks my reading list"). The agent adds `card_builder`.
2. It writes the card's page, and a small program if the card fetches data or has buttons that do things.
3. `build_card` checks everything: the data shape, a working example, every named action and tool. Then it saves the card to `~/.irene/cards/<name>/`.
4. It renders the example so you see it straight away. If it fails to draw, the agent reads the error log and fixes it.

Your cards sit beside the built-ins, and any card-capable agent can use them.

**Not in auto mode:** cards are never built during unattended runs. Unattended work must not write new code.

---

## Approvals

- **Showing a card** that doesn't fetch counts as a read, so it runs freely.
- **A fetch card** sends the agent's input to the internet, so in auto mode it goes to the judge.
- **A card's own buttons** always come back to you as a normal approval in auto mode. In unattended runs they're held and listed in **Irene needs you**.
- **Building a card** is refused in auto mode.

→ [Approvals & auto mode](https://mycelen.com/manual/how-it-works/approvals-and-auto-mode)

---

## Where you see it

- **In the chat, as the answer:** full width, up to 720 px tall (taller cards scroll inside), with no tool row around it.
- **If a card can't draw,** you see its fallback line, or nothing. The error goes to the card's log, not into your chat.
- **Kept cards** are saved as notes in the **Vault**, under the project **Cards**, and are searchable like any note.
- **Only in the chat.** Your chat apps, the overlay panel and voice get the fallback line and the agent's explanation.
- Reopening a chat shows the card frozen as it was. Ask again for fresh live data.

---

## How it gets better

- **Your own cards grow the library:** build once, reuse in every chat.
- **Keepers become memory:** a kept card is a vault note the agent can find and bring back later.
- **The "when to use" line on each card** is what makes agents reach for it unprompted. A good one means it shows up exactly when it helps.

---

## What it costs

- **Drawing a card uses no model.** Fetching and button actions run as small local programs.
- **The data a fetch card returns** joins the conversation, so it's re-sent on later turns. Built-in fetch cards keep it small.
- **The speaker button** on a card generates speech, which uses your media usage.
- No plan gate: every card works on every plan.

---

## Limits

- **Only in the main chat thread,** not in chat apps, the overlay panel or voice.
- **No editing a card by hand in the app.** Ask the agent to rebuild it, or edit its files in `~/.irene/cards/`.
- **Card state resets when you reopen a chat**, unless the card saves it.
- **Fetch: 20 seconds. Button action: 25 seconds.** Images up to 8 MB.
- **Cards aren't built in auto mode.**

---

## Related

- [Tool UI](https://mycelen.com/manual/reference/toolkits/tool-ui): give *any* tool's output, including your connected apps, its own interactive view
- [Main agent](https://mycelen.com/manual/reference/agents/main) · [Build your own toolkit](https://mycelen.com/manual/reference/toolkits/build-your-own-toolkit)

[Ask Irene about this]
