# Database

Airtable-style tables of records with typed fields, links between tables and a page of notes per record.

**What it is.** Airtable-style tables of records with typed fields, links between tables and a page of notes per record, made by an AI agent such as Claude Code or Codex in Artifacts (tryartifacts.com), the office for AI agents. **Ask for it** in plain words: “Build an Artifacts database for our CRM: companies, contacts and deals, linked to each other.” It stays a live item at its own link in the space, and the space’s owner can [publish](/docs/publishing) it as a web page anyone can open. See one an agent made: [Sales CRM](/p/northwind-sales-crm), 36 companies, 108 contacts and 47 deals, all linked.

> Agents read this guide with the `guide` tool, topic `databases`, before they first make a database. It is shown here word for word, so people and their agents work from the same method.

| | |
| --- | --- |
| Guide topic | `databases` |
| Tools | [9 tools](/docs/reference/databases) |

A database is Airtable-style tables of records in one item: a CRM (Companies, People, Opportunities), a
tracker, an inventory, a content calendar. Each table has typed fields; each record is a row. People see
the tables listed on the left and the chosen table as a grid on the right: they edit cells in place, add
records and fields, sort, filter and search, and click a row to open that record in a side panel: its
fields, and under them its page of notes — where they also comment on it.

The tools: `create_database` (tables, fields, records), `read_database` (each table's fields and record
count), `list_records` (records with ids, filtered, searched, sorted, paged), `add_records`,
`update_records`, `delete_records`, `update_database` (add, rename, remove tables; add, change, move,
remove fields), `import_records` (fill a table from a sheet range), `render_database` (a screenshot).

## A database or a sheet?

A database holds records — one row per thing (a company, a deal, a task) with typed fields, links between
tables, a page of notes per record, and people editing them in a grid and a side panel. A sheet holds
numbers and formulas — calculations, models, the blocks a dashboard reads. A tracker of things is a
database; the totals over it, and the charts of them, are a sheet and a dashboard.

## Order of work

1. Decide the tables: one per kind of thing (companies, people, deals), not one per group of things —
   "Clients" and "Leads" are one Companies table with a Stage field.
2. Decide each table's fields and their types (below). The first field names each record.
3. `create_database` with the tables, fields and the records you have; link fields join the tables.
4. More records: `add_records` (up to 1000 a call), or `import_records` from a sheet.
5. `render_database`; then give the person the URL.

## Fields

| Type | Holds | Value you give |
|---|---|---|
| `text` | one line: a name, a title, an id | "Acme Inc" |
| `long_text` | notes, descriptions | "Met at the expo…" |
| `number` | amounts, counts; `format` currency (with `currency`) or percent, `decimals` | 12500, or 0.25 for 25% |
| `checkbox` | yes or no | true |
| `select` | one of `choices`: a status, a stage, a priority | "Qualified" |
| `multi_select` | any of `choices`: tags | ["B2B", "EU"] |
| `date` | a day | "2026-11-03" |
| `url`, `email`, `phone` | links and contacts | "acme.com", "ana@acme.com" |
| `person` | a member of the space: an owner, an assignee | their name or email |
| `link` | records of another table in this database (`link`: that table) | the linked records' first-field values, ["Acme Inc"] |
| `file` | attachments | [{ "url": "https://…/deck.pdf", "name": "deck.pdf" }] |

- **The first field names the record**: a name or title, as `text`. It is what links show and what the side
  panel is headed with. Never a checkbox, a file or a link.
- **Choices in order**: a select's `choices` are listed in the order given — stages in their order
  ("Lead", "Qualified", "Proposal", "Won", "Lost"), not alphabetically. A value that is not a choice is
  added as one; give the full list up front so the grid's menu shows them all.
- **Links, not copies**: when a record belongs to a record of another table (a person works at a company, a
  deal is with a company), use a `link` field, not a text field with the company's name typed again.
- **People are people**: an owner or assignee who is in the space is a `person` field; someone outside it is
  a record in a People table.
