Search the docs

Pages and API endpoints

Developer dashboard
Docs/AI Services

AI Services

Comprehensive guide to all AI-powered features in SyncBooks

Overview

SyncBooks AI provides 33 intelligent services across your entire business — from predicting customer payments to optimizing production schedules. All AI features are gated behind two levels of access control:

Access Control Layers

  1. Organization Level — Your organization must have an active AI module subscription.
  2. User Level — Each user's role must have the ai_view permission enabled. Admins and owners always have access.

Users without the ai_view permission will not see any AI features — no buttons, no scores, no suggestions. This is controlled per-role in Settings → Roles.

AI Settings Page

Navigate to Settings → AI Services to manage all AI features. The settings page allows organization admins to:

  • Enable/Disable individual services — Toggle any of the 33 services on or off for your entire organization.
  • Configure service-specific settings — Some services have custom parameters (e.g., Cash Flow Monitor sensitivity, Salary Benchmarker market rates).
  • View module subscription status — See which AI features are active and how many are enabled per category.
💡

Disabling a service stops it from running and hides its UI elements, but does not delete any previously generated data (scores, predictions, alerts).

Service Categories

AI services are organized into five categories based on their function:

Scoring8

Statistical scoring and ranking using historical data patterns

Analysis7

Pattern detection, anomaly detection, and quality monitoring

Prediction5

Forecasting, trend extrapolation, and schedule optimization

Generation5

LLM-powered text generation for emails, reports, and narratives

Utility8

Cross-module tools: search, copilot, workflow advice

Scoring Services

Payment Predictor

Scores customers 0-100 by payment likelihood and expected timing. Uses weighted average days-to-pay, payment consistency, and late payment ratio from the last 12 months of invoice history.

payment_predictor

How it works

  • Analyzes the customer's last 12 months of paid invoices
  • Computes a weighted average of days-to-pay (recent invoices weighted higher)
  • Factors in payment consistency (standard deviation) and late payment ratio
  • Produces a score from 0 (unlikely to pay on time) to 100 (always pays early)
  • Recalculated daily at 2:00 AM and on payment receipt events
Where: Accounts Receivable aging report, customer detail pagesThreshold: Requires at least 5 paid invoices for reliable scoring. Below 5, shows a 'limited data' indicator.

Collection Scorer

Ranks overdue invoices by collection likelihood (0-100). Helps prioritize which overdue customers to follow up with first.

collection_scorer

How it works

  • Multi-factor scoring: payment history (30%), days overdue (25%), invoice amount (15%), communication attempts (15%), customer tenure (15%)
  • Category mapping: high (70-100), medium (40-69), low (0-39)
  • Flags for write-off consideration when score drops below 20
  • Recalculated on invoice status changes, payment events, and reminder sends
Where: Overdue invoices list (priority badge), invoice detail pagesThreshold: Write-off flag triggers at score < 20

Lead Scorer

Ranks CRM leads by conversion probability using 6 factors: source quality, engagement level, company size, industry match, response time, and profile completeness.

lead_scorer

How it works

  • Source scoring: referrals score highest (0.9), cold outreach lowest (0.25)
  • Engagement: emails opened, website visits, meetings attended, forms submitted, calls logged
  • Category mapping: hot (70-100), warm (40-69), cold (0-39)
  • Generates notification to assigned sales rep when a lead transitions categories (e.g., warm → hot)
  • Monthly model update adjusts source weights based on actual conversion outcomes
Where: Lead list table (AI Score column), lead detail dialog, lead kanban cardsThreshold: Monthly model update requires at least 3 conversion outcomes per source to adjust weights

Churn Predictor

Identifies customers at risk of leaving using engagement decline, payment delays, support ticket volume, renewal proximity, and communication silence.

churn_predictor

How it works

  • Communication silence detection: 0 interactions in 60 days AND previous average was ≥ 2/month
  • Engagement decline: compares recent 3 months to overall purchase frequency average
  • Payment delay factor: increasing days-to-pay and late payment ratio
  • Alerts generated when churn score exceeds 70, with specific retention action suggestions
  • Recalculated weekly (Sunday 3AM) and on customer interaction events
