Creating Documents
Empty Document
Create a new document and build its structure:From Text
Automatically parse text into paragraphs:With Metadata
Initialize documents with metadata:Loading Documents
From KDDB File
Load an existing document:From Bytes
Load from API responses or downloads:From JSON
Load from JSON representation:Working with Content Nodes
Navigation
Traverse the document tree:Content Access
Read and modify node content:Querying with Selectors
Use XPath-like selectors to find nodes:Common Selector Patterns
| Selector | Description |
|---|---|
//* | All nodes |
//paragraph | All paragraphs |
//section/paragraph | Direct child paragraphs of sections |
//paragraph[1] | First paragraph |
//*[@tag='important'] | Nodes with ‘important’ tag |
//paragraph[contains(@content, 'text')] | Paragraphs containing ‘text’ |
Adding Features
Attach metadata to nodes:Adding Tags
Annotate nodes with tags:Saving Documents
To KDDB File
Save to the native format:To Bytes
Export for API responses:To JSON
Export for debugging or interoperability:Document Metadata
Setting Metadata
Labels
Categorize documents:Error Handling
Handle common errors gracefully:Complete Example
Here’s a full workflow combining the concepts:Working with Accessors
Once a document has been processed and contains extracted data, you can use accessors to work with data objects and attributes programmatically.Data Objects
Data Attributes
Audit Trail
Next Steps
Platform Models
Auto-generated Pydantic models from the OpenAPI spec
Platform Client
Connect to the Kodexa API
Extraction
Extract structured data using taxonomies
Processing
Track processing steps and knowledge items
LLM & Model Manager
Access large language models through the AI Gateway