- **Only real records.** No sample rows, no placeholder names; if you have no data yet, make the tables
  and fields and leave them empty for the person to fill.
- About 5–15 fields a table. Past that, the grid scrolls sideways and the side panel carries the rest.

An example (`link` fields can point at any table in the call):

```json
{
  "title": "Sales CRM",
  "tables": [
    { "name": "Companies", "fields": [
      { "name": "Company", "type": "text" },
      { "name": "Website", "type": "url" },
      { "name": "Industry", "type": "select", "choices": ["Software", "Finance", "Retail"] },
      { "name": "Owner", "type": "person" },
      { "name": "ICP", "type": "checkbox" }
    ], "records": [ { "Company": "Acme Inc", "Website": "acme.com", "Industry": "Software", "ICP": true } ] },
    { "name": "Deals", "fields": [
      { "name": "Deal", "type": "text" },
      { "name": "Company", "type": "link", "link": "Companies" },
      { "name": "Stage", "type": "select", "choices": ["Lead", "Qualified", "Proposal", "Won", "Lost"] },
      { "name": "Amount", "type": "number", "format": "currency", "currency": "USD" },
      { "name": "Close date", "type": "date" }
    ], "records": [ { "Deal": "Acme renewal", "Company": ["Acme Inc"], "Stage": "Proposal", "Amount": 24000, "Close date": "2026-12-15" } ] }
  ]
}
```

## A record's page

Every record has a page under its fields, as in Notion: notes, a brief, call notes, a description — the
words that are not a value of a field. People write it in the side panel. Give it in Markdown (headings,
lists, `- [ ]` to-dos, links): as `{ "values": {…}, "page": "## Next steps\n- [ ] Send the proposal" }`
in `create_database` or `add_records`, or `page` in `update_records` (it replaces the whole page). Read it
with `list_records` and `pages: true` (without it, `has_page` says which records have one). Keep a value
that people filter or sort by in a field, not in the page.

## Working with records

- `list_records` before changing: it gives each record's `id`. Filter (`is`, `contains`, `gt`, `empty`…),
  `search` words in any field, `sort`, and page with `offset` (`next_offset` says there are more).
- `update_records` changes only the fields given; `null` clears one.
- People edit the same tables while you work: read before you write, and change only what you were asked.
- Numbers for charts: a dashboard reads sheets, not databases. Put the figures in a sheet first
  (`create_sheet`), then build the dashboard on it (guide topic "dashboards").

## Changing the shape

`update_database`: `add_tables`, `rename_tables`, `remove_tables` (their records go too; links into them
become text), `add_fields`, `change_fields` (a new type converts each value through its text; what does
not read is cleared — say so to the person), `remove_fields`, `move_fields` (`to` 0 makes a field the first,
naming the records).

## Check it

`render_database` shows a table's grid as people see it (`table`), with a record's side panel open
(`record`). Look: every field's header readable, values filled where you meant them, choices in order.

## Comments

People comment on a record from its side panel. Read the thread, fix the record with `update_records`,
`reply_comment`, resolve. To start one, `comment` with `record` (its id from `list_records`).

## See it in use

- **Roles:** [AI for financial risk analysts](/roles/financial-risk-analyst), [AI for legal secretaries](/roles/legal-secretary), [AI for account executives](/roles/account-executive), [AI for advertising and promotions managers](/roles/advertising-manager), [AI for logistics analysts](/roles/logistics-analyst), [AI for HR specialists and recruiters](/roles/hr-specialist)
- **Articles:** [AI CRM: Run Your Sales Pipeline With an AI Agent](/blog/ai-crm-sales-pipeline), [What Is a Kanban Board? Columns, WIP Limits and an Example](/blog/kanban-board), [Claude Code and Notion: Notion MCP vs Artifacts for Agent Work](/blog/notion-vs-artifacts)
- **Examples:** [24 pages agents made for a sample company](/examples)
