Skip to main content

Human in the Loop (HITL) Rule Configuration

Overview

Human in the Loop (HITL) allows you to introduce manual review steps into your workflow. This ensures data accuracy by routing specific files to human reviewers based on configurable rules.

Accessing HITL Configuration

  1. After setting up tools in Step 3 of your workflow
  2. Click on "Configure" in Step 2 (Destination Connector)
  3. Navigate to the "Human in the Loop" tab

HITL Rule Configuration

Rules Tab

1. Percentage of Files Sent to Manual Review

Control what portion of your processed files should be routed to manual review:

  • Set a percentage value (0-100%)
  • Example: If you set 50% and process 2 files:
    • 1 file will be sent to HITL for manual review
    • 1 file will be sent directly to the database HITL rule Creation

2. Add Rules

Create custom rules to determine which files require manual review. All prompt keys created in the Prompt Studio will be available in the Field dropdown.

Rule Types

You can configure rules using four different filter methods:

  1. Filter by Confidence

    • Route files based on confidence scores
    • Enter percentage threshold (0-100)
    • Example: 80 (for 80% confidence threshold) HITL rule Creation HITL rule Creation
  2. Filter by Value

    • Route files based on specific field values
    • Supports text, numbers, booleans, and dates
    • Examples:
      • Text: approved, NAREN
      • Numbers: 1900, 100.50
      • Booleans: true, false
      • Dates: 2020-01-01 HITL rule Creation HITL rule Creation
  3. Filter by Value JSON Sub Field

    • Route files based on nested JSON field values
    • Two input fields: path and value
    • Supports text, numbers, booleans, and dates

    Examples:

    PathValueData TypeDescription
    address.cityBostonTextChecks city field value
    customer.age35NumberChecks age field value
    account.activetrueBooleanChecks boolean status
    transaction.date2020-01-01DateChecks transaction date
    statusapprovedTextChecks status field value
tip

When working with nested JSON fields, select the parent field from the Field dropdown first (e.g., due_details), then specify only the nested path in the value field (e.g., due_date). Do not include the parent field name in the path value.

Example: If checking city_name within address:

  • Field dropdown: Select address
  • Value field: Enter city_name (NOT address.city_name)

HITL rule Creation HITL rule Creation

4. Filter by Confidence JSON Path

  • Route files based on confidence at specific JSON paths
  • Enter as path:threshold
  • Threshold should be a number (0-100)

Simple Object Examples:

JSON PathThresholdDescription
address.city:8080Checks if confidence for address.city is 80% or below
status:7575Checks if confidence for status field is 75% or below
customer.name:8585Checks if confidence for customer.name is 85% or below
key1.key2:7575Checks confidence at nested key path
invoice.total_amount:9090Checks if confidence for invoice total is 90% or below
tip

When specifying JSON paths for confidence checks, select the parent field from the Field dropdown first (e.g., due_details), then specify only the nested path with threshold in the format path:threshold (e.g., due_date:80). Do not include the parent field name in the path.

Example: If checking confidence of city_name within address:

  • Field dropdown: Select address
  • Path:Threshold: Enter city_name:80 (NOT due_details.city_name:80)

HITL rule Creation HITL rule Creation


Setting Up a Rule

  1. Select Field: Choose from the dropdown (all Prompt Studio fields available)

    • Examples: account_holder_name, cc_issuer_name, line_items
  2. Choose Operator: Select comparison method

    • == (equals)
    • != (not equals)
    • < (less than)
    • <= (less than or equal)
    • > (greater than)
    • >= (greater than or equal)
    • Starts with
    • Ends with
tip

Important: Choose operators appropriate to your value type. For text values, use text-based operators like Starts with, Ends with, or Contains. For numbers and dates, use comparison operators like <, >, <=, >=.

  1. Set Value: Enter the comparison value as a string (including numbers and booleans)

HITL rule Creation

Example Rules
filterByValue.account_holder_name STARTS WITH "NAREN"
filterByValue.line_items[0].quantity == "5"
filterByValue.account.active == "true"

These rules send files to manual review based on the specified conditions.


Rule Logic
  • Rule Logic: Choose between OR and AND logic to combine multiple rules
  • Not: Toggle to negate a rule condition

HITL rule Creation

Managing Rules
  • Add rule: Click the + Add rule button to create additional rules
  • Delete: Click the red trash icon to remove a rule
  • Save Rules: Click the Save Rules button to apply your configuration

Settings Tab

Configure what happens after manual review approval:

HITL rule Creation

After Approval Send Result To

Choose where approved data should be sent:

  1. Destination DB

    • Approved results are sent directly to the configured destination database
  2. Queue

    • Approved results are sent to a queue
    • Extract values using API calls

Unfinalized Records Lifetime

Control how long unreviewed records are retained:

  • Unlimited: Keep unreviewed records forever (default)
  • Custom: Auto-delete unreviewed records after a specified number of hours
    • Maximum: 8,640 hours (1 year)
    • Helps manage storage and compliance requirements

Note: Click Save Settings to apply changes.