Where: Customer 360 dashboard, 'Customers at Risk' widgetThreshold: Alert threshold: score > 70 triggers retention action suggestions

Deal Predictor

Predicts deal/opportunity close probability using stage progression, stakeholder engagement, competitor presence, deal size, and activity recency.

deal_predictor

How it works

  • Stage-based win rate from historical data (how often deals at this stage close)
  • Time-in-stage: deals lingering beyond average get lower probability
  • Stakeholder scoring: decision maker + champion engaged = higher probability
  • 'Deal at risk' indicator when probability drops below 30, with up to 3 improvement actions
  • Pipeline forecast: weighted value = sum(amount × probability / 100) for all open deals
Where: Opportunity pipeline view, deals table (probability column), opportunity detail pagesThreshold: At-risk threshold: probability < 30 triggers improvement action suggestions

Quality Predictor

Predicts batch defect probability from production parameters, material quality, equipment condition, operator history, and time patterns.

quality_predictor

How it works

  • 5 scoring factors: production parameters (30%), materials (25%), equipment (20%), operator (15%), time (10%)
  • Color-coded display: green (0-20% defect risk), amber (21-50%), red (51-100%)
  • Alerts generated when defect probability exceeds 50% — recommends increased inspection
  • Learns from NCR (Non-Conformance Report) data to adjust factor weights over time
  • Marks prediction as 'estimated' when fewer than 20 completed batches available
Where: Work order list, batch tracking views, production quality dashboardThreshold: Alert at >50% defect probability. < 20 batches = 'estimated' with reduced confidence

Pricing Advisor

Suggests optimal pricing based on similar customer transactions (industry, size, volume). Returns a min/recommended/max range.

pricing_advisor

How it works

  • Finds comparable transactions from similar customers (matching industry, company size, purchase volume)
  • Computes percentile analysis: min (25th percentile), recommended (median), max (75th percentile)
  • Shows deviation note when entered price falls outside the suggested range
  • Falls back to a 'not enough data' message when fewer than 3 comparable transactions exist
Where: Invoice/estimate creation forms, product pricing pagesThreshold: Requires at least 3 comparable transactions for reliable suggestions

Salary Benchmarker

Suggests competitive salary ranges based on role, department, and configurable market rate adjustments per region.

salary_benchmarker

How it works

  • Calculates salary range (low, median, high) from internal employee data
  • Applies market rate adjustment percentages configurable per region/role in AI Settings
  • Displays 'below market' indicator when salary falls below the 25th percentile
  • Falls back to industry defaults when fewer than 3 internal employees in the same role exist
Where: Employee salary review pages, HR salary suggestion modalThreshold: < 3 internal employees in same role triggers market-data-only fallbackConfigurable: Market rate adjustments: configure per-region multipliers in Settings → AI Services → Salary Benchmarker

Analysis Services

Duplicate Detector

Identifies potential duplicate expense entries using fuzzy matching on vendor name, amount, and date proximity.

duplicate_detector

How it works

  • Fuzzy matching criteria: vendor name Levenshtein distance ≤ 3, amount within ±1% or ±1.00, date within ±3 days
  • Similarity score computed — flags entries with score > 80 as potential duplicates
  • Dismissal learning: when you dismiss a duplicate warning, future sensitivity is reduced for that vendor-amount pattern
  • Weekly report generated listing all unreviewed potential duplicates
Where: Expense list (duplicate warning badges), weekly duplicate reportThreshold: Similarity > 80 triggers flag. Levenshtein ≤ 3, amount ±1%, date ±3 days

Vendor Intelligence

Monitors vendor pricing over a rolling 12-month window and alerts when prices increase significantly.

vendor_intelligence

How it works

  • Tracks price per vendor per product/service over the last 12 months
  • Alerts when a line item price exceeds the historical average by more than 15%
  • Proactive notification when 3+ consecutive purchase orders show >20% price increase
  • Classifies price trends as increasing, stable, or decreasing using linear regression
