210 accounts analyzed overnight. Your team reviews exceptions at 8 AM.
Cortex Sweep runs as a nightly batch when your fiscal period is open. Processing every account in a single pass. Stale run cleanup, auto-reconciliation, confidence scoring, materiality classification, the three-layer decision pipeline, Cortex rules, work paper generation, anomaly reasoning for RED accounts, and AI narratives for AMBER and RED. By morning, your controllers have a complete diff of what changed and where to focus.











The problem
Your close starts when your team logs in. What if 80% of the work was already done?
Every morning, your accountants open their queue and start the same cycle: check balances, run auto-recon, investigate variances, prepare work papers, document findings. Cortex Sweep does all of this overnight. When your team arrives, the GREEN accounts are documented, the AMBER accounts have narratives, and the RED accounts have completed investigations. Your team starts at the review stage, not the investigation stage. Part of Cortex. Read about AI investigation agents.
The sweep pipeline
11 steps, executed in order, every night
1. Stale run cleanup
Before starting, Cortex checks for incomplete BrainRun records from prior sweeps. Any stale runs are marked as failed with a reason. This ensures the sweep always starts from a clean state. No ghost processes, no orphaned locks.
2. Start BrainRun
A new BrainRun record is created for the sweep. This is the parent record that ties together every action, finding, and work paper generated during this execution. It tracks start time, end time, accounts processed, and total token usage.
3. Auto-reconciliation
Three methods run in priority order: zero-balance matching, tolerance matching, and no-activity detection. Accounts that pass auto-recon are immediately classified GREEN and receive template-based work papers. Typically 40–60% of accounts clear this step.
4. Confidence scoring
Every remaining account is scored using the deterministic 5-factor formula: variance materiality (35%), auto-recon result (20%), matching coverage (20%), materiality level (15%), and historical pattern (10%). Scores determine the GREEN / AMBER / RED classification.
5. Materiality classification
Accounts are classified by materiality level: critical, material, or immaterial. This feeds into the decision pipeline. The same variance triggers different actions depending on whether the account is a cash account or a low-risk prepaid.
6. Decision pipeline
Every potential Cortex action passes through three layers. Layer 1: SOX hard boundary (approvals, journal postings permanently blocked). Layer 2: Materiality threshold (immaterial items auto-execute, critical items block). Layer 3: Confidence self-awareness (low-confidence actions downgrade to suggestions). The most restrictive layer wins.
SWEEP vs. REACT
Batch processing when open, real-time when closing
SWEEP mode runs as a nightly batch when the fiscal period status is OPEN. It processes all accounts in a single pass. Ideal for the pre-close period when your team is preparing. REACT mode activates when the period enters IN_CLOSE status. In this mode, Cortex responds to events in real time: when a GL balance changes, a subledger import completes, or a reconciling item is updated, Cortex immediately re-scores and re-investigates the affected accounts. No waiting for the next nightly run.

Cost controls
Three cost tiers so you control exactly what Cortex spends
FULL: every AMBER and RED account gets investigation + narrative + anomaly reasoning. TOP_N: only the N highest-risk accounts get full treatment; the rest get scoring and template work papers. NARRATIVE_ONLY: Cortex generates narratives without running the investigation agent. Useful when you want analysis but not autonomous findings. A configurable max AI calls per sweep (default 50) prevents runaway costs. Token usage is tracked per sweep and per account.

The morning diff
A single summary of everything that changed overnight
At the end of every sweep, Cortex generates a diff: accounts whose confidence score moved up or down, new findings discovered, new reconciling items created, accounts that changed color (RED to AMBER, AMBER to GREEN), calibration adjustments applied, and any errors encountered. The diff is the first thing your controllers see. A concise summary that tells them exactly where to focus. No scrolling through 200 accounts to find the 12 that need attention.
