Skip to main content

Documentation Index

Fetch the complete documentation index at: https://koreai-v2-agent-platform-dev.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This page documents the ABL type system, lookup tables for reference-based validation, and attachment handling for file and media uploads.

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.
TypeDescriptionExample values
stringUnicode text of arbitrary length."hello", "USD", ""
numberIEEE 754 double-precision floating point.42, 3.14, -1, 0
booleanTrue or false.true, false
dateCalendar date without time."2024-03-15"
datetimeDate 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.
GATHER:
  customer_name:
    prompt: "What is your name?"
    type: string
    required: true

Number

Numbers represent all numeric values, including integers and floating-point numbers. ABL does not distinguish between integer and float types.
GATHER:
  amount:
    prompt: "How much would you like to transfer?"
    type: number
    required: true
    validate: min(1)

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.
MEMORY:
  session:
    - customer_verified
      TYPE: boolean
      INITIAL: false

Date

Dates represent calendar dates without a time component. They are stored as ISO 8601 date strings (YYYY-MM-DD).
GATHER:
  departure_date:
    prompt: "When would you like to depart?"
    type: date
    required: true

Datetime

Datetimes include both date and time with timezone information. They are stored as ISO 8601 datetime strings.
MEMORY:
  session:
    - session_start_time
      TYPE: datetime
      INITIAL: NOW()

Complex types

Complex types represent structured or composite values.

array<T>

An ordered collection of elements, optionally typed by item type.
# In type definitions
type: array<string>          # Array of strings
type: array<number>          # Array of numbers
type: array<object>          # Array of objects
In memory declarations:
MEMORY:
  session:
    - cart_items
      TYPE: array
      INITIAL: []
Array type definition (IR)
{ kind: 'array', itemType: TypeDefinition }
PropertyTypeDescription
kind'array'Discriminant for array type.
itemTypeTypeDefinitionType of each element in the array.

object <{...}>

A structured record with named, typed fields.
# In type definitions
type: object<{name: string, age: number, active: boolean}>
In tool return types:
TOOLS:
  get_user(id: string) -> {name: string, email: string, role: string}
Object type definition (IR)
{ kind: 'object', properties: Record<string, TypeDefinition> }
PropertyTypeDescription
kind'object'Discriminant for object type.
propertiesRecord<string, TypeDefinition>Map of field names to their types.

enum<[…]>

A constrained set of allowed string values.
GATHER:
  transfer_type:
    prompt: "Is this domestic or international?"
    type: string
    validate: enum(domestic, international)
Enum type definition (IR)
{ kind: 'enum', values: string[] }
PropertyTypeDescription
kind'enum'Discriminant for enum type.
valuesstring[]Allowed values.

union<[…]>

A value that can be one of several types. Useful for fields that accept different formats.
# In type definitions
type: union<[string, number]>    # Either a string or a number
Union type definition (IR)
{ kind: 'union', types: TypeDefinition[] }
PropertyTypeDescription
kind'union'Discriminant for union type.
typesTypeDefinition[]Possible types for the value.

nullable<T>

Wraps another type to indicate it can also be null.
# In type definitions
type: nullable<string>           # String or null
type: nullable<number>           # Number or null
Nullable type definition (IR)
{ kind: 'nullable', innerType: TypeDefinition }
PropertyTypeDescription
kind'nullable'Discriminant for nullable type.
innerTypeTypeDefinitionThe underlying type that can also be null.

Type definitions in ABL contexts

Variable declarations

In MEMORY: session and persistent variable declarations, use the TYPE property:
MEMORY:
  session:
    - order_total
      TYPE: number
      INITIAL: 0
    - items
      TYPE: array
    - customer_profile
      TYPE: object

Gather fields

Gather fields use the type property with primitive type names:
GATHER:
  name:
    prompt: "What is your name?"
    type: string
    required: true
  age:
    prompt: "How old are you?"
    type: number
    required: true
  departure_date:
    prompt: "When do you depart?"
    type: date
    required: true

Tool parameters

