Skip to main content

Knowledge Feature Types

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

  1. Define the Type - Create a Knowledge Feature Type (e.g., “Vendor”)
  2. Create Features - Create reusable features of that type (e.g., “Acme Corp”, “Globex Inc”)
  3. Link to Documents - Associate features with documents as they’re processed

Feature Type Structure

FieldPurposeExample
slugUnique identifiervendor
nameDisplay nameVendor
descriptionWhat this feature representsThe vendor that issued this invoice
optionsDefine natural key propertiesvendorId, taxId
extendedOptionsDefine display propertiesdisplayName, 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:
kdx sync 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

  1. Navigate to Knowledge in the sidebar
  2. Click Feature Types
  3. Click Create Feature Type
  4. Fill in the form with name, slug, description
  5. Add options for natural keys
  6. Add extended options for display properties
  7. 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