Historical Reconstruction Agent
Automated Account History Reconstruction for Salesforce
Instant account context — without opening a single related list.
See It In Action
Watch how the Historical Reconstruction Agent collects signals from nine Salesforce data sources and produces a complete, structured account narrative in a single click — no related list browsing required.
Historical Reconstruction Agent — Demo
Why Account Context Gets Lost
In most Salesforce orgs, customer history is scattered across related lists that no single screen brings together. When a rep or support agent changes accounts, all contextual knowledge leaves with them — and the new owner inherits a cold account with no usable narrative:
How the Historical Reconstruction Agent Works
The agent runs on demand from the Account page. A single button click triggers a fully automated pipeline that collects every available signal from nine Salesforce-native sources, sequences them chronologically, applies rule-based scoring, and surfaces a complete summary — all stored directly on the Account record:
Stage 1 — Data collected from nine Salesforce sources
ReconstructionEventService queries Opportunities, Opportunity Field History, Cases, Tasks, Events, Emails, Case Comments, Chatter posts, and Documents related to the account. Every record is normalized into a common event schema with a consistent timestamp, actor, and source record link.
Stage 2 — Rule-based scoring applied across the full event list
ReconstructionScoringEngine reads the normalized events and applies deterministic keyword-set and threshold rules to derive Risk Level (Low/Medium/High), Sentiment (Positive/Neutral/Negative), key events, escalations, pending issues, and a recommended next action — entirely within Apex, with no external model calls.
Stage 3 — Narrative summary assembled from counted fields
ReconstructionSummaryBuilder constructs a plain-language paragraph covering relationship length, win/loss record, support picture, engagement level, current opportunity stage, and overall risk and sentiment. Every sentence is built from aggregated figures — running the agent twice on unchanged data produces an identical result.
Stage 4 — Results persisted to the Account record
ReconstructionOrchestrator deletes prior event records, inserts the newly normalized events, and updates the Account with the summary, risk level, sentiment, key events, escalations, pending issues, recommended action, and last-run timestamp — all visible immediately on the Account Summary tab.
Functional Flow Diagram

Functional flow: from the on-demand button click through data gathering, timeline assembly, automated health assessment, and persisted results on the Account record.
Every signal captured from Salesforce is normalized into a common event format before scoring and summarization. No source is treated differently — the scoring engine never needs to know which object an event originally came from.
| Source | What is captured |
|---|---|
| Opportunity | Creation event with stage, amount, and win/loss outcome. |
| Opportunity Field History | Tracked changes to stage, amount, and close date. |
| Case | Subject, status, priority, and escalation flag. |
| Task | Completed or overdue activities, with type and status. |
| Event | Logged meetings, with subject and duration. |
| Email Message | Inbound and outbound correspondence, subject and truncated body. |
| Case Comment | Public and internal notes on cases, linked to the parent case. |
| Chatter Feed Item | Text posts made directly on the account. |
| Content Document | Files linked to the account, by title and file extension. |
Technical Solution Overview
The Historical Reconstruction Agent is a fully native solution built on Salesforce Apex and SOQL. The on-demand orchestration layer runs end-to-end in a single synchronous transaction — collecting every available signal from nine Salesforce sources, sequencing them chronologically, applying rule-based scoring, and surfacing a complete account narrative directly on the Account record — rather than waiting for a rep to piece it together manually.
Each capability is delivered through Salesforce technologies as follows:
Architecture principle: Deterministic Apex guarantees accuracy, auditability, and data residency for everything involving account scoring and risk classification; narrative language is assembled from aggregated figures rather than generative output; and the on-demand orchestration layer makes the system immediately actionable — a single button click on the Account page runs the full pipeline with no background jobs, no scheduling, and no data ever leaving the Salesforce org.
Key Features
Rule-Based Risk and Sentiment Scoring — No External Calls
Every output is produced by deterministic Apex logic operating on keyword sets and thresholds. No data leaves the Salesforce org. No AI model or external service is involved — every score is computed entirely within the transaction.
| Risk level | Trigger condition |
|---|---|
| High | 2+ escalation events, OR 2+ lost opportunities, OR no activity in over 180 days. |
| Medium | 1 escalation event, OR more than 2 open cases, OR no activity in over 90 days. |
| Low | None of the above conditions are met. |
| Sentiment | Trigger condition |
| Positive | Positive keyword matches exceed negative by more than 2. |
| Negative | Negative keyword matches exceed positive matches. |
| Neutral | Neither condition above is met. |
Key Event and Escalation Flagging — Individual Event Level
Each event is evaluated independently and flagged when it represents an escalation, an opportunity stage change, a win or loss, a case escalation, or a contract document. Flagged events are written to the Is_Key_Event__c field on the event record and filterable independently of the account summary.
On-Demand Refresh — Immediate Results from the Account Page
The agent runs synchronously when a user clicks the Reconstruct History button on the Account page. There is no scheduled background job and no delay — results are visible on the Summary tab within the same page session.
Fully Native Salesforce — No External Dependencies
The entire solution runs within native Apex and SOQL. No external callouts, no managed packages, no additional licensing. All output is stored on standard Salesforce objects.
Solution Tech Highlights
The agent is built entirely on declarative and programmatic Salesforce technology. There is no AI model, no external service, and no integration layer of any kind — every component below ships and runs inside the org.
Salesforce Components
Third-Party / External Components
None. Unlike AI-driven solutions that depend on an external model API, the Historical Reconstruction Agent makes no outbound callouts and has no third-party dependency of any kind:
Business Impact
The Historical Reconstruction Agent removes the manual effort of piecing together account history and delivers immediate context to every person who touches the account.
| For Sales Representatives | For Sales Managers & Team Leads | For Operations & Business Leaders |
|---|---|---|
| Inherit a new account with a full history narrative and risk assessment — not a cold record | Instant risk and sentiment read on any account without manually reviewing all activity | Reduce the cost of account transitions — new owners are productive from day one |
| Understand where things stand in minutes, not hours of reading old emails and notes | Identify at-risk accounts — escalations, open cases, and inactivity — before pipeline reviews | Auditable event records for every account capture CRM signals even when hygiene is imperfect |
| Receive a single, clear recommended next action written to the account every time you refresh | Consistent account assessments across the team — not dependent on individual note-taking | No additional licensing, no external tools, no implementation beyond the native deployment |
| Key events, escalations, and pending issues surfaced in one chronological timeline | Historical event records available for reporting and trend analysis without extra tooling | Scales with the account base — each run is scoped to one account and stays within governor limits |