Tool parameters declare types inline in the signature:
TOOLS:
  search_flights(origin: string, destination: string, date: date, passengers: number) -> {flights: {id: string, price: number, departure: datetime}[], total: number}
Supported parameter types:
TypeDescription
stringText parameter.
numberNumeric parameter.
booleanBoolean parameter.
dateDate parameter.
datetimeDatetime parameter.
objectStructured object.
string[]Array of strings.
number[]Array of numbers.

Tool return types

Tool return types use object literal notation with field names and types:
-> {field1: type1, field2: type2, nested: {sub_field: type3}[]}
The ToolReturn structure supports nested objects and arrays:
PropertyTypeDescription
typestringType name (string, number, object, etc.).
fieldsRecord<string, ToolReturn>Sub-fields (for object type).
itemsToolReturnItem type (for array types).
optionalbooleanWhether this field is optional in the response.

Variable sources

Variables in ABL have a source that indicates their origin:
SourceDescription
systemSet by the runtime (e.g., session ID, timestamp).
userSet by user input (gather fields, direct input).
agentSet by agent logic (SET assignments, tool results).
computedDerived from other variables via expressions.
STATE:
  user:
    language:
      type: string
      source: user
  system:
    session_id:
      type: string
      source: system

Type coercion at runtime

The runtime applies type coercion in these contexts:
ContextBehavior
ComparisonStrings are parsed to numbers for numeric comparisons. Booleans become 0/1.
AssignmentValues are stored as-is. No implicit conversion on write.
Function callsMath functions coerce string arguments to numbers. String functions coerce null to "".
Tool parametersValues are coerced to match the declared parameter type before sending.
Gather validationUser input is validated and coerced to the declared gather field type.
For detailed coercion rules in expression evaluation, see Expressions & functions — Type coercion rules.

Complete TypeDefinition reference

The full TypeDefinition type is a union of primitive type names and complex type objects:
TypeDefinition =
  | 'string'
  | 'number'
  | 'boolean'
  | 'date'
  | 'datetime'
  | { kind: 'array', itemType: TypeDefinition }
  | { kind: 'object', properties: Record<string, TypeDefinition> }
  | { kind: 'enum', values: string[] }
  | { kind: 'union', types: TypeDefinition[] }
  | { kind: 'nullable', innerType: TypeDefinition }

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. The LOOKUP_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.
LOOKUP_TABLES:
  airport_codes:
    source: inline
    values: [JFK, LAX, ORD, SFO, MIA, ATL, DFW, SEA]
    case_sensitive: false
    fuzzy_match: true
    fuzzy_threshold: 0.85

  hotel_chains:
    source: collection
    table_name: "hotel_chains"
    field: "name"
    case_sensitive: false
    fuzzy_match: true
    fuzzy_threshold: 0.8

  currency_codes:
    source: api
    endpoint: "https://api.reference.com/v1/currencies"
    field: "code"
    timeout_ms: 5000
    case_sensitive: true
    fuzzy_match: false

Inline lookup tables

Inline tables define their values directly in the ABL file. Use them for small, stable reference sets.

Syntax

LOOKUP_TABLES:
  transfer_types:
    source: inline
    values: [domestic, international]
    case_sensitive: false
    fuzzy_match: false

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 the table_name to the correct storage location based on the current tenant.

Syntax

LOOKUP_TABLES:
  product_catalog:
    source: collection
    table_name: "products"
    field: "product_name"
    case_sensitive: false
    fuzzy_match: true
    fuzzy_threshold: 0.85

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; the field property specifies which object field to match against.

Syntax

LOOKUP_TABLES:
  exchange_rates:
    source: api
    endpoint: "https://api.rates.example.com/v1/currencies"
    field: "currency_code"
    timeout_ms: 3000
    case_sensitive: true
    fuzzy_match: false

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

