Skip to main content
This guide walks through a complete example: using different extraction prompts for SEC 10K vs 10Q filings. The same pattern applies to any scenario where you need different processing for different document types.

The Goal

When processing SEC filings:
  • 10K documents should use prompts optimized for annual reports
  • 10Q documents should use prompts optimized for quarterly reports

What You’ll Create

Step 1: Create the Feature Type

First, define a Feature Type to classify documents by their SEC filing type.

Via YAML

Via UI

  1. Go to Knowledge > Feature Types
  2. Click Create Feature Type
  3. Enter:
    • Slug: sec-filing-type
    • Name: SEC Filing Type
    • Description: Classification of SEC filing documents
  4. Add option: filingType (string, required)
  5. Add extended option: filingName (string)
  6. Save

Step 2: Create Features

Create features for each filing type you want to handle.

Via YAML

Via UI

  1. Go to Knowledge > Features
  2. Click Create Feature
  3. Select Feature Type: SEC Filing Type
  4. Enter properties:
    • Filing Type: 10K
    • Filing Name: Annual Report
  5. Save
  6. Repeat for 10Q

Step 3: Create the Item Type

Define an Item Type for customizing extraction prompts.

Via YAML

Via UI

  1. Go to Knowledge > Item Types
  2. Click Create Item Type
  3. Enter:
    • Slug: extraction-prompt-override
    • Name: Extraction Prompt Override
  4. Add options as shown above
  5. Save

Step 4: Create Knowledge Items

Create specific prompt configurations for each filing type.

Via YAML

Via UI

  1. Go to Knowledge > Items
  2. Click Create Item
  3. Select Item Type: Extraction Prompt Override
  4. Enter title, description, and properties
  5. Save
  6. Repeat for 10Q prompt

Step 5: Create Knowledge Sets

Connect features to items with Knowledge Sets.

Via YAML

Via UI

  1. Go to Knowledge > Sets
  2. Click Create Knowledge Set
  3. Enter:
    • Name: 10K Document Processing Rules
    • Status: Active
  4. Add Feature condition: SEC Filing Type = 10K
  5. Add Item: 10K Revenue Extraction Prompt
  6. Save
  7. Repeat for 10Q

How It Works at Runtime

  1. Document is uploaded and classified as 10K
  2. Feature “10K” is linked to the document
  3. Processor queries Knowledge Sets for matching features
  4. Knowledge Set “10K Processing Rules” matches
  5. Item “10K Revenue Extraction Prompt” is retrieved
  6. Custom prompt is used for extraction

Complete GitOps Example

Here’s the full set of files for deploying via kdx sync:
Manifest:
Deploy:

Next Steps