Where: Purchase order creation, vendor detail pages, procurement alertsThreshold: Single alert: >15% above average. Trend alert: >20% increase across 3 consecutive POs

Cash Flow Monitor

Detects unusual cash flow patterns using a 90-day rolling baseline. Alerts on anomalies when the deviation exceeds 2 standard deviations from the mean.

cash_flow_monitor

How it works

  • Computes rolling 90-day baseline: mean and standard deviation for daily inflows and outflows
  • Anomaly detected when |today's value - mean| > 2σ (adjusted by sensitivity settings)
  • Anomaly categories: unexpected large outflow, absence of expected inflow, pattern change, concentration risk
  • Dismissal sensitivity: each dismissed alert widens the threshold by 0.5σ for that pattern
  • Integrates with notification system — in-app alerts for all, email for critical
Where: Banking dashboard, cash flow alerts panelThreshold: Anomaly = deviation > 2σ. Sensitivity adjustable in AI Settings.Configurable: Sensitivity Multiplier (default: 1.0, higher = less sensitive), Email Alerts toggle

Payroll Validator

Detects anomalies in payroll data before processing by comparing against the previous 6 pay periods.

payroll_validator

How it works

  • Compares each employee's current pay against their rolling 6-period average
  • Flags deviations > 20% from average — types: unusual overtime, missing allowances, duplicates, gross pay outliers, new deductions
  • Severity classification: critical (deviation > 2σ) vs informational
  • Displays zero-anomaly confirmation when payroll passes all checks
Where: Payroll processing review page (pre-submission)Threshold: Warning at >20% deviation from 6-period average. Critical at >2σ

Leave Analyzer

Detects concerning leave patterns and staffing risks across the organization.

leave_analyzer

How it works

  • Pattern detection: Monday/Friday frequency (>60%), consecutive short leaves (3+ in 30 days), department concentration (>30%), balance exhaustion (<3 days remaining with >3 months until reset)
  • Elevates to 'high' priority when 3 or more indicators present simultaneously
  • Runs weekly (Sunday 3AM) and generates staffing risk dashboard data
  • Alerts HR manager and department heads for high-priority patterns
Where: Staffing Risk dashboard widget, payroll/leave section alertsThreshold: High priority = 3+ concern indicators present simultaneously

Data Quality Monitor

Weekly scan across all modules for data quality issues: missing fields, orphaned records, inconsistencies, duplicates, and stale data.

data_quality_monitor

How it works

  • Scans 9 collections: invoices, expenses, customers, vendors, products, projects, employees, bank transactions, journal entries
  • Issue categories: missing required fields, orphaned references (to deleted entities), inconsistencies (e.g., invoice total ≠ line items sum), potential duplicates, stale drafts (>90 days)
  • Quality score: (passing records / total records) × 100
  • One-click auto-fix for orphaned references and stale data. Guided flow for other issues.
  • Alerts admin/accountant roles when quality score drops below 90%
Where: Data Quality dashboard widget, Settings → AI Services alertsThreshold: Critical alert when quality score < 90%

Prediction Services

Purchase Suggester

Predicts restocking needs based on consumption patterns, seasonal adjustments, and lead times.

purchase_suggester

How it works

  • Reorder point: current_stock < 1.5 × weighted_avg_daily_consumption × lead_time
  • Weighted consumption: 90-day window with recent-30 bias (2× weight)
  • Seasonal adjustment applied when quarterly variation exceeds 30%
  • Groups vendor orders within a 7-day window for cost-efficient procurement
Where: Restocking Suggestions dashboard widget, inventory alertsThreshold: Reorder triggered when stock falls below 1.5× (avg consumption × lead time)

Maintenance Predictor

Predicts equipment maintenance needs from operational data (runtime hours, cycle counts, energy consumption).

maintenance_predictor

