AI Fields
Seven field types compute their value with an LLM from one or more sourceFields. All share the base field properties and a common set of AI controls.
| Type | Produces |
|---|---|
ai-generate |
Free-form generated text from a prompt template. |
ai-summary |
A summary of the source fields. |
ai-categorize |
A single category chosen from a predefined list. |
ai-extract |
Structured data matching a JSON Schema. |
ai-sentiment |
Sentiment analysis of the source text. |
ai-tag |
Multiple tags chosen from an allow-list. |
ai-translate |
A translation of one source field into a target language. |
Common AI Properties
Most AI fields accept these shared properties (in addition to their type-specific ones):
| Property | Description |
|---|---|
sourceFields |
Required. Field names used as input context. At least one (exactly one for ai-translate). |
prompt |
Custom prompt to guide the AI. ai-generate uses a {{fieldName}} template; others fall back to a sensible default when omitted. |
systemPrompt |
System prompt setting the AI persona and context. |
model |
AI model override (e.g. gpt-4o, claude-sonnet). Non-empty string. |
temperature |
Output creativity, 0 to 1. |
How a value resolves, and how to tell
An AI field resolves in two tiers. A deterministic value is computed locally and stored straight away, so the record is never left blank; a background refinement then replaces it with the model's answer.
When the refinement never lands, the locally computed value stays. It is plausible, well-formed content that reads exactly like a model result — so on its own, a value gives no clue which tier produced it. That is why every AI value carries a refinement status, and why the grid and the record drawer mark the two states that are not settled:
| Status | Shown |
|---|---|
refined |
Nothing. The model answered; the value stands on its own. |
skipped |
Nothing. Someone edited the value by hand and the refinement declined to overwrite it. |
pending |
A muted … marker labelled Refining — the refinement is still running. |
failed |
A red ! marker labelled Not refined, explaining that the displayed value is the locally computed fallback, quoting the provider's recorded reason, and pointing at the next step: edit the value to set it yourself. |
A settled value is deliberately left unmarked. Marking every value would teach readers to ignore the marker, and a hand-edited value is the reader's own — it needs no warning.
Editing an unrefined value by hand is the supported way out: the edit is kept, and a later refinement will not overwrite it.
Any write that supplies the column with an explicit value records skipped and clears the recorded reason, so the marker goes with it. A write that leaves the column alone leaves its status untouched. The field keeps a status of skipped rather than losing its entry, so a value someone wrote by hand stays distinguishable from one that was never computed at all.
computeOn decides when a field recomputes — ai-generate, ai-summary and ai-sentiment accept create (the default), update, or both; the other four always compute on create — but it has no bearing on this. An edit is respected whatever the setting.
Reading the status over the API
Records from a table with AI fields carry an _aiCompute block alongside fields, keyed by field name:
{
"id": "42",
"fields": { "summary": "Coastal ecosystems face accelerating change." },
"_aiCompute": {
"summary": { "status": "failed", "error": "provider unavailable" }
}
}status is one of pending, refined, failed or skipped; error is present only for failed. The block is omitted entirely for a table that declares no AI field, and for a record that has no status yet — it is never sent as an empty object, so a table that uses no AI costs nothing to read.
ai-generate
Generates free-form text from a prompt template.
| Property | Description |
|---|---|
prompt |
Prompt template with {{fieldName}} variable substitution. (Recommended for generate fields.) |
- id: 1
name: marketing_copy
type: ai-generate
sourceFields: [product_name, features]
prompt: 'Write a compelling 2-paragraph marketing description for {{product_name}}. Key features: {{features}}.'ai-summary
Summarizes the source fields. Uses a default "Summarize the following" prompt when prompt is omitted.
- { id: 2, name: ticket_summary, type: ai-summary, sourceFields: [body, thread] }ai-categorize
Classifies the source into exactly one of a fixed category list.
| Property | Description |
|---|---|
categories |
Required. Predefined categories the AI must choose from. Minimum 2, no duplicates. |
- {
id: 3,
name: ticket_category,
type: ai-categorize,
sourceFields: [subject, body],
categories: [billing, technical, account, general],
}ai-extract
Extracts structured data described by a JSON Schema. Supports nested objects and arrays.
| Property | Description |
|---|---|
schema |
Required. JSON Schema object describing the structure of the extracted data. |
- id: 4
name: invoice_data
type: ai-extract
sourceFields: [raw_text]
schema:
type: object
properties:
vendor_name: { type: string, description: Name of the vendor }
total_amount: { type: number, description: Total amount due }ai-sentiment
Analyzes sentiment of the source text. prompt can adjust the focus (e.g. urgency, satisfaction).
- { id: 5, name: review_sentiment, type: ai-sentiment, sourceFields: [review_text] }ai-tag
Assigns multiple tags from a predefined allow-list.
| Property | Description |
|---|---|
tags |
Required. Allowed tags the AI may assign. Minimum 2, no duplicates. |
maxTags |
Maximum number of tags to assign (positive integer). No limit when omitted. |
- {
id: 6,
name: article_tags,
type: ai-tag,
sourceFields: [title, body],
tags: [technology, business, science, health, politics],
maxTags: 3,
}ai-translate
Translates one source field into a target language.
| Property | Description |
|---|---|
sourceFields |
Required. Exactly one field name. |
targetLanguage |
Required. ISO 639-1 language code, optionally region-suffixed (e.g. fr, es, ja, zh-CN). |
prompt |
Custom prompt to control translation tone, formality, and style. |
- {
id: 7,
name: description_fr,
type: ai-translate,
sourceFields: [description],
targetLanguage: fr,
}AI provider routing. AI fields route through Sovrium's provider-precedence resolver (env-controlled, local-first by default). The optional model property overrides the default model for that field. The connecting role still gates execution wherever the table is exposed via the MCP server.
Last updated August 11, 2026
This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.