PropertyTypeRequiredDefaultDescription
sourcestringYesData source type: inline, collection, or api.
valuesstring[]NoStatic values (required for source: inline).
table_namestringNoLogical table name (required for source: collection).
endpointstringNoHTTP endpoint URL (required for source: api).
fieldstringNoField within the data source to match against.
timeout_msnumberNo5000Request timeout in milliseconds (for source: api).
case_sensitivebooleanYesWhether matching is case-sensitive.
fuzzy_matchbooleanYesWhether fuzzy (approximate) matching is enabled.
fuzzy_thresholdnumberNo0.85Minimum similarity score (0.0—1.0) for fuzzy matches to be accepted.

Fuzzy matching

When fuzzy_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

The fuzzy_threshold controls how similar a user’s input must be to a valid value for the match to be accepted:
ThresholdBehavior
0.95Very strict. Only near-exact matches accepted.
0.85Default. Tolerates minor typos and abbreviations.
0.75Lenient. Accepts more variation but increases false positive risk.
0.50Very lenient. Useful for short strings where small edits are significant.

Example: fuzzy matching for airport codes

LOOKUP_TABLES:
  airports:
    source: inline
    values: [JFK, LAX, ORD, SFO, MIA, ATL, DFW, SEA]
    case_sensitive: false
    fuzzy_match: true
    fuzzy_threshold: 0.8
With this configuration:
  • "jfk" matches JFK (case-insensitive exact match).
  • "SFP" matches SFO (fuzzy match, 1 character difference).
  • "XYZ" does not match any value (below threshold).

Field mapping

The field property specifies which field in the data source to match against. For collection and API sources, the data is typically an array of objects. The field tells the runtime which property to compare:
# Given API response: [{"code": "USD", "name": "US Dollar"}, {"code": "EUR", "name": "Euro"}]
LOOKUP_TABLES:
  currencies:
    source: api
    endpoint: "https://api.reference.com/v1/currencies"
    field: "code"
    case_sensitive: true
    fuzzy_match: false
User input is matched against the code field of each object in the response.

Using lookup tables in validation

Reference a lookup table in a gather field’s validate property:
GATHER:
  destination_airport:
    prompt: "What's your destination airport code?"
    type: string
    required: true
    validate: lookup(airports)
The 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 a timeout_ms to control how long the runtime waits for the external service:
LOOKUP_TABLES:
  products:
    source: api
    endpoint: "https://catalog.internal/api/v1/products"
    field: "sku"
    timeout_ms: 3000
    case_sensitive: true
    fuzzy_match: false
If the API call times out or returns an error, the runtime:
  1. Logs a warning.
  2. Falls back to accepting the user’s input without validation.
  3. Emits a trace event indicating the lookup failure.

Attachments

Attachments define file and media upload fields that the agent collects from the user. The ATTACHMENTS: 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:
CategoryUse casesProcessing features
documentPDFs, Word docs, spreadsheets, text filesOCR, text extraction
imagePhotos, screenshots, scanned documentsOCR, image analysis
audioVoice recordings, audio messagesTranscription
videoScreen recordings, instructional clipsKeyframe extraction, transcription
ATTACHMENTS:
  id_document:
    prompt: "Please upload a photo of your government-issued ID."
    category: image
    required: true
    max_file_size_mb: 10
    allowed_mime_types: [image/jpeg, image/png, image/webp]
    ocr_enabled: true

  supporting_docs:
    prompt: "Upload any supporting documents (invoices, contracts, etc.)."
    category: document
    required: false
    max_file_size_mb: 25
    allowed_mime_types: [application/pdf, image/jpeg, image/png]
    ocr_enabled: true

Attachment field properties

PropertyTypeRequiredDefaultDescription
namestringYesUnique identifier for the attachment field (the YAML key).
promptstringYesMessage displayed to the user when requesting the upload.
categorystringYesContent category: document, image, audio, or video.
requiredbooleanYesWhether the attachment is mandatory.
max_file_size_mbnumberNoMaximum file size in megabytes.
allowed_mime_typesstring[]NoAllowed MIME types. If omitted, all types for the category are accepted.
ocr_enabledbooleanNofalseEnable OCR text extraction for document and image categories.
transcription_enabledbooleanNofalseEnable audio transcription for audio and video categories.
key_frame_extractionbooleanNofalseEnable 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.
ATTACHMENTS:
  bank_statement:
    prompt: "Please upload your most recent bank statement."
    category: document
    required: true
    max_file_size_mb: 25
    allowed_mime_types: [application/pdf]
    ocr_enabled: true

