Data Types
ABL has a type system used for variable declarations, gather field types, tool parameter signatures, and runtime validation. Types are divided into primitives and complex types.Primitive types
Primitive types represent single scalar values.| Type | Description | Example values |
|---|---|---|
string | Unicode text of arbitrary length. | "hello", "USD", "" |
number | IEEE 754 double-precision floating point. | 42, 3.14, -1, 0 |
boolean | True or false. | true, false |
date | Calendar date without time. | "2024-03-15" |
datetime | Date with time and timezone. | "2024-03-15T10:30:00Z" |
String
Strings are the most common type in ABL. They are used for text input, identifiers, messages, and any unstructured data.Number
Numbers represent all numeric values, including integers and floating-point numbers. ABL does not distinguish between integer and float types.Boolean
Booleans represent true/false values. In conditions, the following values are treated as falsy:false, 0, "", "false", null, undefined, empty arrays, and empty objects. Everything else is truthy.
Date
Dates represent calendar dates without a time component. They are stored as ISO 8601 date strings (YYYY-MM-DD).
Datetime
Datetimes include both date and time with timezone information. They are stored as ISO 8601 datetime strings.Complex types
Complex types represent structured or composite values.array<T>
An ordered collection of elements, optionally typed by item type.Array type definition (IR)
| Property | Type | Description |
|---|---|---|
kind | 'array' | Discriminant for array type. |
itemType | TypeDefinition | Type of each element in the array. |
object <{...}>
A structured record with named, typed fields.
Object type definition (IR)
| Property | Type | Description |
|---|---|---|
kind | 'object' | Discriminant for object type. |
properties | Record<string, TypeDefinition> | Map of field names to their types. |
enum<[…]>
A constrained set of allowed string values.Enum type definition (IR)
| Property | Type | Description |
|---|---|---|
kind | 'enum' | Discriminant for enum type. |
values | string[] | Allowed values. |
union<[…]>
A value that can be one of several types. Useful for fields that accept different formats.Union type definition (IR)
| Property | Type | Description |
|---|---|---|
kind | 'union' | Discriminant for union type. |
types | TypeDefinition[] | Possible types for the value. |
nullable<T>
Wraps another type to indicate it can also benull.
Nullable type definition (IR)
| Property | Type | Description |
|---|---|---|
kind | 'nullable' | Discriminant for nullable type. |
innerType | TypeDefinition | The underlying type that can also be null. |
Type definitions in ABL contexts
Variable declarations
InMEMORY: session and persistent variable declarations, use the TYPE property:
Gather fields
Gather fields use thetype property with primitive type names:
Tool parameters
Tool parameters declare types inline in the signature:| Type | Description |
|---|---|
string | Text parameter. |
number | Numeric parameter. |
boolean | Boolean parameter. |
date | Date parameter. |
datetime | Datetime parameter. |
object | Structured object. |
string[] | Array of strings. |
number[] | Array of numbers. |
Tool return types
Tool return types use object literal notation with field names and types:ToolReturn structure supports nested objects and arrays:
| Property | Type | Description |
|---|---|---|
type | string | Type name (string, number, object, etc.). |
fields | Record<string, ToolReturn> | Sub-fields (for object type). |
items | ToolReturn | Item type (for array types). |
optional | boolean | Whether this field is optional in the response. |
Variable sources
Variables in ABL have a source that indicates their origin:| Source | Description |
|---|---|
system | Set by the runtime (e.g., session ID, timestamp). |
user | Set by user input (gather fields, direct input). |
agent | Set by agent logic (SET assignments, tool results). |
computed | Derived from other variables via expressions. |
Type coercion at runtime
The runtime applies type coercion in these contexts:| Context | Behavior |
|---|---|
| Comparison | Strings are parsed to numbers for numeric comparisons. Booleans become 0/1. |
| Assignment | Values are stored as-is. No implicit conversion on write. |
| Function calls | Math functions coerce string arguments to numbers. String functions coerce null to "". |
| Tool parameters | Values are coerced to match the declared parameter type before sending. |
| Gather validation | User input is validated and coerced to the declared gather field type. |
Complete TypeDefinition reference
The fullTypeDefinition type is a union of primitive type names and complex type objects:
Lookup Tables
Lookup tables provide reference-based validation for gather fields and expressions. They define sets of valid values that the runtime uses to validate user input, suggest corrections, and perform fuzzy matching. TheLOOKUP_TABLES: block declares named tables with their data source and matching configuration.
Overview
ABL supports three lookup table sources:- Inline — static values defined directly in the ABL file.
- Collection — values stored in a tenant-scoped database collection.
- API — values fetched from an external HTTP endpoint.
Inline lookup tables
Inline tables define their values directly in the ABL file. Use them for small, stable reference sets.Syntax
When to use inline tables
- The value set is small (fewer than ~100 entries).
- The values rarely change.
- No external dependency is acceptable.
Collection lookup tables
Collection tables read values from a tenant-scoped database collection. The platform resolves thetable_name to the correct storage location based on the current tenant.
Syntax
When to use collection tables
- The value set is large or changes frequently.
- Values are managed through an admin interface or data pipeline.
- Different tenants have different valid values.
API lookup tables
API tables fetch values from an external HTTP endpoint at runtime. The response is expected to contain an array of objects; thefield property specifies which object field to match against.
Syntax
When to use API tables
- Values come from a third-party system that maintains its own data.
- Real-time accuracy is important (e.g., live exchange rates, inventory).
- The dataset is too large to store locally.
Lookup table properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | Yes | — | Data source type: inline, collection, or api. |
values | string[] | No | — | Static values (required for source: inline). |
table_name | string | No | — | Logical table name (required for source: collection). |
endpoint | string | No | — | HTTP endpoint URL (required for source: api). |
field | string | No | — | Field within the data source to match against. |
timeout_ms | number | No | 5000 | Request timeout in milliseconds (for source: api). |
case_sensitive | boolean | Yes | — | Whether matching is case-sensitive. |
fuzzy_match | boolean | Yes | — | Whether fuzzy (approximate) matching is enabled. |
fuzzy_threshold | number | No | 0.85 | Minimum similarity score (0.0—1.0) for fuzzy matches to be accepted. |
Fuzzy matching
Whenfuzzy_match: true, the runtime uses string similarity algorithms to find the closest match when an exact match is not found. This handles typos, abbreviations, and minor variations.
Similarity threshold
Thefuzzy_threshold controls how similar a user’s input must be to a valid value for the match to be accepted:
| Threshold | Behavior |
|---|---|
0.95 | Very strict. Only near-exact matches accepted. |
0.85 | Default. Tolerates minor typos and abbreviations. |
0.75 | Lenient. Accepts more variation but increases false positive risk. |
0.50 | Very lenient. Useful for short strings where small edits are significant. |
Example: fuzzy matching for airport codes
"jfk"matchesJFK(case-insensitive exact match)."SFP"matchesSFO(fuzzy match, 1 character difference)."XYZ"doesn’t match any value (below threshold).
Field mapping
Thefield property specifies which field in the data source to match with. For collection and API sources, the data is typically an array of objects. The field tells the runtime which property to compare:
code field of each object in the response.
Using lookup tables in validation
Reference a lookup table in a gather field’svalidate property:
lookup(table_name) function validates the user’s input against the named lookup table, applying the table’s matching configuration (case sensitivity, fuzzy matching, threshold).
Timeout and error handling
For API-sourced tables, specify atimeout_ms to control how long the runtime waits for the external service:
- Logs a warning.
- Falls back to accepting the user’s input without validation.
- Emits a trace event indicating the lookup failure.
Attachments
Attachments define file and media upload fields that the agent collects from the user. TheATTACHMENTS: block declares named attachment fields with their content category, processing options, and validation constraints. Attachments work alongside GATHER fields to collect structured data through conversation.
Overview
ABL supports four attachment categories, each with specialized processing capabilities:| Category | Use cases | Processing features |
|---|---|---|
document | PDFs, Word docs, spreadsheets, text files | OCR, text extraction |
image | Photos, screenshots, scanned documents | OCR, image analysis |
audio | Voice recordings, audio messages | Transcription |
video | Screen recordings, instructional clips | Keyframe extraction, transcription |
Attachment field properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Unique identifier for the attachment field (the YAML key). |
prompt | string | Yes | — | Message displayed to the user when requesting the upload. |
category | string | Yes | — | Content category: document, image, audio, or video. |
required | boolean | Yes | — | Whether the attachment is mandatory. |
max_file_size_mb | number | No | — | Maximum file size in megabytes. |
allowed_mime_types | string[] | No | — | Allowed MIME types. If omitted, all types for the category are accepted. |
ocr_enabled | boolean | No | false | Enable OCR text extraction for document and image categories. |
transcription_enabled | boolean | No | false | Enable audio transcription for audio and video categories. |
key_frame_extraction | boolean | No | false | Enable keyframe extraction for video category. |
Document attachments
Document attachments handle file uploads such as PDFs, Word documents, spreadsheets, and plain text files. When OCR is enabled, the runtime extracts text content from the uploaded document and makes it available in the session context.Common document MIME types
| MIME type | Description |
|---|---|
application/pdf | PDF documents |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | Word (.docx) |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Excel (.xlsx) |
text/plain | Plain text |
text/csv | CSV files |
Image attachments
Image attachments handle photo and screenshot uploads. OCR extracts text from images (useful for scanned documents, receipts, and ID cards).Common image MIME types
| MIME type | Description |
|---|---|
image/jpeg | JPEG images |
image/png | PNG images |
image/webp | WebP images |
image/heic | HEIC images (iOS) |
image/gif | GIF images |
image/tiff | TIFF images |
Audio attachments
Audio attachments handle voice recordings and audio messages. When transcription is enabled, the runtime converts the audio to text.Common audio MIME types
| MIME type | Description |
|---|---|
audio/mpeg | MP3 files |
audio/wav | WAV files |
audio/ogg | OGG audio |
audio/webm | WebM audio |
audio/mp4 | AAC/M4A files |
Video attachments
Video attachments handle video file uploads. Two processing features are available:- Transcription extracts speech from the video’s audio track.
- Keyframe extraction captures representative frames from the video for visual analysis.
Common video MIME types
| MIME type | Description |
|---|---|
video/mp4 | MP4 video |
video/webm | WebM video |
video/quicktime | QuickTime (MOV) |
OCR processing
Whenocr_enabled: true, the runtime processes uploaded documents and images through an OCR pipeline that:
- Detects text regions in the file.
- Extracts text content.
- Stores the extracted text in the session context under the attachment field name.
Transcription processing
Whentranscription_enabled: true, the runtime processes audio and video files through a transcription pipeline:
- Extracts the audio track (for video files).
- Runs speech-to-text transcription.
- Stores the transcript in the session context.
Keyframe extraction
Whenkey_frame_extraction: true, the runtime extracts representative frames from video files:
- Analyzes the video for scene changes.
- Captures keyframes at scene boundaries.
- Stores the keyframes as an array of image references.
File size and MIME type validation
The runtime validates uploaded files against the declared constraints before processing:- If the file exceeds
max_file_size_mb, the upload is rejected with an error message. - If the file’s MIME type is not in
allowed_mime_types, the upload is rejected. - If
allowed_mime_typesis omitted, all standard MIME types for the category are accepted.
Complete attachment example
Related pages
- Expressions & functions — type coercion in expressions and built-in type-checking functions
- Memory & Constraints — TYPE declarations in session and persistent variables, attachment data in session
- GATHER — gather field types and lookup-based validation
- NLU — entity extraction that may reference lookup tables