Arbor agent guide
Authoring Arbor Records
A Schema, View or Dashboard is an Artifact whose source is arbor-records/v1 JSON. Creating that Artifact on its home Thread publishes it. Tool schemas remain the source of truth for flags.
Set up structured Records
- Confirm access and discover. Use
arbor profile list, then runarbor --profile NAME whoamiandarbor --profile NAME server info --json. CompareserverVersionwitharbor --version. Use the matching published package, or build the CLI from the server's checkout for a pre-release. With MCP, check the live authenticatedtools/listand refresh the host catalog if it omitsrecordor typed Thread inputs. Find your Topic withtreequery"Space / Topic"or browse withtree --depth spaces. Check write access and existing definitions withrecord definitionsandspaceId. Matchschemas[].topicandviews[].query.topicto the Topic id. - Inventory and organize Threads first. Existing Threads become rows and keep their IDs, conversations and Artifact history. Record their current Topics and the source Artifact versions. Complete intended Thread moves before publishing, because moves into or out of a Topic with a live Schema are blocked. Use Standing lifecycle for directory entries and the Topic's existing workflow Status for progress. Add a custom field only for a separate business attribute.
- Publish a small Schema. Start with a few optional fields and leave unverified values blank. In Topic Details, choose Set up structured data and select an existing source Thread. In the CLI or MCP, create a
docArtifact of typejsonwithsourceThreadIdfor its provenance. A private Topic requires a home Thread in that Topic. Between open Topics, a home Thread can live in the same Space outside the target Topic. A Dashboard needs an open home Topic. If you need a first row, start a real Thread withcreate_thread. The Schema generates itsAll {noun.many}View. Read definitions back before adding optional saved Views or a Dashboard referencing a saved View. - Backfill and verify. Save create receipts by
topicId,threadIdandartifactId. Use the current Schema version and each Thread'sbaseRevisionfor bounded, idempotent field writes. Compare IDs, verified values and history against your inventory. Run the default and saved Views with the intended identity and check Dashboard totals and the matching drill query when present. - Recover and cut over deliberately. After an ambiguous write, reread the Thread, definitions or exact Artifact source before retrying. Replay the original key with the original payload when the caller supports it. For a corrected edit, reconcile against the latest
baseVersionorbaseRevisionand use a new key. Preserve legacy Artifact versions. Archiving a legacy Topic makes its contents read-only. Superseding an Artifact changes its lifecycle and leaves it editable subject to the usual write rules.
Copy-ready sequence
Replace IDs from tree and create receipts. Here the Orders definitions use an existing home Thread.
arbor --profile NAME tree --query "Acme / Orders"
arbor --profile NAME record definitions --space-id spc_…
Replace the placeholder IDs in the Schema JSON below and save it as schema.json.
arbor --profile NAME create artifact --kind doc --type json --title "Orders Schema" --summary "Orders Schema" --source-thread-id thr_… --source-file schema.json
arbor --profile NAME record definitions --space-id spc_…
In MCP, use artifact with verb=create, the same fields, and source. If the Schema exists and its default View is missing, create a View from the current Schema or use Finish Records setup in Topic Details. If you get This Topic already has a Schema Artifact, edit that Artifact with edit artifact or MCP artifact with verb=edit and the latest baseVersion. For a timed-out create without an idempotency key, check the home Thread and exact Artifact source before submitting again.
Working JSON
Replace top_orders, top_accounts and art_retail_orders with live IDs. Dashboard widgets reference a saved View Artifact id, never an inline query.
{
"format": "arbor-records/v1",
"kind": "schema",
"schema": {
"topic": "top_orders",
"label": "Orders",
"noun": {
"one": "Order",
"many": "Orders"
},
"fields": [
{
"key": "quantity",
"label": "Quantity",
"type": "number",
"defaultValue": 1
},
{
"key": "unitPrice",
"label": "Unit price",
"type": "currency",
"currency": "USD"
},
{
"key": "total",
"label": "Total",
"type": "currency",
"currency": "USD",
"readOnly": true,
"formula": "quantity * unitPrice"
},
{
"key": "channel",
"label": "Sales channel",
"type": "select",
"options": [
{
"value": "retail",
"label": "Retail"
},
{
"value": "wholesale",
"label": "Wholesale"
}
]
},
{
"key": "dueDate",
"label": "Due",
"type": "date"
},
{
"key": "daysOverdue",
"label": "Days overdue",
"type": "number",
"readOnly": true,
"formula": "daysBetween(today(), dueDate)"
},
{
"key": "account",
"label": "Account",
"type": "relation",
"relation": {
"topic": "top_accounts"
}
}
]
}
}
{
"format": "arbor-records/v1",
"kind": "view",
"view": {
"name": "Retail orders",
"query": {
"topic": "top_orders",
"filter": [
{
"field": "channel",
"op": "in",
"value": [
"retail"
]
}
],
"sort": [
{
"field": "dueDate",
"dir": "asc"
}
]
},
"mode": "table",
"layouts": {
"table": {
"columns": [
"title",
"status",
"channel",
"total",
"dueDate",
"account"
]
},
"board": {
"groupField": "status",
"cardFields": [
"total",
"dueDate"
]
},
"calendar": {
"dateField": "dueDate"
}
}
}
}
{
"format": "arbor-records/v1",
"kind": "dashboard",
"dashboard": {
"name": "Orders",
"widgets": [
{
"id": "retailCount",
"title": "Retail orders",
"view": "art_retail_orders",
"kind": "stat",
"measure": {
"fn": "count"
}
}
]
}
}
Shape, Status, defaults
- Envelope:
{"format":"arbor-records/v1","kind":"schema"|"view"|"dashboard", …}. Custom field keys are/^[a-z][A-Za-z0-9_]{0,63}$/. Types: text, longText, number, currency, date, datetime, boolean, select, multiselect, person, relation, url. Formula is not a type: a text, number, currency, date, datetime or boolean field withreadOnly: trueandformula. - Built-ins (title, ref, objective, status, assignees, conversation, updated) are injected; do not author them. Status is the Topic workflow, changed only with
transition_thread. Standard labels: backlog, active, needs-review, stuck, standing, resolved, canceled. Custom select options cannot carry lifecycle colors. defaultValueis a static literal applied only to omitted custom fields on new Thread creation. People and relation links cannot have defaults.- For reference Records such as Companies, set
schema.objectiveOptional: trueto allow creation without an objective. Supply an objective when the Thread has work to accomplish. Removing the opt-in applies to new creates and clears. Existing objectives are preserved.
Exact unit rates
Use two editable text fields with decimalScale from 0 to 6. Declare the quantity unit, such as LB, and the corresponding rate unit USD/LB. Send decimal strings, such as "85" and "0.095", in values. Short fractions are padded to the declared scale. Excess digits, exponent notation and negative rates are refused.
Declare the output as currency with currency: "USD", readOnly: true and exactProduct: {"quantity":"quantity","rate":"rate","rounding":"half-away-from-zero"}. The server stores integer cents atomically with each operand change. Omit the derived key from writes. Clearing either operand clears the amount. This policy rounds each Record separately, including signed quantities. Confirm the rounding boundary and authoritative inputs before applying it to billing.
Read rows and run widgets
- Copy
views[].queryfrom definitions to run a saved View. Userecord query --query '…'or MCPrecordwithverb=queryandquery. Passquery.fields: []for built-ins or name the custom keys you need. Use a smallquery.limit(1–100, default 50) and passnextCursorinquery.cursorwith the same filters and basis.totalcounts all matches. - A filter is
{field, op, value}. Useinwith exact strings for title, select, person or relation matches,containsfor text fragments,eq/gt/gte/lt/ltefor numeric or date comparisons,betweenwith two bounds, andempty/setwithout a value for presence. record dashboardslists Dashboards. Run a widget withrecord query --dashboard '…'or MCPrecordwithverb=queryanddashboard. From definitions copy the Dashboardidandversion, thewidgetId,spaceId,referenceDay, andversionskeyed by the source View and Schema Artifact ids. Include comparison and relation-formula dependencies when used. UsesummaryOnly: truefor totals and groups, ordashboard.cursorto page widget rows. Drill with the returnedqueryandbasis.- Widget kinds are
stat,barList,chart,list,table, andprogress. Usegroup: {"field":"channel"}for a sales channel breakdown.
Resolve a relation target
The target must be in the same Space. An open Topic cannot relate into a private Topic. A private Topic may relate to itself or an open Topic. Find the target with tree query "Acme / Accounts", then query the exact Topic id:
{"verb":"query","query":{"topic":"top_accounts","filter":[{"field":"title","op":"in","value":["Example account"]}],"limit":20}}
If titles repeat, inspect candidates before writing. Use the returned Thread id as the relation value and the Topic id in the Schema's relation.topic. An inaccessible target is withheld.
To read incoming links by inverse role, use arbor thread get AXS-6 --backlinks --json or MCP thread_get with backlinks: true. Each role in record.backlinks.roles shows its visible total and up to five source Records. Continue rows by copying that role's query and putting its nextCursor in query.cursor. Continue roles by passing record.backlinks.nextCursor as backlinkCursor (CLI --backlink-cursor).
Import new Records from CSV or JSON
Find the destination with tree using Space / Topic. Copy the top_… id of a writable Topic with an existing Schema. This creates new Threads in that Topic's default active status.
arbor records import ./leads.csv --topic top_leads --map ./mapping.json --dry-run
For a CSV with headers Company,Amount cents,Old export ID,Stage, save this mapping as mapping.json:
{"Company":"title","Amount cents":"budget","Old export ID":null}
Other columns match field keys first, then case-insensitive keys or labels. A populated column with no unique writable match makes the row invalid. Use null in the mapping to deliberately ignore a column. Supply a title and an objective unless the Schema makes objectives optional. Empty cells use Schema defaults. In a JSON array of row objects, omit a key to use its default or send null to leave it empty.
Use select option values, true or false for booleans, integer minor units for currency, YYYY-MM-DD for dates, and existing Thread or Profile IDs for relations or people. Use a JSON array of strings for multiselect and multi-value IDs, including inside a quoted CSV cell. Status, computed, disabled and other read-only fields cannot be imported.
Schema art_leads version 3
"Company" → title
"Amount cents" → budget
"Old export ID" → ignored
"Stage" → stage
Up to 1 would be created (1 invalid). Previously imported rows replay.
Row 2: stage: Use one option value: "warm", "cold".
After preview, remove --dry-run to create Records. Add --schema-artifact-id art_leads --schema-version 3 to require the previewed Schema. Use --json for all row receipts. CLI validates or writes in batches and exits nonzero if any row fails, with the result in data.
Over MCP, call record with verb: "importRows" and up to 10 structured rows. No local path is required. Use dryRun: true to preview, then send the same input with dryRun: false to execute:
{"verb":"importRows","topicId":"top_leads","idempotencyKey":"leads-2026-11","schemaArtifactId":"art_leads","schemaVersion":3,"dryRun":true,"mapping":{"Company":"title"},"rows":[{"Company":"Meyer, Inc.","budget":12550,"Stage":"warm"}]}
Every row commits independently. Keep the import key, actor, Topic and source positions when retrying. For subsequent MCP batches, set offset to the number of preceding source rows. Replay exact rows after response loss, or correct rows confirmed invalid in place. A changed successful row conflicts. The CLI defaults to a key derived from the absolute file path. Set --idempotency-key explicitly to resume from another path or intentionally start a separate import. If the Schema changed after some rows succeeded, reconcile the receipts before importing the remaining rows under the new version.
Write fields and reconcile
Use CLI thread update or MCP thread_update with values, the Schema id and version, a stable idempotencyKey, and baseRevision from revisions[threadId] in a row query or thread.fieldRevision in a Thread read. For a stale revision, reread the row and reconcile the draft before retrying with a new key. For a stale Schema, refresh definitions first.
For record setFieldsMany, pass one field in --values and one JSON array in --items. Check each results[].ok and retry only failed rows after resolving their refusals.
Distinguish edit failures
- Generic Artifact stale-version
409includes authorizedcurrentVersion/currentSource: read, reconcile your draft, then retry with the currentbaseVersion. - Formula-depth
400:validation.invalid_value,field: formula,retryable: false. Simplify or correct the expression; refreshing the Artifact version does not repair it. - Private masked dependency
409intentionally reveals no fields. Do not infer hidden dependencies or expectcurrentSource; resolve access with an authorized owner.
Replay an idempotency key only with its original payload after response loss. A reconciled or corrected payload is a new logical write and needs a new key.
Formulas, dates, limits
- Grammar: stable field keys, one dotted relation hop (
account.arr), literals,(),!/-,+ - * /, comparisons,&&/||. Calls:if,isEmpty,lower,upper,length,concat(2–8),abs,round,date/datetime(quoted ISO),today(),addDays(date, n),daysBetween(a,b),money(n, "USD"). daysBetween(a,b)is a - b in UTC days. Days overdue:daysBetween(today(), dueDate). Days until due:daysBetween(dueDate, today()).- Use integer minor units for currency values, filters and
money(). For USD,money(10000000, "USD")is $100,000. - Dates are
YYYY-MM-DD; datetimes are UTC ISO instants.today()and DashboardreferenceDayare the UTC calendar day. - Save-time limits include 4096-character source, 128 nodes, depth 16, one relation hop, and a database expression-depth ceiling. A currency formula of about four or more arithmetic operators, including operators in referenced formulas, can be refused. Flattening nested arithmetic does not always get around that ceiling; there is no rewrite that always gets around it. Simplify.