Common document MIME types

MIME typeDescription
application/pdfPDF documents
application/vnd.openxmlformats-officedocument.wordprocessingml.documentWord (.docx)
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel (.xlsx)
text/plainPlain text
text/csvCSV files

Image attachments

Image attachments handle photo and screenshot uploads. OCR extracts text from images (useful for scanned documents, receipts, and ID cards).
ATTACHMENTS:
  receipt_photo:
    prompt: "Take a photo of your receipt or upload an image."
    category: image
    required: true
    max_file_size_mb: 10
    allowed_mime_types: [image/jpeg, image/png, image/webp, image/heic]
    ocr_enabled: true

Common image MIME types

MIME typeDescription
image/jpegJPEG images
image/pngPNG images
image/webpWebP images
image/heicHEIC images (iOS)
image/gifGIF images
image/tiffTIFF images

Audio attachments

Audio attachments handle voice recordings and audio messages. When transcription is enabled, the runtime converts the audio to text.
ATTACHMENTS:
  voice_message:
    prompt: "Record or upload a voice message describing the issue."
    category: audio
    required: false
    max_file_size_mb: 50
    allowed_mime_types: [audio/mpeg, audio/wav, audio/ogg, audio/webm]
    transcription_enabled: true

Common audio MIME types

MIME typeDescription
audio/mpegMP3 files
audio/wavWAV files
audio/oggOGG audio
audio/webmWebM audio
audio/mp4AAC/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.
ATTACHMENTS:
  screen_recording:
    prompt: "Upload a screen recording showing the issue."
    category: video
    required: false
    max_file_size_mb: 100
    allowed_mime_types: [video/mp4, video/webm, video/quicktime]
    transcription_enabled: true
    key_frame_extraction: true

Common video MIME types

MIME typeDescription
video/mp4MP4 video
video/webmWebM video
video/quicktimeQuickTime (MOV)

OCR processing

When ocr_enabled: true, the runtime processes uploaded documents and images through an OCR pipeline that:
  1. Detects text regions in the file.
  2. Extracts text content.
  3. Stores the extracted text in the session context under the attachment field name.
The extracted text is accessible in expressions and template strings:
# After OCR, the text is available as the attachment field name
SET:
  id_text = id_document.extracted_text

Transcription processing

When transcription_enabled: true, the runtime processes audio and video files through a transcription pipeline:
  1. Extracts the audio track (for video files).
  2. Runs speech-to-text transcription.
  3. Stores the transcript in the session context.
SET:
  message_text = voice_message.transcript

Keyframe extraction

When key_frame_extraction: true, the runtime extracts representative frames from video files:
  1. Analyzes the video for scene changes.
  2. Captures keyframes at scene boundaries.
  3. Stores the keyframes as an array of image references.
SET:
  frames = screen_recording.keyframes

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_types is omitted, all standard MIME types for the category are accepted.

Complete attachment example

ATTACHMENTS:
  government_id:
    prompt: "Please upload a clear photo of your government-issued ID (passport, driver's license, or national ID card)."
    category: image
    required: true
    max_file_size_mb: 10
    allowed_mime_types: [image/jpeg, image/png, image/webp]
    ocr_enabled: true

  proof_of_address:
    prompt: "Upload a utility bill or bank statement from the last 3 months as proof of address."
    category: document
    required: true
    max_file_size_mb: 25
    allowed_mime_types: [application/pdf, image/jpeg, image/png]
    ocr_enabled: true

  voice_authorization:
    prompt: "Record a voice message stating: 'I authorize this wire transfer of {{amount}} {{currency}} to {{beneficiary_name}}.'"
    category: audio
    required: false
    max_file_size_mb: 10
    allowed_mime_types: [audio/mpeg, audio/wav, audio/webm]
    transcription_enabled: true

  • 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