Microsoft Foundry AI Action is a specific implementation of Document AI that uses Microsoft’s AI models for document processing. This action type provides advanced extraction and classification capabilities through Microsoft’s language models.
Several fields must be specified to configure a Microsoft Foundry AI Action:
Additionally, optional fields are:
- Set Properties
- Create Object(s)
- Classify Examples
- Pages
- Confidence Threshold
Below are descriptions of all Microsoft Foundry AI Action-related fields and their respective values.
Action Type #
Microsoft Foundry Action Type
Required field
The Action Type determines the operation that will be performed on the document using Microsoft Foundry AI models. Choose from the following options:
- Extract (default): Choose this option to extract structured data from documents. The Extraction Model, Extraction System Instructions, Set Properties, and Create Object(s) fields become available.
- Classify: Choose this option to automatically classify documents based on their content. The Classifier Model, Classifier System Instructions, and Classify Examples fields become available.
Model Selection #
The model selection varies based on the Action Type. The system displays only the relevant model field based on your selection.
Extraction Model #
Microsoft Foundry Action Type: Extract > Extraction Model
Displayed only when Action Type is set to Extract.
Specifies the Microsoft Foundry AI model to be used for data extraction operations. Select from the list of available extraction models configured for the Microsoft Foundry service in your environment.
The models are optimized for extracting structured information from various document types including invoices, contracts, forms, and general business documents.
Classifier Model #
Microsoft Foundry Action Type: Classify > Classifier Model
Displayed only when Action Type is set to Classify.
Specifies the Microsoft Foundry AI model to be used for document classification operations. Select from the list of available classifier models configured for the Microsoft Foundry service in your environment.
The classifier models are trained to categorize documents based on content, structure, and context.
System Instructions #
System instructions provide additional context and guidance to the AI model, helping it understand the specific requirements for processing your documents.
Extraction System Instructions #
Microsoft Foundry Action Type: Extract > Extraction System Instructions
Displayed only when Action Type is set to Extract.
Default value:
You are a document analysis assistant that extracts metadata from documents. You must respond ONLY with valid JSON. Do not include any explanatory text before or after the JSON.
Provide custom instructions to guide the extraction model. These instructions should:
- Define the context and purpose of the extraction
- Specify any formatting requirements
- Clarify how the model should handle ambiguous data
- Set expectations for the response format
Important: The model must return valid JSON output. Ensure your instructions emphasize this requirement if you modify the default text.
Classifier System Instructions #
Microsoft Foundry Action Type: Classify > Classifier System Instructions
Displayed only when Action Type is set to Classify.
Default value:
You are a document classification assistant. Classify documents using ONLY the labels provided in the examples. Do NOT invent, rename or create new labels. Respond ONLY with valid JSON containing the key '__CLASS__' and the selected label value.
Provide custom instructions to guide the classifier model. These instructions should:
- Define the classification criteria
- Emphasize the use of predefined labels from examples
- Specify the expected JSON response format
- Clarify how to handle edge cases
Important: The classifier must select from the labels provided in the Classify Examples. It should not create new labels or modify existing ones.
Set Properties #
Microsoft Foundry Action Type: Extract > Set Properties
Displayed only when Action Type is set to Extract.
Defines properties that will be populated with data extracted from the document by the LLM (Large Language Model). This configuration maps extracted information to specific M-Files properties.
- Expand the Set Properties section.
- Click on Add Property Mapping.
- Configure each property mapping.
Each property mapping includes:
- Query Field: The name or identifier of the data field to extract from the document. This acts as an input term that tells the AI what information to look for.
- Query Field Additional Description: Optional additional context or instructions to help the AI understand what data to extract and how to format it.
- Target Property: The M-Files property where the extracted value will be stored.
- Is Input Term: Indicates whether this field should be treated as an input term for the AI model.
Input Terms: Properties marked as input terms are automatically included in the AI processing context, helping the model understand what information needs to be extracted.
Create Object(s) #
Microsoft Foundry Action Type: Extract > Create Object(s)
Displayed only when Action Type is set to Extract.
Defines new M-Files objects that will be created based on data extracted from the document. This allows you to automatically generate related records such as line items, contact information, or subsidiary documents.
- Expand the Create Object(s) section.
- Click on Add New Object Configuration.
- Configure the object creation settings.
Each object configuration includes:
- Object Type: The type of M-Files object to create
- Class: The class to assign to the new object
- Property Mappings: Defines which properties will be populated in the new object from extracted data
- Input Terms: Specific terms or fields that the AI should extract to populate the new object
Input Terms Cache: The system automatically caches input terms from all configured new objects, ensuring the AI model has the necessary context to extract relevant information for object creation.
Classify Examples #
Microsoft Foundry Action Type: Classify > Classify Examples
Displayed only when Action Type is set to Classify.
Provides example documents or document characteristics to train and guide the Microsoft Foundry classifier. These examples are critical for accurate classification.
WARNING: If no examples are provided, classification will be skipped. The classifier requires examples to understand which labels to use and how to apply them.
- Expand the Classify Examples section.
- Click on Add Classify Example.
- Configure each example.
Each classification example should include:
- Label: The exact classification label that should be applied (e.g., “Invoice”, “Contract”, “Receipt”)
- Example Content: Sample text, keywords, or document characteristics that represent this classification
- Context: Any additional information that helps distinguish this class from others
Best Practices:
- Provide at least 2-3 examples for each classification label
- Use consistent label naming across all examples
- Include diverse examples that cover different variations within each class
- Ensure labels exactly match the M-Files classes or values you want to assign
Important: The classifier will ONLY use labels provided in these examples. It will not create new labels or modify existing ones.
Pages #
Specifies which pages of the document will be processed by the Microsoft Foundry AI model.
Format: Enter a comma-separated list of page numbers and/or page ranges.
Examples:
1– Process only the first page1,3,5– Process pages 1, 3, and 51-5– Process pages 1 through 51,3-5,7– Process page 1, pages 3 through 5, and page 7
Default behavior: If left empty (""), all pages in the document will be processed.