Skip to content

Rules Engine

The Archivus Rules Engine automates document workflows with intelligent rules that adapt to your organization. AI pattern detection learns from user corrections to suggest new automation opportunities.

How It Works

Traditional Automation:

  • Rigid rule definitions
  • Breaks when data changes
  • Requires manual updates
  • No learning capability

Archivus Rules Engine:

  • AI-powered pattern detection
  • Learns from user corrections
  • Suggests new rules automatically
  • Adapts to workflow changes

Rule Components

All Tiers

Conditions (30+ fields, 15 operators)

Define when rules trigger:

  • Document type, classification confidence
  • File name, extension, size
  • Upload date, modified date
  • Uploader, workspace, project
  • AI-extracted entities
  • Custom metadata fields
  • Tags, collections

Actions (7 types)

What happens when conditions match:

  1. Route - Move to folder/workspace/project
  2. Tag - Apply tags automatically
  3. Assign - Set owner or reviewer
  4. Notify - Email or in-app notification
  5. Workflow - Trigger DAG workflow Team+
  6. Review - Queue for human approval
  7. Metadata - Set custom fields

Scope Levels (5 levels)

Where rules apply:

  • Tenant - All documents in your account
  • Organization - Specific organization
  • Workspace - Specific workspace
  • Project - Specific project
  • User - Personal rules

Inheritance Modes (4 modes)

How child scopes handle parent rules:

  • Inherit - Apply parent rules plus own
  • Override - Replace parent rules
  • Extend - Add to parent rules
  • Block - Ignore parent rules

Rule Examples

Invoice Routing

name: Route Invoices to Accounting
scope: Organization
conditions:
  - document_type equals INVOICE
  - confidence >= 90%
actions:
  - route to /Financial/Invoices
  - tag with #invoice, #accounting
  - notify accounting@company.com

Contract Expiration Alert

name: Alert on Expiring Contracts
scope: Workspace
conditions:
  - document_type equals CONTRACT
  - expiration_date within_days 30
actions:
  - tag with #expiring-soon
  - assign to contract-manager
  - notify with priority HIGH

Sensitive Data Review

name: PII Detection Review
scope: Tenant
conditions:
  - pii_detected equals true
  - sensitivity_score >= 80
actions:
  - move to /Compliance/Review-Queue
  - assign to compliance-officer
  - workflow trigger privacy_review_dag

AI Pattern Detection

Pro+

The Rules Engine observes user behavior and suggests automation:

How It Learns

  1. User repeatedly routes invoices from Vendor X to folder Y
  2. AI detects pattern across 5+ similar actions
  3. Suggested rule generated with confidence score
  4. User reviews and activates suggestion

Example Suggestion:

📊 SUGGESTED RULE (87% confidence)

Pattern Detected: You've moved 8 documents from Acme Corp
to /Vendors/Acme in the past week.

Suggested Rule:
  IF sender contains "Acme Corp"
  THEN route to /Vendors/Acme
       AND tag with #vendor-acme

Actions:
  [Accept] [Modify] [Dismiss] [Never for this pattern]

Rule Execution

Trigger Points

Rules evaluate at:

  • Document upload
  • Document classification complete
  • Manual re-evaluation
  • Scheduled intervals Team+

Execution Flow

  1. Document triggers rule evaluation
  2. All applicable rules checked in priority order
  3. Conditions evaluated sequentially
  4. Matching rules execute actions
  5. Audit log created with explanation

Conflict Resolution

When multiple rules match:

  • Higher priority rules execute first
  • stop_on_match flag prevents further evaluation
  • Conflicting actions logged for review
  • User notification on conflicts

Human-in-the-Loop

Pro+

Rules can require human approval:

Approval Workflow

name: Large Invoice Approval
conditions:
  - document_type equals INVOICE
  - total_amount > 10000
actions:
  - review required_by finance-manager
  - if_approved: route to /Approved-Invoices
  - if_rejected: route to /Rejected-Invoices
  - timeout: 48 hours
  - escalate_to: finance-director

Approval Interface

  • Pending approvals dashboard
  • Rule reasoning display
  • One-click approve/reject
  • Rejection reasons tracked
  • Escalation on timeout

Rule Analytics

Team+

Track rule performance and effectiveness:

Metrics

  • Total evaluations performed
  • Match rate (% of documents triggering)
  • Auto-approval rate
  • Average confidence scores
  • User override rate

Insights

  • Which rules save the most time
  • Rules needing adjustment
  • Patterns for new rule suggestions
  • Credit consumption per rule

Example Analytics:

Invoice Routing Rule (30 days)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Evaluations:      423
Matches:          387 (91.5%)
Auto-approved:    374 (96.6%)
User overrides:   13 (3.4%)
Time saved:       ~8 hours
Confidence:       94.2% average

Rule Management

Bulk Operations

  • Enable/disable multiple rules
  • Update priorities in batch
  • Export/import rule definitions
  • Clone rules across scopes

Testing & Validation

  • Test rules against sample documents
  • Preview actions before activation
  • Dry-run mode for new rules
  • Rollback to previous versions

Templates

8 pre-built rule templates for common scenarios:

  • Invoice processing
  • Contract management
  • Compliance documentation
  • Customer communications
  • Legal discovery
  • Financial reporting
  • HR records
  • Project deliverables

API Access

Team+

Programmatic rule management:

# Create rule
POST /api/v1/rules
{
  "name": "Route Invoices",
  "scope": "organization",
  "scope_id": "org-uuid",
  "conditions": [...],
  "actions": [...]
}

# List rules
GET /api/v1/rules?scope=workspace&scope_id=ws-uuid

# Execute rules manually
POST /api/v1/rules/evaluate
{
  "document_id": "doc-uuid",
  "rule_ids": ["rule1-uuid", "rule2-uuid"]
}

Use Cases

Legal Firms

  • Route contracts by client or matter
  • Alert on filing deadlines
  • Auto-tag discovery documents
  • Privilege log generation

Accounting

  • Invoice classification and routing
  • Tax document organization
  • Audit trail automation
  • Client document sorting

Healthcare

  • Patient record classification
  • HIPAA compliance checks
  • Provider assignment
  • Medical records routing

Real Estate

  • Transaction document routing
  • Deadline tracking
  • Client communication filing
  • Commission approval workflows

Best Practices

Start Simple

  • Begin with high-confidence rules
  • Test with small document sets
  • Gradually increase complexity

Monitor Performance

  • Review rule analytics monthly
  • Adjust based on override rates
  • Deactivate unused rules

Leverage AI Suggestions

  • Review pattern detections weekly
  • Accept high-confidence suggestions
  • Customize before activating

Document Reasoning

  • Add descriptions to complex rules
  • Note business justification
  • Track version history

Getting Started

  1. Navigate to Settings → Rules
  2. Click "Create Rule" or use template
  3. Define conditions and actions
  4. Set scope and priority
  5. Test with sample documents
  6. Activate and monitor

View Rules API Docs → See Rule Examples →