How it works

  • Degradation trend analysis on runtime/cycles + historical maintenance interval averaging
  • Uses manufacturer intervals as fallback when fewer than 3 historical maintenance events exist
  • Generates notification when predicted maintenance is due within 14 days
  • Tracks prediction accuracy by comparing predicted dates vs actual maintenance dates
Where: Maintenance Forecast dashboard widget, production equipment pagesThreshold: Notification at ≤14 days until predicted maintenance. Accuracy window: ±7 days

Schedule Optimizer

Suggests optimal production sequencing to minimize changeover time using greedy nearest-neighbor with product similarity scoring.

schedule_optimizer

How it works

  • Computes product similarity (shared attributes, materials, work centers) for changeover estimation
  • Greedy sequencing: picks the next work order that minimizes changeover while considering delivery urgency
  • Enforces constraints: work center availability, material availability, shift schedules, delivery dates
  • Shows comparison: original vs optimized (time saved, delivery improvements)
  • Generates trade-off options when constraints conflict (e.g., 'accept 2-day delay to save 40min changeover')
Where: Production schedule planning pagesThreshold: Only runs when 2+ work orders are in planned/ready status

Demand Forecaster

Projects raw material needs at 30/60/90 day intervals by exploding through BOM hierarchy from sales forecasts.

demand_forecaster

How it works

  • Projects finished goods demand from: confirmed sales orders + sales forecasts + weighted historical sales rate
  • Recursive BOM explosion: converts finished goods demand into raw material requirements through multi-level BOMs
  • Shortfall detection: shortfall = max(0, required - current_stock - pending_PO_quantity)
  • Generates procurement alerts with material name, quantity needed, required-by date, and suggested vendor
  • Daily recalculation at 2:00 AM
Where: Demand planning dashboard, procurement alert notificationsThreshold: Procurement alert generated for any 30-day horizon shortfall

Overrun Predictor

Flags projects likely to exceed budget or timeline using Earned Value Analysis (CPI, SPI) plus velocity trending.

overrun_predictor

How it works

  • Earned Value: CPI (cost performance index) and SPI (schedule performance index) from budget/timeline data
  • Budget overrun probability: driven by CPI < 1.0 and cost escalation trends
  • Timeline overrun probability: driven by SPI < 1.0, velocity decline, and milestone delays
  • Identifies top 3 contributing factors ordered by impact: delayed tasks, scope changes, resource under-allocation, cost escalation
  • Warning displayed when either probability exceeds 60%
Where: Project detail pages, project health dashboardThreshold: Warning threshold: >60% overrun probability. Requires ≥7 days active AND ≥10% tasks completed

Generation Services (LLM-Powered)

These services use OpenAI for natural language generation. They have completion time targets to ensure responsive UX.

Invoice Drafter

Pre-fills invoice line items, payment terms, and notes based on the customer's purchase history.

invoice_drafter

How it works

  • Analyzes the last 50 invoices for the selected customer
  • Identifies frequently purchased items with their typical quantities and rates
  • Pre-fills suggested line items ranked by frequency (most common first)
  • Suggests payment terms and notes based on historical patterns
  • Target: completes within 3 seconds
Where: Invoice creation page — 'AI Draft' button next to 'Add Item'Threshold: Requires ≥3 previous invoices for the customer. Shows 'insufficient history' message below 3.

Email Composer

Drafts context-aware business emails with tone selection. Supports follow-ups, reminders, thank-yous, and introductions.

email_composer

How it works

  • Extracts context from the source record (invoice details, customer history, project status, lead info)
  • Supports 4 tones: professional (default), friendly, firm, concise
  • For payment reminders: escalation proportional to overdue duration (gentle → moderate → firm)
  • Pre-populates recipient email, subject line, and full body
  • Target: completes within 5 seconds
Where: Invoice actions, estimate actions — 'AI Compose' buttonConfigurable: Tone selection per email. Escalation level is automatic based on days overdue.

Natural Language Reporter

Generates reports from plain-English questions. Ask 'What was total revenue last month?' and get a formatted answer.

