AgentDBDocs

Field types

Every field has a type. AgentDB checks each value against it on write.

Define fields with schema_define_field. Change a type later with schema_update_field when every value converts.

TypeValue you writeOptionsQuery operatorsUnique
textA string up to 10,000 characters.–eq neq in lt lte gt gte is_null is_not_null contains starts_withyes
integerA safe integer.–eq neq in lt lte gt gte is_null is_not_nullyes
booleantrue or false.–eq neq is_null is_not_null
date"YYYY-MM-DD".–eq neq in lt lte gt gte is_null is_not_nullyes
datetimeRFC 3339 with an offset. Stored in UTC.–eq neq in lt lte gt gte is_null is_not_nullyes
enumOne of enum_values.enum_values (required)eq neq in is_null is_not_null
numberA finite JSON number.–eq neq in lt lte gt gte is_null is_not_null
decimalString "12.50" (or a JSON number without exponent). Exact.scale 0–12, default 2eq neq in lt lte gt gte is_null is_not_nullyes
currency{"amount": "12.50", "currency": "EUR"}. Exact amounts; use for money.scale, currencies (allowed codes)eq neq in lt lte gt gte is_null is_not_null
time"HH:MM" or "HH:MM:SS" (24 h).–eq neq in lt lte gt gte is_null is_not_nullyes
timezoneAn IANA time zone name, such as Europe/Amsterdam.–eq neq in is_null is_not_null
durationWhole seconds, or ISO 8601 PnWnDTnHnMnS.–eq neq in lt lte gt gte is_null is_not_null
multi_selectAn array of strings (tags).enum_values (optional closed set), max_itemscontains has_any has_all is_null is_not_null
listAn array of item_type values. Order and duplicates are kept.item_type (required), max_items, scalecontains has_any has_all is_null is_not_null
jsonA JSON object (max depth 8, max 32 KB).–is_null is_not_null
emailAn email address. Stored trimmed and in lower case.–eq neq in lt lte gt gte is_null is_not_null contains starts_withyes
urlAn absolute http(s) URL, up to 2048 characters.–eq neq in lt lte gt gte is_null is_not_null contains starts_withyes
phoneAn international number with + and country code. Stored as E.164 (+31201234567).–eq neq in lt lte gt gte is_null is_not_null contains starts_withyes
addressObject with line1, line2, line3, city, region, postal_code, country (ISO 3166-1 alpha-2).–is_null is_not_null
geo{"lat": -90..90, "lon": -180..180}.–within_bbox near is_null is_not_null
rich_textMarkdown, up to 50,000 characters. No HTML.–contains starts_with is_null is_not_null
formulaComputed from other fields; you do not write it.expression (required), result_type number, text or booleaneq neq in lt lte gt gte is_null is_not_null
statusOne of enum_values, with optional allowed transitions.enum_values (required), transitions, initialeq neq in is_null is_not_null
user_refAn account id acc_… of a person in this workspace.–eq neq in is_null is_not_null
agent_refAn agent id agt_… of this workspace.–eq neq in is_null is_not_null
fileA file id fil_…, or with multiple a list of 1–100 ids. The files are attached to the record.multipleeq neq in has is_null is_not_null
recurrenceAn RFC 5545 RRULE string such as FREQ=WEEKLY;BYDAY=MO.–eq neq is_null is_not_null

Unique: the field can be unique on its own. Composite unique keys (schema_define_unique_key) also take boolean, enum, timezone, status fields.

Totals by date: records_aggregate groups dates by hour, day, week, month, year.