Automatically assign categories during SR and PR creation
Summarize
Summary of Automatically assign categories during SR and PR creation
The AI-driven Spend Categorization Agent in ServiceNow Australia Release automates the assignment of product and spend categories at the line level for sourcing requests (SRs), purchase requisitions (PRs), purchase orders (POs), and invoices. This ensures consistent classification, improves procurement process efficiency, supports accurate reporting, and reduces manual workload by updating category fields only when they are empty or when AI predictions exceed a confidence threshold.
Show less
Key Features
- Multi-tier AI Prediction Approach:
- Tier 1: ML classification and similarity solutions use product and spend category classification models trained on prior data.
- Tier 2: Retrieval-augmented generation (RAG) semantic search acts as a fallback when ML models return no results, matching line item details against indexed data.
- Tier 3: Large Language Model (LLM) predictor skills provide final fallback category suggestions using advanced reasoning.
- Configurable Confidence Threshold: The minimum confidence score for category updates can be set (default 80%) to control when AI predictions override empty fields.
- Category Mapping Logic: When a product category is present, spend category candidates are filtered based on existing mappings, enabling automatic selection if only one mapped spend category exists.
- User Overrides and Feedback: Users can manually select categories, with overrides captured to improve future prediction accuracy.
- Visual Indicators and Audit Trail: AI-updated category fields display visual cues and add activity stream comments for transparency.
- Support for Imported Lines and Invoice Matching: Scheduled scripts predict categories for imported PRLs and POLs; spend categories are maintained consistently when matching invoice lines to POs.
- Administrative Controls: Roles such as categorymanageradmin and nowassistadmin manage solution retraining and configuration; procurement administrators control fallback logic settings.
How It Works in Practice
When a sourcing request or purchase requisition is created via record producers, the Spend Categorization Agent activates automatically to predict and fill product and spend categories on purchase request lines. If the AI confidence exceeds the threshold, it updates empty fields and notifies users through visual indicators and activity stream comments. Users can override AI suggestions, which are logged to improve model training. The system also analyzes attached documents to enhance prediction accuracy.
Additionally, an automated audit flags category inconsistencies when predictive fields change, without overriding user input, helping maintain data integrity.
Practical Benefits for ServiceNow Customers
- Ensures consistent, accurate categorization across procurement documents without manual classification effort.
- Supports compliance and reporting requirements by standardizing product and spend categories.
- Enhances automation downstream by providing reliable category data for workflows and analytics.
- Improves user experience with transparent AI suggestions and easy manual override options.
- Facilitates ongoing model refinement by capturing user feedback and automating retraining processes.
AI-driven category prediction automatically assigns product and spend categories when sourcing requests, purchase requisitions, or purchase orders are created or updated, ensuring consistent classification at the line level.
Key benefits
When working with sourcing requests (SRs), purchase requisitions (PRs), purchase orders (POs), or invoices, you must classify line-level items into product and spend categories. The Spend categorization agent enables this process by generating and validating AI-driven predictions for line-level items. The Product category and Spend category fields are updated only when they are empty. This process ensures accurate reporting, consistent procurement processes, and efficient downstream automation while reducing manual effort.
View the Spend categorization agent by navigating to .
Classification solutions used for predictions
For predicting product category on PRs and SRs, the following classification solutions have been added:
- Product Category Classification For PRL
- Product Category Classification For POL
Classification solutions identify the most appropriate Product Category using product related information.
You can access the classification definitions by navigating to .
Similarity solutions used for predictions
For predicting spend category on PRs and SRs, the following similarity solutions have been added:
- Spend Category by PRL
- Spend Category by POL
Similarity solutions compare line item details with previously categorized data to suggest the best Spend Category.
You can access the similarity definitions by navigating to .
Both solution types retrain automatically based on configured training frequency. By default, the solution definitions run automatically once every seven days.
Semantic search used for predictions
When ML classification or similarity solutions return no results, the Spend categorization agent uses retrieval-augmented generation (RAG) semantic search as a second-tier mechanism to predict product and spend categories. RAG semantic search matches line item details against the following indexes:
- purchaseLineForProductClassification
- supplierProducts
- purchaseLineForSpendClassification
- purchaseOrderLineForProductClassification
- purchaseOrderLineForSpendClassification
LLM predictor skills used for predictions
When both ML classification or similarity solutions and RAG semantic search return no results, the Spend categorization agent invokes LLM-based predictor skills as the third and final tier. These skills use large language model reasoning to suggest categories for a fulfiller (sn_shop.procurement_specialist).
- Product category predictor: Suggests the most likely product category when both ML classification and RAG semantic search return no results.
- Spend category predictor: Suggests the appropriate spend category when both ML similarity and RAG semantic search return no results.
These skills predict and update the Product category and Spend category fields on the PRLs for an SR or PR.
View these skills by navigating to .
How to configure
The following system properties control category prediction behavior:
| Property | Description | Default value |
|---|---|---|
sn_spend_gen_ai.spend_category_confidence_score_threshold |
Defines the confidence score threshold for predicting the Product category and Spend category fields. Set a value between 0 and 100. | 80 |
sn_spend_gen_ai.enable_category_fallback_logic |
Enables LLM-based fallback (Product category predictor and Spend category predictor skills) for product and spend category prediction when both ML and RAG semantic search return no results. Configurable by users with the sn_shop.procurement_administrator role. |
true |
Product and spend category prediction logic
The Spend categorization agent uses a three-tier fallback chain to predict product and spend categories for SR and PR records.
| Tier | Mechanism | Condition to advance to next tier |
|---|---|---|
| 1 | ML Classification and Similarity | Returns no result |
| 2 | RAG Semantic Search | Returns no result and sn_spend_gen_ai.enable_category_fallback_logic is set to true |
| 3 | Product category predictor and Spend category predictor skills | None |
If one spend category is mapped, it is auto-selected without further ML or RAG input. If multiple spend categories are mapped, ML and RAG results are filtered to that mapped set only. If no mapping exists, the full result set is used.
How it works
When a new sourcing request (SR) or purchase request (PR) is created using the I need a product, I need a service, or I need to submit a quote record producers, the Spend categorization agent is automatically triggered. The Spend categorization agent predicts and updates the product category and spend category on the purchase request lines (PRLs).
If the AI-predicted category differs from the category selected by the requester, the Product category and Spend category fields are updated only when the prediction confidence score exceeds 80%.
Visual indicators appear next to the Product category and Spend category fields in the Playbook view and the Purchase Line related lists, indicating that the fields were updated using AI predictions. In such cases, a corresponding comment is added to the activity stream, for example, "AI-suggested Spend category updated from X to Y."
You can manually select different values for either category field from the Product category and Spend category drop-down lists on the Purchase Line form.
Any user-selected overrides are captured and used to improve future model accuracy. When a different value is selected, a banner appears at the top of the form that informs you that an AI-predicted value was applied.
The prediction model also analyzes information in documents attached to the SR or PR, such as the product name and product description, to predict the product and spend categories.