Skip to main content
Use the document field extractor node to extract specific fields from your documents.

Pre-requisites

Run the following command to enable watsonx Orchestrate Developer Edition to process documents:
BASH
Note: You need to configure a minimum allocation of 20GB RAM to your Docker engine during installation of watsonx Orchestrate Developer edition to support document processing features.

Limitations

Text extractors have the following limits and restrictions:
AreaDescription
Maximum file size10 MB (except for Microsoft Excel files). Note: The maximum file size for Microsoft Excel files is 0.1 MB.
Maximum number of uploaded files5 files
Accepted file types.doc, .docx, .jpe, .jpeg .jpg, .pdf, .png, .ppt, .pptx, .tif, .tiff, and .xlsx
Maximum number of pages600 pages
Maximum number of imagesNo limit
Maximum number of images per pageNo limit
Note: To run the document field extractor, you must define the WATSONX_SPACE_ID, WATSONX_APIKEY, and WATSONX_PROJECT_ID credentials in your .env file. For more information on configuring the .env file, see Installing the watsonx Orchestrate Developer Edition.

Configuring document extractor node in agentic workflows

  1. Define the fields to extract. Create a class that defines the fields you want to extract. Each field must follow this structure:
    Python
    Class example:
    Python
  2. Configure the document extract node
In your agentic workflow, include a call to the docext() method to extract an field from a document. This method accepts the following input arguments:
name
string
required
Unique identifier for the node.
llm
string
required
The LLM used for field extraction. The default value is watsonx/mistralai/mistral-small-3-1-24b-instruct-2503.
display_name
string
Display name for the node.
fields
object
required
The fields you want to extract.
description
string
Description of the node.
input_map
DataMap
Define input mappings using a structured collection of Assignment objects.
enable_hw
bool
Enable the handwritten feature by setting this to true.
min_confidence
float
The minimum acceptable confidence for an extracted field value.
review_fields
List[string]
The fields that require user review.
enable_review
bool
Enables or disables the human-in-the-loop feature. Set to True to activate it and False to deactivate. The default value is False.
field_extraction_method
string
Selects the Document Extractor runtime. The default value is classic, which uses the Unstructured Document Extractor. To use the Structured Document Extractor, set the value to layout. For more information, see Choosing a tool option for extracting fields from documents.
Note:The min_confidence and review_fields settings control the human-in-the-loop feature. This feature only works when you run the Flow from a chat session. If a field is extracted with confidence lower than min_confidence, and its name appears in review_fields, the agent opens a review window in the chat. You can then review and confirm the extracted values.
The input to a docext node is expected to be of type DocExtInput, from the module ibm_watsonx_orchestrate.flow_builder.types. Example use of the docext node in an agentic workflow:
Python