Options Architecture
The Options system is a foundational feature in Kodexa that enables developers to define flexible, type-safe configuration interfaces throughout the platform. Options provide a declarative way to capture custom information from users while maintaining consistency across all components.What Are Options?
Options are configuration parameters that allow you to:- Capture user input in a structured, validated way
- Define custom properties for components (assistants, models, steps)
- Add configurable fields to taxonomies (data elements)
- Create dynamic form interfaces without writing UI code
- Enable users to configure components directly in the platform UI
The Options Flow
Example: Simple Assistant with Options
Developer defines (in assistant metadata):{'hostname': 'sftp.example.com', 'port': 2222}
Where Are Options Used?
Options appear throughout the Kodexa platform:1. Assistants
Define configuration parameters for assistant behavior:2. Models
Configure inference and training behavior:3. Taxonomies (Data Definitions)
Add custom properties to data elements:4. Actions
Configure executable actions:5. Pipeline Steps
Configure processing steps in pipelines:Core Option Structure
Every option has this basic structure:Required Fields
- name: Unique identifier for the option (used in code to access the value)
- type: Determines which UI control to render and how to validate input
- label: User-facing display name
- description: Help text explaining the purpose and usage
Optional Fields
- required: Boolean indicating if the option must be set (default: false)
- default: Pre-filled value shown to users
- possibleValues: Array of allowed values (for dropdowns/selects)
- showIf: Conditional visibility based on other option values
- developerOnly: Only show to users with developer privileges
- featureFlag: Gate option behind a feature flag
- properties: Additional metadata for option behavior (e.g.,
collapsible: true)
Option Types Overview
Kodexa supports 24+ option types organized into categories:Basic Input Types
- string / text: Single or multi-line text input
- number: Numeric input with optional min/max constraints
- boolean: Checkbox or toggle switch
- select: Dropdown selection from predefined values
Code & Script Types
- code: Full code editor with syntax highlighting
- script: Script input (supports multiple languages)
Platform-Specific Types
- documentStore: Select a document store
- modelStore: Select a model store
- tableStore: Select a data store
- taxonomyStore: Select a taxonomy (data definition)
- document: Search and select a specific document
- workspace: Select a workspace
Taxonomy Types
- taxon: Select a taxonomy element
- taxon_label: Select a taxonomy label
- taxon_with_properties: Select taxonomy + configure properties
- taxon-lookup: Hierarchical taxonomy search
Status & State Types
- documentStatus: Select document status
- attributeStatus: Select attribute status
- taskStatus: Select task status
Advanced Types
- cloud-model: Select cloud-based AI model (with caching)
- cloud-embedding: Select embedding model
- pipeline: Configure entire pipeline
- pipelineModelOptions: Configure multiple models in pipeline
- data-form: Select data form configuration
Display Types
- alert: Display informational message
- article: Embed knowledge base article
Nested Options (Option Groups)
Options can be nested into groups for better organization:Conditional Visibility
UseshowIf to show/hide options based on other values:
showIf field accepts JavaScript expressions evaluated against the current option values.
Possible Values (Constrained Choices)
Limit user input to predefined choices:Developer-Only Options
Hide advanced options from regular users:Accessing Option Values in Code
In Python (Assistants/Models)
In Metadata (Other Components)
Options can reference each other or be used in expressions:Best Practices
1. Provide Clear Labels and Descriptions
2. Use Appropriate Types
3. Set Sensible Defaults
4. Group Related Options
5. Use required Judiciously
Only mark options as required if the component truly cannot function without them.
6. Leverage Conditional Visibility
Keep the UI clean by hiding irrelevant options:How Options Enable Custom Information Capture
The Options system is powerful because it provides declarative configuration:- No UI Code Required: Define options in YAML, get a UI automatically
- Type Safety: Platform validates input based on option type
- Consistency: Same option types look and behave the same everywhere
- Discoverability: Users see configuration options in context
- Versioning: Options are part of component metadata (versioned with the component)
Example: Custom Data Capture
Suppose you’re building a custom invoice extraction model. You want users to configure:- Which fields are required
- Validation rules per field
- Output format preferences
- Build a custom UI
- Handle validation
- Store configuration somewhere
- Pass configuration to your model code
Next Steps
- Working with Options: Complete reference of all option types
- Advanced Options Features: Deep dive into grouping, conditionals, and complex patterns
- Defining an Assistant: See options in action for assistants
Summary
The Options system is Kodexa’s declarative configuration language. By defining options in metadata, you:- Enable users to configure your components without code changes
- Provide a consistent, validated configuration experience
- Capture custom information tailored to your use case
- Keep configuration co-located with component definitions
