> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orisu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI columns

> Derive a value per row with a prompt — cleaned text, a headline, a discounted price — computed once, stored, and refreshed on demand.

An AI column runs a prompt you write over each row's other columns and stores one derived value per row — a cleaned-up description, a generated headline, a price with a discount applied. Unlike the other column kinds, its value comes from a model instead of being typed or imported.

<Note>
  An AI column is **materialized**, not a live formula. It computes once, stores the result, and only recomputes when you ask it to (or when a source cell it depends on changes and you refresh). It never re-runs on every keystroke — that would be slow and expensive at feed scale.
</Note>

## Adding an AI column

Open **Add column** and pick **AI column**. Three things to set:

* **Prompt** — the instruction the model runs for every row. Reference other columns by clicking their name chip under the prompt box; each click inserts a `{{columnId}}` token at your cursor. Tokens are bound to the column's ID, not its name, so renaming a column later never breaks a prompt that references it.
* **Output type** — constrains and parses what the model returns: **text**, **markdown**, **number**, **price**, or **bool**. A discount prompt with output type **number** always lands as a real number in that cell, not a string you'd have to re-parse. (**select** output is also a valid type and is available via the API/MCP with `outputSettings.selectOptions` supplied directly — it isn't offered in this editor yet, since there's no UI here to define the option list.)
* **Model** — **Haiku** (fast and cheap) is the default; switch to **Sonnet** for prompts that need stronger reasoning. Pick the cheapest model that reliably gets your prompt right — most cleanup and rewriting prompts do fine on Haiku.

For example, a column named **Clean description** with the prompt:

```text theme={null}
Clean this HTML into plain text: {{Description}}
```

and output type **text** produces a plain-text value in every row, derived from that row's `Description` column.

A discount column with the prompt:

```text theme={null}
Discount {{Price}} to 30% off. Return only the number.
```

and output type **number** produces a numeric result you can sort, filter, and export like any other number column.

<Tip>
  If a referenced column is empty for a particular row, the prompt just sees an empty value for that token — the run still happens rather than being blocked.
</Tip>

## Auto-compute

You don't have to manually trigger a new AI column:

* **On create** — as soon as you save the column, Orisu kicks off a compute run over every existing row.
* **On import** — new rows added by a CSV or Shopify import are automatically filled in for every AI column in the feed.

Cells fill in as the run progresses; the header shows a "Generating *done*/*total*" subtitle while a compute run is active.

## Staleness and refresh

An AI column doesn't auto-recompute when you edit a column it depends on — instead, the cell is marked **stale**: a small amber dot next to its value, meaning "the inputs changed since this was generated." The value stays visible (it isn't cleared), so you can still see the last result while deciding whether to refresh it.

Open the column header's menu to recompute in bulk, scoped by cell state:

* **Generate all** — recompute every row.
* **Generate stale only** — recompute just the cells whose dependency inputs changed since their last run.
* **Generate errored only** — retry just the cells whose last compute attempt failed.

A cell that fails shows the error message inline with a red accent; retrying it (via **Generate errored only**, or re-running the whole column) is the fix — there's no separate error-dismiss action.

## Generate one cell or selected rows

You don't have to recompute the whole column to fix one row. Hover over any empty, stale, or errored AI cell and a small **▶ Generate** button appears in the cell — click it and just that cell recomputes (it shows a spinner while running, then fills with the result). It's hidden on cells that are already computing, and on cells with a current, non-stale value.

To recompute a specific set of rows instead of the whole column, select the rows in the grid first: the column's header menu shows **Generate selected rows (N)**, where *N* is your current selection count (the item is disabled until you select at least one row). Use this when you've fixed a handful of source rows and only want those recomputed, without triggering a run over the whole feed.

### Editing an AI cell by hand

Click into a computed cell to type your own value directly, the same as any other cell. Once you edit it, that cell is protected: a later **Generate stale only** or **Generate all** run skips it instead of overwriting your edit. This mirrors the rule most AI-field products use — a human correction always wins over a regenerated one.

## Cost

AI columns are billed **per row**: each cell your compute run generates is one row's charge — whether the run covers the whole column, just the stale or errored cells, a single row via the hover **▶ Generate** button, or a selected subset via **Generate selected rows (N)**. There's no separate flat run fee on top of that.

Haiku is the default model precisely because AI columns are meant to be cheap on a per-row basis and safe to add liberally; reach for Sonnet only when a prompt genuinely needs it. If an org runs out of credits mid-batch, the remaining cells show an inline **"Out of credits"** error instead of staying blank, so it's clear generation didn't silently fail.

## Apply to column

Once you're happy with an AI column's results, use **Apply to column…** from the header menu to make them permanent:

1. Pick an existing data column as the target (or the column type list only shows compatible data columns).
2. Every row's computed value is copied into that data column.
3. The AI column is removed.

This turns a one-off AI computation into a plain data column — useful once you've settled on a cleaned-up description or a final discounted price and don't want the column's prompt/model config hanging around anymore.

## Using an AI column as an agent input

An AI column holds whatever type it outputs (text, number, price, and so on), so an agent column can bind to it the same way it binds to a data column. Pick it from the input's source list when you set up the agent column. It carries an **AI** tag there, so you can tell generated values apart from typed ones. You can also reference it by name inside a static value with a `{{Column}}` token.

Generate the AI column before you run the agent column. A cell that hasn't been generated yet resolves to nothing, so that row falls back to the agent's own default for that input. The binding says so once you pick an AI column. If a data column and an AI column share a name, `{{Column}}` resolves to the data column, and you can still bind the AI column directly to reach it.

## From code and agents

AI columns are also available through [MCP tools](/mcp/overview) and the REST API, so external agents and the in-app copilot can create AI columns, trigger a compute run, and read back results the same way the grid does.