nl_reporter

How it works

  • LLM parses your question into structured intent (domain, metric, time range, grouping)
  • Builds a MongoDB aggregation query from the parsed intent
  • Executes the query and fetches real data from your organization
  • Formats results as table, chart, or summary depending on data nature
  • Shows alternative interpretations when confidence is below 60%
Where: Reports section — NL Query input with example promptsThreshold: Completion target: 10 seconds. Shows alternatives when interpretation confidence < 60%

Summary Generator

Produces monthly AI-generated business narratives with 4 sections: executive summary, highlights, concerns, and forward-looking outlook.

summary_generator

How it works

  • Gathers monthly metrics: revenue, expenses, profit margin, cash position, AR/AP, customer growth
  • Compares vs prior month and same month last year — notes significant variations (>10% change)
  • Generates structured narrative via OpenAI with professional business language
  • Delivers to users with financial_reports permission via in-app notification + optional email
  • Runs automatically on the 1st of each month at 6:00 AM
Where: Monthly notification to financial_reports permission holdersThreshold: Requires ≥2 months active for full comparative summary. Limited summary below 2 months.

Trend Narrator

Generates 1-3 sentence plain-language explanations for chart data, tailored to chart type (time-series, comparison, composition).

trend_narrator

How it works

  • Summarizes chart data into a concise prompt (start/end values, change %, leader/laggard)
  • System prompt tailored to chart type: time-series → direction/rate of change, comparison → leader/laggard, composition → dominant segments
  • Regenerates within 3 seconds when chart data changes
  • Per-chart dismissal: click X to hide narration for a specific chart
  • Global disable available in AI Settings → Trend Narrator → Disable
Where: Below dashboard charts (Revenue vs Expenses, Cash Flow, Payroll, Profit Margin)Configurable: Per-chart dismissal (X button), Global disable toggle in AI Settings

Board Reporter

Creates investor/board-ready executive summaries with configurable sections, professional formatting, and PDF export.

board_reporter

How it works

  • Configurable sections: Financial Performance, Operational KPIs, Key Achievements, Risks & Challenges, Outlook
  • Configurable period: monthly, quarterly, or custom date range
  • Professional template with headings, bullet points, and metrics tables
  • Data completeness disclaimer automatically added when gaps exceed 5% of total records
  • Export to PDF format available
Where: Reports section — 'Generate Board Report' buttonConfigurable: Select which sections to include. Choose monthly/quarterly/custom period.

Utility Services

AI Copilot

Context-aware inline suggestions while you fill forms. Shows up to 2 non-intrusive suggestions based on form context, field values, and entity history.

ai_copilot

How it works

  • Analyzes current form context: form type, field values, selected customer/vendor, historical patterns
  • Detects: missing common fields, unusual values compared to history, related actions, time-saving shortcuts
  • Returns at most 2 suggestions at a time (highest priority first)
  • Per-type 'Don't show again': dismissing a suggestion type permanently hides that category
  • Global disable available: turn off all copilot suggestions from AI Settings
Where: Invoice, expense, purchase order, and other form pages (sidebar panel)Configurable: 'Don't show again' per suggestion type. Global disable in AI Settings → AI Copilot.

Workflow Advisor

Monthly usage pattern analysis that identifies repetitive manual processes, underutilized features, and inefficient workflows. Suggests automation with one-click setup.

workflow_advisor

How it works

  • Analyzes 30 days of activity logs for repetitive patterns (e.g., same invoice to same customer monthly)
  • Detects underutilized features (e.g., manual bank categorization when auto-categorize exists)
  • Identifies workflow bottlenecks (e.g., approvals waiting >2 days on average)
  • Limits to 5 active recommendations at a time — dismissed ones are replaced in next analysis
  • One-click automation setup for: recurring invoices, bank rules, approval workflows, scheduled reports
  • Tracks actual time savings after implementation over a 30-day period
Where: Dashboard recommendations widget, Settings pageConfigurable: Max active recommendations (default: 5) configurable in AI Settings

