Customizing Extraction by Document Type
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
- Go to Knowledge > Feature Types
- Click Create Feature Type
- Enter:
- Slug:
sec-filing-type - Name:
SEC Filing Type - Description:
Classification of SEC filing documents
- Slug:
- Add option:
filingType(string, required) - Add extended option:
filingName(string) - Save
Step 2: Create Features
Create features for each filing type you want to handle.Via YAML
Via UI
- Go to Knowledge > Features
- Click Create Feature
- Select Feature Type:
SEC Filing Type - Enter properties:
- Filing Type:
10K - Filing Name:
Annual Report
- Filing Type:
- Save
- Repeat for 10Q
Step 3: Create the Item Type
Define an Item Type for customizing extraction prompts.Via YAML
Via UI
- Go to Knowledge > Item Types
- Click Create Item Type
- Enter:
- Slug:
extraction-prompt-override - Name:
Extraction Prompt Override
- Slug:
- Add options as shown above
- Save
Step 4: Create Knowledge Items
Create specific prompt configurations for each filing type.Via YAML
Via UI
- Go to Knowledge > Items
- Click Create Item
- Select Item Type:
Extraction Prompt Override - Enter title, description, and properties
- Save
- Repeat for 10Q prompt
Step 5: Create Knowledge Sets
Connect features to items with Knowledge Sets.Via YAML
Via UI
- Go to Knowledge > Sets
- Click Create Knowledge Set
- Enter:
- Name:
10K Document Processing Rules - Status:
Active
- Name:
- Add Feature condition: SEC Filing Type = 10K
- Add Item: 10K Revenue Extraction Prompt
- Save
- Repeat for 10Q
How It Works at Runtime
- Document is uploaded and classified as 10K
- Feature “10K” is linked to the document
- Processor queries Knowledge Sets for matching features
- Knowledge Set “10K Processing Rules” matches
- Item “10K Revenue Extraction Prompt” is retrieved
- Custom prompt is used for extraction
Complete GitOps Example
Here’s the full set of files for deploying viakdx sync:
Next Steps
- Knowledge Feature Types - Full reference
- Knowledge Item Types - Full reference
- Adding Validation Rules - Another common use case
