Documentation Index
Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt
Use this file to discover all available pages before exploring further.
A Knowledge Feature Type is a template that defines a category of metadata you want to capture and track across documents. Once defined, you create reusable Knowledge Features of that type, which can be linked to multiple documents.
When Do You Need Feature Types?
Create a Knowledge Feature Type when you want to:
- Track which vendor invoices came from
- Classify documents by type (10K, 10Q, Contract, etc.)
- Identify document language
- Group documents by customer, region, or business unit
How Feature Types Work
- Define the Type - Create a Knowledge Feature Type (e.g., “Vendor”)
- Create Features - Create reusable features of that type (e.g., “Acme Corp”, “Globex Inc”)
- Link to Documents - Associate features with documents as they’re processed
Feature Type Structure
| Field | Purpose | Example |
|---|
slug | Unique identifier | vendor |
name | Display name | Vendor |
description | What this feature represents | The vendor that issued this invoice |
options | Define natural key properties | vendorId, taxId |
extendedOptions | Define display properties | displayName, address |
Options vs Extended Options
Options define the natural key - the unique identifier for each feature:
options:
- name: vendorId
type: string
label: Vendor ID
description: Unique identifier for this vendor
Extended Options define presentation properties - additional info for display:
extendedOptions:
- name: displayName
type: string
label: Display Name
description: Human-readable vendor name
- name: address
type: string
label: Address
When you create a feature, the options values become properties (the key), and extendedOptions values become extendedProperties (for display).
Creating a Feature Type
Via YAML (GitOps)
Create a file in kodexa-resources/knowledge-feature-types/:
# kodexa-resources/knowledge-feature-types/vendor.yaml
slug: vendor
name: Vendor
description: Tracks the vendor associated with invoice documents
active: true
options:
- name: vendorId
type: string
label: Vendor ID
description: Unique identifier for this vendor
required: true
extendedOptions:
- name: displayName
type: string
label: Display Name
description: Human-readable vendor name
- name: website
type: string
label: Website
Add to your manifest:
# manifests/main.yaml
resources:
knowledge-feature-types:
- vendor
Deploy:
Via API
curl -X POST "https://platform.kodexa.ai/api/knowledgeFeatureTypes" \
-H "Authorization: Bearer $KODEXA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "vendor",
"name": "Vendor",
"description": "Tracks the vendor associated with invoice documents",
"active": true,
"options": [
{
"name": "vendorId",
"type": "string",
"label": "Vendor ID",
"required": true
}
],
"extendedOptions": [
{
"name": "displayName",
"type": "string",
"label": "Display Name"
}
]
}'
Via Kodexa UI
- Navigate to Knowledge in the sidebar
- Click Feature Types
- Click Create Feature Type
- Fill in the form with name, slug, description
- Add options for natural keys
- Add extended options for display properties
- Save
Creating Features
Once you have a Feature Type, create features of that type:
Via YAML
# Creating a feature instance
featureType: vendor
properties:
vendorId: "V001"
extendedProperties:
displayName: "Acme Corporation"
website: "https://acme.com"
active: true
Via API
curl -X POST "https://platform.kodexa.ai/api/knowledgeFeatures" \
-H "Authorization: Bearer $KODEXA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"featureTypeSlug": "vendor",
"properties": {
"vendorId": "V001"
},
"extendedProperties": {
"displayName": "Acme Corporation",
"website": "https://acme.com"
},
"active": true
}'
Linking Features to Documents
Features are linked to document families. See the Document Families API for details on attaching features during processing.
Common Feature Type Examples
Document Type Classification
slug: document-type
name: Document Type
description: Classification of document (10K, 10Q, Contract, etc.)
options:
- name: typeCode
type: string
label: Type Code
required: true
extendedOptions:
- name: typeName
type: string
label: Type Name
- name: category
type: string
label: Category
Language Detection
slug: language
name: Language
description: Primary language of the document
options:
- name: isoCode
type: string
label: ISO Language Code
required: true
extendedOptions:
- name: languageName
type: string
label: Language Name
Customer Identification
slug: customer
name: Customer
description: Customer associated with this document
options:
- name: customerId
type: string
label: Customer ID
required: true
extendedOptions:
- name: customerName
type: string
label: Customer Name
- name: region
type: string
label: Region
Next Steps