Email Composer

(Same as Generation → Email Composer. Listed here as it's a cross-module utility used from many contexts.)

email_composer_util
Where: Available from any record context: invoices, estimates, POs, customers, vendors, projects, leads

Transaction Categorizer

Suggests categorization for unreconciled bank transactions based on description keywords and historical patterns.

transaction_categorizer

How it works

  • Historical pattern matching: matches against previous categorization decisions for similar descriptions
  • Returns top 3 suggestions sorted by confidence (descending)
  • Returns no suggestions when all confidence scores are below 30%
  • Feedback learning: improves from accepted/rejected suggestions over time
Where: Bank reconciliation page, uncategorized transactions listThreshold: No suggestions shown when all confidence < 30%

Effort Estimator

Suggests time estimates for new project tasks based on keyword and category similarity with completed historical tasks.

effort_estimator

How it works

  • Extracts keywords from task title and computes Jaccard similarity against historical tasks
  • Factors: keyword match (40%), category match (30%), project type (15%), skill overlap (15%)
  • Returns weighted estimate with range (min, average, max) from similar tasks
  • Records accepted/overridden values for model improvement
  • Confidence levels: high (≥5 similar tasks with high similarity), medium, low (<5 similar tasks)
Where: Project task creation pagesThreshold: 'Limited data' flag when fewer than 5 similar tasks found

Resource Optimizer

Recommends team allocation improvements by detecting over-allocation (>110% capacity) and skill mismatches.

resource_optimizer

How it works

  • Computes available hours per team member (accounting for leave and existing commitments)
  • Detects over-allocation: assigned hours > 110% of available hours
  • Detects skill mismatches: task requires skills the assigned member lacks
  • Suggests specific reassignment actions with rationale and utilization impact
  • Recalculates on: task completion, new assignments, leave schedule changes
Where: Resource Optimization dashboard widget, project resource pagesThreshold: Over-allocation threshold: >110% capacity. Under-allocation: <50%.

Contact Timer

Determines the optimal day-of-week and time-of-day window for contacting a customer/lead based on their engagement history.

contact_timer

How it works

  • Analyzes email open times, call answer rates, and meeting acceptance patterns
  • Weights: call answered (1.5×), meeting accepted (1.3×), email opened (1.0×)
  • Identifies optimal 2-hour contact window and best day of week
  • Falls back to organization-wide patterns when a contact has fewer than 10 interactions
  • Monthly recalculation
Where: CRM contact detail pages, follow-up schedulingThreshold: Contact-specific analysis requires ≥10 interactions. Below 10, uses org-wide defaults.

Background Processing

AI services run on automatic schedules and react to real-time events:

ScheduleServices ExecutedPurpose
Daily (2:00 AM)Payment Predictor, Demand ForecasterScore all customers, project material needs
Weekly (Sunday 3:00 AM)Leave Analyzer, Data Quality Monitor, Churn PredictorDetect leave patterns, scan data quality, score churn risk
Monthly (1st at 6:00 AM)Summary Generator, Workflow Advisor, Lead Scorer (model update)Generate narratives, detect usage patterns, refine scoring model
Event-driven (real-time)Collection Scorer, Overrun Predictor, Cash Flow MonitorRecompute on invoice/payment/project/transaction changes (debounced 5s)

Alert System

When AI services detect issues, they generate alerts with three severity levels:

CRITICAL

In-app notification + email to finance_alerts users

Examples: Data quality score < 90%, large anomalous cash outflow, project overrun > 80%

WARNING

In-app notification only

Examples: Equipment maintenance due in 7 days, churn risk score > 70, leave pattern detected

INFO

In-app notification only

Examples: Maintenance due in 8-14 days, stale draft invoices detected

Dismissing alerts: When you dismiss an alert, the system records a sensitivity adjustment. For example, dismissing a Cash Flow Monitor alert widens the detection threshold by 0.5σ for that specific pattern, reducing future false positives without disabling the entire service.