<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Beau32 on Medium]]></title>
        <description><![CDATA[Stories by Beau32 on Medium]]></description>
        <link>https://medium.com/@beau32?source=rss-f93edef1348c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qNgiibtIoNHdGDkR</url>
            <title>Stories by Beau32 on Medium</title>
            <link>https://medium.com/@beau32?source=rss-f93edef1348c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:59:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beau32/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Brain, Every Touchpoint: Building Adaptive, Multi-Channel Agentforce Architectures]]></title>
            <link>https://pub.towardsai.net/one-brain-every-touchpoint-building-adaptive-multi-channel-agentforce-architectures-d3c16af9b4c7?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c16af9b4c7</guid>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[agentforce]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 12:01:02 GMT</pubDate>
            <atom:updated>2026-10-05T12:01:02.481Z</atom:updated>
            <content:encoded><![CDATA[<h4>The true value of Salesforce Agentforce isn’t just launching an AI chatbot on a website — it’s <strong>channel abstraction</strong>.</h4><p>Instead of building siloed bots for Web Chat, Email, and Voice, modern architecture decouples reasoning from presentation. A single Agentforce instance — configured with unified <strong>Topics</strong>, <strong>Actions</strong>, <strong>Guardrails</strong>, and <strong>Data 360</strong> retrievers — serves as a central intelligence engine. The underlying delivery pipes and runtime adapters modify how that core intelligence presents itself based on where the user is interacting.</p><h3>The Adaptive Runtime: How One Agent Serves Three Modalities</h3><p>When an inbound event triggers an Agentforce topic, the Atlas Reasoning Engine executes the exact same underlying Flow or API action. However, the connection key determines the output adaptation:</p><ul><li><strong>Web &amp; Live Messaging (Synchronous Digital):</strong> Operates over persistent WebSocket connections via Messaging for In-App and Web (MIAW). The response adapter injects rich UI components — such as quick-reply buttons, interactive carousels, or dynamic forms — directly into the web client.</li><li><strong>Email &amp; Async Pipelines (Asynchronous Text):</strong> Triggered via Email-to-Case or API ingestion. The exact same reasoning chain generates formal, multi-paragraph markdown or HTML responses, taking into account long thread histories and attached documentation.</li><li><strong>Voice &amp; Telephony (Real-Time Audio):</strong> Integrated via Service Cloud Voice or Amazon Connect. The runtime formats responses into short, conversational turns optimized for low-latency Text-to-Speech (TTS) synthesis and live interruption/barge-in handling.</li></ul><h3>Front-End Choices for Internal CRM Users</h3><p>For internal enterprise teams working within Salesforce, surfacing this central AI engine happens through three distinct front-end patterns:</p><h3>1. Agentforce Coworker</h3><p><strong>The Ubiquitous Workspace Surface</strong></p><p>Agentforce Coworker transforms the standard Global Search bar into a persistent conversational workplace assistant.</p><ul><li><strong>Interaction Pattern:</strong> Ubiquitous and conversational. Users switch between standard search and <strong>Ask Mode</strong> at the top of the application.</li><li><strong>Scope &amp; Grounding:</strong> Pulls plain-language answers across CRM records, connected Data 360 objects, and Slack threads.</li><li><strong>Capabilities:</strong> Executes natural language record updates directly from the search bar (with permission checks) and acts as a master router to dispatch tasks to specialized backend agents.</li><li><strong>Best Used For:</strong> Rapid internal lookups, ad-hoc record mutations, and cross-application context discovery.</li></ul><h3>2. Sidebar Panel (Agentforce Assistant)</h3><p><strong>The Contextual Record Co-Pilot</strong></p><p>While Coworker is workspace-wide, the Sidebar Panel is tied directly to the record or conversation currently open on the user’s screen.</p><ul><li><strong>Interaction Pattern:</strong> In-context and passive/assistive. It monitors the active record (Case, Account, Opportunity, or Messaging Session) and provides real-time recommendations.</li><li><strong>Capabilities:</strong> Generates instant summaries of long email threads or chat histories upon page load, pre-fills outbound replies for human editing, and executes inline actions without navigating away from the page.</li><li><strong>Best Used For:</strong> Dedicated service workspaces, complex case investigations, and human-in-the-loop review steps during live customer interactions.</li></ul><h3>3. Custom UI (Custom LWC &amp; Headless API)</h3><p><strong>The Bespoke Enterprise Workstation</strong></p><p>For enterprise teams needing custom layouts, Lightning Web Components (LWCs) or headless API integrations decouple the Atlas reasoning engine from standard out-of-the-box Salesforce containers.</p><ul><li><strong>Interaction Pattern:</strong> Tailored and embedded. Built as custom LWCs inside the Service Console or integrated into third-party desktops via APIs.</li><li><strong>Capabilities:</strong> Renders specialized UI cards, multi-system telemetry views, and custom action buttons driven by Agentforce outputs, while integrating directly into third-party CTI softphones or external agent frames.</li><li><strong>Best Used For:</strong> Complex contact center desktops, industry-specific workstations (such as insurance claims or clinical health views), and multi-screen agent environments.</li></ul><h3>Handoff Mechanics: Transitioning from Agent to Human</h3><p>When an agent hits a guardrail, low confidence score, or explicit transfer request, the handoff behavior adapts based on the active channel:</p><ul><li><strong>Chat Handoff (Instantaneous):</strong> The Agentforce engine invokes an Omni-Channel Flow, passing MessagingSessionId, ContactId, and EscalationReason. The chat session remains connected seamlessly while Omni-Channel routes the work item to an agent&#39;s <strong>Enhanced Conversation Canvas</strong>, pre-populating a live AI conversation summary.</li><li><strong>Voice Handoff (Real-Time SIP Bridge):</strong> The telephony gateway pauses automated audio processing and routes the VoiceCall record via Omni-Channel. The SIP audio stream reroutes to the human agent&#39;s softphone headset, while the workspace automatically opens the real-time audio transcript player and a 3-bullet briefing panel.</li><li><strong>Email Handoff (Asynchronous Review Queue):</strong> For low-confidence or sensitive topics, the agent does not send the email. Instead, it assigns the Case to an Omni-Channel queue with a status of Pending Agent Review. When opened, the human agent finds the <strong>Email Composer</strong> pre-populated with an AI-generated draft ready for review and editing.</li></ul><h3>Experience Site Deployment: Enhanced Messaging for Web</h3><p>When surfacing Agentforce on Salesforce Experience Cloud (LWR or Aura sites), deployment relies on <strong>Messaging for In-App and Web (MIAW)</strong> — often referred to in the architecture as <strong>Enhanced Web Messaging</strong> or <strong>Enhanced Chat v2</strong>.</p><p>Unlike legacy Live Agent, MIAW operates on persistent asynchronous infrastructure (built on Hyperforce/Salesforce Edge), enabling persistent chat sessions, pre-chat context binding, and native token-based user verification.</p><h3>Authentication &amp; Context Binding Options</h3><p>When embedding the <strong>Embedded Messaging LWC</strong> component on an Experience Site, you have two primary setup choices for identity:</p><ul><li><strong>Authenticated (Credential / Token-Based Verification):</strong> When logged-in users open the chat, the web client passes a JWT/User token to Salesforce. The platform binds the active $User.Id, ContactId, and AccountId directly to the MessagingSession record before the Agentforce agent runs its first reasoning cycle.</li><li><strong>Guest / Unauthenticated Mode:</strong> For public-facing sites, the agent initiates in guest mode. Context must be passed either via a Pre-Chat form component (mapping fields like Name, Email, and Subject) or through custom JavaScript APIs (embedded_svc.bootstrap.settings) before invoking the agent.</li></ul><h3>Step-by-Step Execution Flow: Chat Handoff to Human Agent</h3><p>The transition from an autonomous Agentforce instance to a human service rep in the Service Console follows a single, uninterrupted session thread. The customer’s chat window never reloads, ensuring zero friction.</p><p><strong>1.Handoff Trigger Identification:</strong>Step 1: Intent or Guardrail Breach.</p><p>The customer requests a representative, or Atlas reasoning hits a system guardrail (e.g., consecutive low-confidence responses, negative sentiment threshold, or explicit action failure).</p><p><strong>2.Omni-Channel Flow Invocation:</strong>Step 2: Routing Execution.</p><p>Agentforce executes a system transfer action that passes execution control directly to an Omni-Channel Flow.</p><p>The agent passes key context variables into the flow:</p><ul><li>MessagingSessionId (the active persistent session)</li><li>ContactId &amp; AccountId (resolved identity context)</li><li>EscalationReason &amp; AgentforceSessionSummary</li></ul><p><strong>3.Queue &amp; Skill Evaluation:</strong>Step 3: Work Distribution.</p><p>The Omni-Channel Flow evaluates queue availability, required agent skills (e.g., Spanish Language, Tier-2 Billing), and real-time human agent capacity.</p><p>While waiting in the queue, the client UI displays a status message (<em>“Connecting you to a representative…”</em>).</p><p><strong>4.Console Accept &amp; State Sync:</strong>Step 4: Human Workspace Launch.</p><p>The work item pops up in the target representative’s Omni-Channel utility widget.</p><p>When the rep accepts the request:</p><ul><li>The Enhanced Conversation Canvas opens automatically inside the Service Console.</li><li>The complete turn-by-turn transcript between the end-user and Agentforce renders seamlessly.</li><li>An AI-generated Session Summary Card provides the rep with the customer’s intent and reason for transfer before their first greeting.</li></ul><h3>Technical Routing Architecture Summary</h3><ul><li><strong>Front-End Component:</strong> Embedded Messaging LWC placed on the Experience Site template footer.</li><li><strong>Channel Definition:</strong> Messaging for In-App and Web (MIAW) Channel.</li><li><strong>Primary Entry Point:</strong> Omni-Channel Flow configured with Route To: Agentforce Service Agent.</li><li><strong>Fallback &amp; Escalation:</strong> Omni-Channel Flow reroutes the active MessagingSession record from the Agentforce Agent ID to a Human Queue/Skill set.</li></ul><h3>Delivery Integrity Across the Boundary</h3><p>This handoff flow demonstrates why treating the deployment as a single agent instance matters. The end user on the Experience Site experiences a single continuous chat thread, while the internal service representative receives a fully populated workspace containing identity context, conversation state, and transfer reasoning.</p><p>By grounding the Experience Site deployment in MIAW and Omni-Channel Flows, the channel runtime handles the transport, identity passing, and UI rendering natively. The Agentforce agent remains focused purely on topic evaluation, action execution, and knowledgable handoff triggers.</p><p>Here is a consolidated structural overview of how all the components we have covered fit together for your full article:</p><p><strong>Introduction &amp; Single-Agent Core:</strong> Establishing the architecture where one Agentforce instance (Topics, Actions, Data 360) connects to multiple channels.</p><p><strong>Channel Modality Adaptations:</strong> How the same agent execution logic formats outputs differently for Web Messaging, Email, and Voice.</p><p><strong>Internal CRM Front-End Options:</strong></p><ul><li><strong>Agentforce Coworker:</strong> Global search and workplace conversational interface across CRM, Data 360, and Slack.</li><li><strong>Sidebar Panel (Agentforce Assistant):</strong> Contextual record co-pilot in the utility bar for active cases, emails, or calls.</li><li><strong>Custom UI:</strong> Specialized Lightning Web Components and headless API integrations for custom workstations or CTI frames.</li></ul><p><strong>Experience Site &amp; Web Deployment (MIAW):</strong></p><ul><li>Authenticated JWT token passing vs. Guest pre-chat context binding.</li><li>Step-by-step Omni-Channel Flow routing from agent execution to human escalation.</li></ul><p><strong>Cross-Channel Handoff Mechanics:</strong> Real-time chat transfer, SIP audio rerouting for Voice, and asynchronous review draft queues for Email.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c16af9b4c7" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/one-brain-every-touchpoint-building-adaptive-multi-channel-agentforce-architectures-d3c16af9b4c7">One Brain, Every Touchpoint: Building Adaptive, Multi-Channel Agentforce Architectures</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Verified Insurance Policy Dataset in Salesforce Data 360]]></title>
            <link>https://medium.com/@beau32/building-a-verified-insurance-policy-dataset-in-salesforce-data-360-37df22179e50?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/37df22179e50</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[data-360]]></category>
            <category><![CDATA[insurance]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 01:31:54 GMT</pubDate>
            <atom:updated>2026-09-06T01:31:54.710Z</atom:updated>
            <content:encoded><![CDATA[<p>Interpreting policy wording and answering coverage questions requires a clear account of the policy state, the applicable terms, and the evidence supporting them. This article proposes a fundational architecture that leverages the capabilities of salesforce data 360 aka data cloud, brings together three essential sources in one place:</p><ol><li><strong>Policy administration database</strong>: the contractual state. Policy records identify insured assets, participants, coverages, limits, and endorsements. Effective dates and recorded history establish which version applies to the enquiry.</li><li><strong>Documentation ingestion</strong>: the wording and its context. Policy PDFs, schedules, endorsements, and client communications such as passbacks supply clauses, definitions, exclusions, and amendment history. Versioned links connect each source to the relevant policy and coverage, with its reviewed authority and applicability.</li><li><strong>Transaction ledger on blockchain</strong>: recorded events and verification evidence. Where deployed, the ledger records selected contract events, document commitments, and attestations. These support checks on document integrity, event provenance, and the identity of the policy or rules version used in a decision.</li></ol><p>Data 360 connects these sources into a dataset for coverage interpretation. The database establishes policy state, the documents supply the applicable language, and ledger evidence supports defined verification checks. Approved policy rules and authorized review determine the resulting coverage conclusion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDEBLfR6pi1b3RFqk4a1lA.png" /><figcaption>Policy Architecture On Data 360</figcaption></figure><p>Here is one real world example.</p><p>A commercial property policy covers Building A, Building B, and a printing press inside Building A. Property damage coverage applies to both buildings under a shared limit. An equipment endorsement adds cover for the press, effective 1 June and recorded on 15 June.</p><p>Answering a question about that policy requires connected records, the applicable wording, and a reliable history of changes. Salesforce Data 360, formerly Data Cloud, can assemble this context from structured policy systems, PDF documents, and, where used, blockchain event records. <a href="https://www.salesforce.com/data/">[Salesforce: Data 360]</a>.</p><p>This article develops the data foundation: identity, relationships, document versions, temporal context, and verification evidence. The companion article, <em>From Policy Context to Coverage Answers with Agentforce</em>, explains how an agent uses that foundation to retrieve evidence and invoke approved decision rules.</p><h3>Three sources, one connected dataset</h3><p>Authoritative policy systems maintain contractual state. Data 360 harmonizes and connects selected records. Document ingestion makes wording and communications searchable. An optional blockchain integration provides recorded commitments and attestations for specific verification checks.</p><p>Azure SQL can hold authoritative bitemporal policy state in this architecture. Another governed operational store can fulfill the same responsibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0Uj-TvuVN-gOoPf49p2wg.png" /></figure><p>PolicyDocumentLink is the explicit association between structured policy records and document versions. Each indexed chunk carries its source document-version identifier. Verification records link through policy, document, and ruleset identifiers as appropriate.</p><p>The Policy Data Graph assembles selected relationships and references. Document search and verification remain supporting services accessed through those references. Each pipeline has its own readiness and freshness checkpoint.</p><p>A Data Lake Object (DLO) represents ingested source data. Data Model Objects (DMOs) provide the harmonized structure, and DMO relationships define the paths available for graph assembly.</p><p>A Data Graph returns the selected context as JSON. <a href="https://help.salesforce.com/s/articleView?id=sf.c360_a_data_graph_data_structures.htm&amp;language=en_US">[Data Graph Data Structures]</a>.</p><h3>What is the root of the insurance graph?</h3><p>Use Insurance Policy as the primary DMO for a policy enquiry graph.</p><p>The business entry point is typically a policy number such as P10027. The integration resolves that number, together with insurer, source system, and policy term where necessary, to the primary key used by the graph. Maintain stable identifiers and source-key mappings across ingestion and harmonization.</p><p>Salesforce documents an Insurance Policy DMO with an `Id` primary key and fields for policy number and a universal policy identifier. The Data Graph root key is the primary key of its primary DMO. <a href="https://developer.salesforce.com/docs/data/data-cloud-dmo-mapping/guide/c360dm-si-insurancepolicydmo-dmo.html">[Insurance Policy DMO]</a>, [Data Graph configuration]</p><p>For this example, P10027 resolves to policy key POL-10027. A separate policy version identifier selects the contractual snapshot used by the authoritative service. All short identifiers below are illustrative integration identifiers; production mappings must satisfy the target fields’ formats and lengths.</p><h3>What belongs directly to the policy?</h3><p>Start with the entities needed for the enquiry: insured assets, participants, coverages, and relevant transactions. Include document references and claims when they support the requested workflow.</p><p>For P10027, the working set consists of three insured assets, the policyholder, property damage coverage, equipment coverage, and the endorsement that adds the press. Document references identify the schedule and endorsement wording.</p><p>Salesforce’s Insurance Policy Management model provides domain entities for policies, assets, participants, coverages, attributes, and related objects. Implementation then requires an explicit mapping to the DMOs available in the target organization. <a href="https://developer.salesforce.com/docs/platform/data-models/guide/insurance-policy-management.html">[Insurance Policy Management model]</a></p><p>The proposed mapping starts with four Salesforce entities:</p><p>Policy records map to Insurance Policy DMO.</p><ul><li>Use a policy key for relationships and a policy number for business lookup. Confirm the deployed API names for this documented DMO.</li></ul><p>Insured items map to Insurance Policy Asset DMO.</p><ul><li>Retain a policy asset key and its policy key. This DMO appears in the catalog; validate its deployed fields.</li></ul><p>Coverage records map to Insurance Policy Coverage DMO.</p><ul><li>Retain a coverage key, policy key, and asset reference where applicable. This is a documented DMO.</li></ul><p>Policy member-to-asset links map to Insurance Policy Member Asset DMO. Each link carries its own key plus references to the participant and policy asset. This is a documented DMO.</p><p>The proposed custom structures connect assets, evidence, and history:</p><p>- <strong>AssetRelationship</strong> captures physical asset associations. Each record has a relationship key, policy key, and from/to asset keys.<br>- <strong>CoverageAsset</strong> captures shared coverage applicability. Each record has a link key, policy key, coverage key, and asset key.<br>- <strong>DocumentVersion</strong> registers an immutable PDF version with its content hash, source location, and ingestion status. Its identifier also appears in the indexed clause metadata.<br>- <strong>PolicyDocumentLink</strong> associates a policy with a document version. It carries a link version key, policy key, document-version key, evidence role, and valid-time and recorded-time intervals. Optional typed coverage, asset, and endorsement references identify a more specific scope.<br>- <strong>A versioned context projection</strong> carries historical terms and relationships from the authoritative system. It retains record version keys, policy versions, and valid-time and recorded-time intervals.</p><p>A shared wording can have several PolicyDocumentLink records, each expressing applicability to a specific policy. Keep DocumentVersion identity stable when an association changes; version the association to preserve its history. Configure explicit typed relationships for any coverage, asset, or endorsement references.</p><p>The Coverage DMO documents policy and asset references, coverage dates, limits, and deductibles. The Member Asset DMO documents references to a policy participant and a policy asset. These provide concrete mapping starting points. <a href="https://developer.salesforce.com/docs/data/data-cloud-dmo-mapping/guide/c360dm-si-insurancepolicycoveragedmo-dmo.html">[Coverage DMO]</a>, [Member Asset DMO].</p><p>Confirm availability, API names, field types, and relationship metadata in the target org. The linked standard-DMO catalog currently carries a developer-preview notice, so release status is part of this validation. Attribute structures and custom extensions also need their own mappings. <a href="https://developer.salesforce.com/docs/data/data-cloud-dmo-mapping/guide/c360dm-si-entity-interface-dmos-introduction.html">[Standard DMO catalog]</a>.</p><h3>How are assets represented?</h3><p>Give each insured item its own policy asset record and retain a reference to its enduring physical identity. This separates the physical item from its participation in a particular policy term.</p><p>The example contains three policy asset records:</p><p><strong>A-001: Building A</strong>, at 12 Harbour Road, used for light manufacturing.<br><strong>A-002: Building B</strong>, at 14 Harbour Road, used for storage.<br><strong>A-003: Printing Press 01</strong>, a piece of printing equipment with serial number PRESS-001.</p><p>The physical relationship records that A-003 is located within A-001. The coverage applicability records establish which contractual protection applies to each asset. These relationships have distinct meanings and may change on different dates.</p><p>For example, moving the press to Building B updates its location relationship. Any corresponding coverage change follows the policy’s terms and endorsement process. This separation supports clear explanations of both physical context and contractual applicability.</p><p>Salesforce’s insurance learning material describes how policy assets and coverages relate within the policy model. [Policy coverage, assets, and transactions].</p><h4>How do we establish relationships between them?</h4><p>Define the business relationship, its keys, and its cardinality before configuring the DMO relationship. The diagram below describes the logical domain model; graph assembly selects supported paths from it.</p><pre>Policy POL-10027<br> |<br> + - Assets (1:N)<br> | + - A-001: Building A<br> | + - A-002: Building B<br> | + - A-003: Printing Press 01<br> |<br> + - Coverages (1:N)<br> | + - C-PD: Property damage, shared limit NZD 5,000,000<br> | + - C-EQ: Equipment damage, limit NZD 500,000<br> |<br> + - AssetRelationship records (1:N)<br> | + - R-001: A-003 - locatedWithin → A-001<br> |<br> + - CoverageAsset records (1:N)<br> + - CA-001: C-PD - appliesTo → A-001<br> + - CA-002: C-PD - appliesTo → A-002<br> + - CA-003: C-EQ - appliesTo → A-003</pre><p>C-PD retains one shared limit. Both building associations reference that coverage, preserving the scope of the limit across the two assets.</p><p>The logical joins make each traversal direction explicit:</p><p>- <strong>Policy to policy asset (1:N):</strong> join `Policy.Id` to `PolicyAsset.PolicyId`. One policy can contain several insured assets.<br>- <strong>Policy to asset relationship (1:N):</strong> join `Policy.Id` to `AssetRelationship.PolicyId`. One policy can contain several asset associations.<br>- <strong>Asset relationship to target asset (N:1):</strong> join `AssetRelationship.ToAssetId` to `PolicyAsset.Id`. Several relationship records can reference the same target asset.<br>- <strong>Coverage to applicability link (1:N):</strong> join `Coverage.Id` to `CoverageAsset.CoverageId`. One coverage can apply through several links.<br>- <strong>Applicability link to asset (N:1):</strong> join `CoverageAsset.AssetId` to `PolicyAsset.Id`. Several coverage links can reference the same asset.<br>- <strong>Policy to document link (1:N):</strong> join `Policy.Id` to `PolicyDocumentLink.PolicyId`. One policy can reference several document versions.<br>- <strong>Document link to document version (N:1):</strong> join `PolicyDocumentLink.DocumentVersionId` to `DocumentVersion.Id`. Several policies can share a wording version.</p><p>The same document-version identifier is carried into the search metadata for its chunks. This identifier lets an authorized retrieval service restrict searches to the selected versions. Its mapping to the chosen index fields is an ingestion responsibility.</p><p>These joins are conceptual field names for the example. Configure them using the actual mapped fields, primary keys, and source-key qualification in the organization. Salesforce supports defining relationships between DMOs through its relationship configuration. <a href="https://help.salesforce.com/s/articleView?id=sf.c360_a_data_model_object_relationships.htm&amp;language=en_US&amp;type=5">[DMO relationships]</a>.</p><p>An illustrative custom asset relationship record is:</p><pre>{<br> &quot;relationshipId&quot;: &quot;R-001&quot;,<br> &quot;recordVersionId&quot;: &quot;R-001-V1&quot;,<br> &quot;policyId&quot;: &quot;POL-10027&quot;,<br> &quot;fromAssetId&quot;: &quot;A-003&quot;,<br> &quot;toAssetId&quot;: &quot;A-001&quot;,<br> &quot;relationshipType&quot;: &quot;locatedWithin&quot;,<br> &quot;validFrom&quot;: &quot;2026–01–01T00:00:00+13:00&quot;,<br> &quot;validTo&quot;: &quot;2027–01–01T00:00:00+13:00&quot;,<br> &quot;recordedFrom&quot;: &quot;2025–12–20T09:00:00+13:00&quot;,<br> &quot;recordedTo&quot;: null<br>}</pre><p>Here, valid time describes when the relationship applies in the business domain. Recorded time describes when that version was held in the authoritative system. Intervals use an inclusive start and exclusive end; a null end represents an open interval. The authoritative service applies the same convention to coverage, applicability links, and policy terms.</p><h3>How do we assemble the graph?</h3><p>Build an enquiry graph around the policy DMO, selecting the assets, coverages, relationship records, and fields needed for the workflow.</p><p>A practical implementation follows this sequence:</p><p>1. Map source data to the chosen DMOs and validate primary keys, foreign keys, and source qualification.<br>2. Check relationship data for missing references, duplicate links, and inconsistent policy membership.<br>3. Configure the policy as the primary DMO and select the related objects and fields.<br>4. Choose the graph type based on traversal paths and freshness requirements.<br>5. Inspect the assembled JSON for P10027, including both buildings, the press, the three coverage links, and the applicable PolicyDocumentLink references.<br>6. Exercise an endorsement update, a document replacement, and a historical link lookup. Verify the resulting graph, search-index readiness, and refresh behavior.</p><p>Salesforce supports 1:1 and 1:N relationships in real-time Data Graphs and restricts N:1 paths in newly created or edited real-time graphs. Existing real-time graphs with N:1 paths reflect parent changes after a rebuild or configured refresh. Standard graphs retain N:1 support. <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_dg_n1_restriction.htm&amp;language=en_US&amp;type=5">[DMO relationship handling in Data Graphs]</a>.</p><p>A junction record can introduce an N:1 path when traversing to its referenced asset or DocumentVersion. Choose the representation accordingly:</p><h4>Standard Data Graph</h4><p>Use a standard graph for enquiries that require N:1 paths and can accommodate the configured refresh latency. Establish freshness expectations and monitor refresh completion.</p><h4>Real-time projection</h4><p>Use a real-time projection for enquiries served through supported 1:1 and 1:N paths. Prepare child rows owned by the policy with the required attributes, and propagate source changes to those rows.</p><h4>Graph plus separate lookups</h4><p>Use the graph for selected policy context and supplement it with lookups for shared asset, term, or document-version metadata. Coordinate authorization, version selection, and freshness across those calls.</p><p>The real-time projection is a proposed integration design. Its duplicated attributes require an explicit update process. For real-time joins, Salesforce also requires the referenced parent join field to be its primary key. <a href="https://help.salesforce.com/s/articleView?id=release-notes.rn_cdp_2026_winter_n1_relationship_dg.htm&amp;release=258&amp;type=5">[Primary-key join requirements]</a>.</p><h4>Ingesting and linking policy PDFs</h4><p>Extend the context with policy wording PDFs, schedules, endorsements, and client or broker communications. Here, passbacks means the questions, clarifications, and proposed changes exchanged during placement, renewal, or endorsement. Preserve the originating message and attachments when a passback is captured as a PDF.</p><p>Each source contributes a different kind of evidence:</p><p>- <strong>Policy wordings</strong> supply insuring clauses, definitions, exclusions, conditions, and cross-references.<br>- <strong>Schedules and endorsements</strong> identify selected coverages, insured assets, limits, and changes to the applicable wording.<br>- <strong>Client communications and passbacks</strong> record declared facts, requested amendments, responses, and outstanding questions.</p><p>The proposed ingestion pipeline connects this evidence to the structured policy graph:</p><pre>PDFs -&gt; Immutable DocumentVersion -&gt; Extract / OCR / validate<br> | |<br> | v<br> | Clause chunks with version IDs<br> | |<br> | v<br> | Data 360 search index<br> |<br>Policy DMOs -&gt; PolicyDocumentLink<br> |<br> v<br>Policy Data Graph: context and document references</pre><p>Data 360 supports unstructured content, including PDFs, through supported ingestion routes. Choose the route for the document repository and validate its parsing capabilities against representative files. For Salesforce CRM attachments, the documented workflow uses content data streams and a search index to ingest searchable file content. <a href="https://help.salesforce.com/s/articleView?id=sf.c360_a_unstructured_data_about.htm&amp;language=en_US&amp;type=5),%20[CRM%20attachment%20ingestion](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_connect_content_document.htm&amp;language=en_US&amp;type=5">[Unstructured data]</a>.</p><p>Implement the pipeline in five stages:</p><p><strong>Register the original.</strong> Retain an immutable file version, content hash, source location, document type, issuer or sender, recipient, and received timestamp. Track issue dates, effective dates, and recorded-time history separately.</p><p><strong>Extract and validate.</strong> Extract native PDF text and apply OCR to scanned pages through the chosen processing pipeline. Check clause numbering, reading order, schedules, monetary values, and attachments. Route ambiguous extraction for review before promoting it to decision evidence.</p><p><strong>Preserve clause context</strong>. Create chunks around clauses and sections, retaining headings, definitions, exceptions, and cross-reference identifiers. Store page locations and links to the exact source version. Retrieval can then expand a match to include its governing definition or exception.</p><p><strong>Link evidence to the policy. </strong>Use proposed custom DocumentVersion and PolicyDocumentLink records to associate documents with policy terms, assets, coverages, and endorsements. A shared wording can serve several policies through explicit links. Version each association with effective and recorded intervals, preserving both the original PDF and the history of its applicability. Validate automated classification and linkage before making those associations authoritative.</p><p><strong>Index and monitor.</strong> Build a search index and retriever, track processing completion, and carry supersession and access changes into retrieval. A coverage action checks both graph freshness and document-index readiness.</p><p>These document records, clause links, and provenance fields are application design elements. Configure or populate them in the ingestion pipeline and action response. Data 360 provides vector and hybrid search indexes; hybrid search combines semantic matching with keyword matching, which suits clause identifiers, asset names, and coverage terminology. <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_process_content_search_index.htm&amp;language=en_US&amp;type=5">[Data 360 Search Index]</a></p><h3>Establishing documentary authority</h3><p>Assign each document an evidence role and a reviewed status. For example, a passback may be a requested change, an underwriting clarification, or evidence of an accepted amendment. Record the approving authority, acceptance evidence, and associated issued endorsement where applicable. Assess its contractual effect under the applicable policy and governance process.</p><p>The system uses that recorded authority and the policy’s precedence rules to resolve competing terms. Search relevance determines which passages are useful to examine; contractual status determines how they contribute to a decision. Preserve superseded versions for historical enquiries and select the version appropriate to both effective-at and known-at time.</p><p>For the press example, a passback requesting cover from 1 June supplies the request history. An accepted and issued endorsement linked to C-EQ supplies the documented change. Keeping those sources connected allows the answer to explain the request, the acceptance record, and the resulting coverage terms. Unresolved differences become a specific referral to an authorized reviewer.</p><p>How does blockchain evidence strengthen verification?</p><p>Blockchain event records can enter Data 360 through an external listener or indexer and the Ingestion API. Salesforce supports streaming updates and bulk ingestion through an ingestion data stream. The listener, validation logic, and policy-specific verification model are proposed integration components.<a href="https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-ingestion-api.html"> [Salesforce Ingestion API]</a></p><p>A practical pipeline performs four operations:</p><p>1. Read events from the intended chain and approved contracts.<br>2. Validate event origin and finality according to that chain, decode the payload, and retain the source identifiers.<br>3. Normalize events into records and send incremental changes to the configured ingestion stream.<br>4. Link those records to policy bindings, document versions, and ruleset versions for verification services to examine.</p><p>Retain the chain ID, contract address, transaction hash, event position, block hash and height, finality status, observed time, and ingestion time. Use stable event identifiers for duplicate handling. Track canonical status and reconcile reorganized events, including their downstream verification results.</p><p>Proposed custom BlockchainEvent and VerificationResult records separate what was observed from what was checked. A verification result identifies its subject, check type, source event, verifier, verification time, outcome, and freshness boundary.</p><p>The checks can answer precise questions:</p><p><strong>Document integrity:</strong> does the hash of the retrieved PDF bytes match the recorded commitment?<br><strong>Amendment evidence:</strong> did the designated contract record the referenced amendment event?<br><strong>Ruleset identity:</strong> does the selected ruleset version match its recorded commitment?<br><strong>Decision provenance:</strong> does an attestation reference the same fixed input snapshot and ruleset used for this enquiry?</p><p>A matching hash establishes integrity relative to the commitment. Contractual applicability comes from the document’s reviewed authority, policy associations, temporal state, and approved rules. Block time, endorsement effective time, and ingestion time each retain their own meaning.</p><p>Data 360 makes verification records discoverable alongside the policy context. A verification service checks their provenance, freshness, and relationship to the actual bytes or snapshot being evaluated. Blockchain finality and ingestion completion are separate milestones; the consuming application checks both.</p><p>For P10027, DocumentVersion DV-E003–01 could identify the issued equipment endorsement PDF. PolicyDocumentLink PDL-E003-V1 associates it with C-EQ for the applicable period. A blockchain event can reference the endorsement’s content hash, and a verification result records whether the retrieved file matches that commitment. The policy service still evaluates the endorsement’s coverage terms against the loss facts.</p><h3>A dataset ready for coverage enquiries</h3><p>The data foundation connects insured items to coverage, coverage to applicable document versions, and those versions to searchable clauses and verification evidence. Retained history supports questions about both contractual effective time and what was known at a particular point.</p><p>A downstream context service can now return a policy snapshot with document references, readiness status, and narrowly defined verification results. ultimately removing the human subjective efforts from each policy decisioning process, achieving this with a full auditable trail and the business confidence required.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37df22179e50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Insurance Is a Connected Business: From Product Graphs to Minted Policy Covers]]></title>
            <link>https://medium.com/@beau32/insurance-is-a-connected-business-from-product-graphs-to-minted-policy-covers-6ad6563fb58b?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ad6563fb58b</guid>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 10:28:42 GMT</pubDate>
            <atom:updated>2026-08-23T09:28:36.843Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>How graph modelling and minted policy covers can power a more connected, traceable insurance industry</strong></h4><p>Why a graph data model — and a blockchain proof layer — can bring order to product versions, exclusions, special terms, and policy history</p><p>Insurance has spent decades trying to express a living network of risk through rows, columns, documents, and point-to-point integrations.</p><p><strong>The golden key: connected insurance contracts with verifiable identity</strong></p><p>That approach worked — until the relationships became the business.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiB54l1wa4TXTHZyCpZarw.jpeg" /></figure><p>The next generation of insurance operations will not be powered by blockchain alone, nor by a graph database alone. The real opportunity is in their combination: a graph model that captures the full business meaning of a product and policy, and an NFT-style blockchain record that gives each issued cover a unique, verifiable, and traceable identity.</p><p>A product changes in one market but not another. A standard exclusion is overridden for a group scheme. A broker negotiates a special term. A customer renews under different wording from the policy they bought three years ago. When a claim arrives, the insurer needs to know not just what the product says today, but what was actually agreed for that customer, risk, location, and date of loss.</p><p>In this context, an NFT does not mean a speculative tradable asset. It is a non-fungible digital certificate: a unique record for one specific policy cover, descended from one specific approved version of an insurance product. No two issued covers are identical because each has its own insured risk, terms, limits, effective dates, endorsements, and underwriting history.</p><p>That is not a table problem. It is a connected-data problem.</p><p>The graph answers: **what does this cover mean, what does it inherit, and how is it connected?** Blockchain answers: **when was this exact cover issued, by whom, and has its recorded history changed?**</p><p>The promising combination for the next generation of insurance is a graph model that captures those connections, with blockchain-backed minting that gives every issued cover a unique and verifiable history.</p><pre>Graph model: business context, relationships, inheritance, and traversal<br>+<br>NFT-style minting: unique identity, provenance, signatures, and immutable history<br>=<br>Next-generation insurance operations</pre><p><strong>The golden key is not blockchain alone</strong></p><p>This combination can turn an insurance cover from a mutable collection of records and documents into a governed digital contract with an explainable lineage. It enables insurers, brokers, reinsurers, claims partners, and regulators to refer to the same uniquely identified cover state — without exposing confidential customer data on a public ledger.</p><p>Blockchain, on its own, is not a new insurance operating model. Neither is a graph database.</p><p>Insurance products look deceptively tidy at launch. A policy has a name, a premium, benefits, exclusions, and terms and conditions. Put those fields in product tables, attach documents, and the model appears complete.</p><p>The opportunity is in combining the two.</p><p>Then the business starts operating.</p><p>A graph captures business meaning: what a cover inherits, which exclusions apply, who approved an exception, which wording was in force, and how a policy connects to the customer, broker, asset, claim, reinsurer, and regulation around it.</p><p>A product changes in one jurisdiction but not another. A rider is available only to a customer segment. An exclusion is overridden for a group scheme. A special term applies at renewal but not to new business. A broker agreement changes eligibility. A claim must be assessed against the policy wording that was in force on the date of loss — not the wording that exists today.</p><p>Blockchain provides durable proof: when a specific cover was issued, by whom, from which approved product version, and whether its recorded history has changed.</p><p>Over time, the question is no longer “What is this product?” It becomes: **What exactly was offered, sold, accepted, and in force for this customer, through this channel, in this place, at this point in time?**</p><p>Together, they turn a policy cover from a mutable collection of records and documents into a governed digital contract with a traceable lineage.</p><p>That is a relationship question. It is also a history question. Traditional insurance data models often struggle with both.</p><p><em>&gt; The graph explains the cover. The blockchain proves its history.</em></p><p><strong>The compounding complexity behind a simple policy</strong></p><p>The result is potentially transformative. Insurers, brokers, reinsurers, claims partners, and regulators can refer to the same uniquely identified cover state — without forcing confidential customer or commercial data onto a public ledger.</p><p>Insurers commonly manage this complexity through layers: product tables, version tables, benefit tables, rule engines, document repositories, exceptions registers, spreadsheets, and operational knowledge held by experienced people.</p><p><strong>Insurance complexity compounds quietly</strong></p><p>Each component can be sensible in isolation. Together, they create familiar problems:</p><p>At launch, a product is simple enough. It has a name, a price, a set of benefits, exclusions, and wording.</p><p>- Product versions are copied rather than composed, making changes difficult to identify.</p><p>- Exclusions and endorsements become buried in documents or encoded as one-off rules.</p><p>- Special terms lose their connection to the policy, broker, customer, risk, or approval that gave them meaning.</p><p>- Analysts can report what is stored but struggle to explain why a decision was made.</p><p>- A claims, regulatory, or customer query becomes a cross-system reconstruction exercise.</p><p>Then the business starts operating.</p><p>The root issue is not simply data quality. The business is represented largely as records and foreign keys, while insurance itself is a network of products, agreements, parties, conditions, events, and obligations.</p><p>Product teams launch a new version. Underwriters make exceptions. Distribution teams create channel-specific propositions. Regulation introduces jurisdictional differences. Claims teams need to reconstruct the terms that applied years ago. Each change may be reasonable, but the accumulated effect is a landscape of copied product versions, disconnected documents, rule-engine logic, exception registers, spreadsheets, and tribal knowledge.</p><p><strong>Model insurance as a connected graph</strong></p><p>The most difficult questions are usually simple to ask:</p><p>A graph data model represents business entities as nodes and their meaningful connections as relationships. Both can carry context: effective dates, jurisdiction, source, status, provenance, and conditions.</p><p>- What exactly was covered when this loss occurred?</p><p>- Which customers are affected by this wording change?</p><p>- Which special terms were approved for policies placed by this broker?</p><p>- Which claims have a common connection through an asset, address, repairer, intermediary, or payment destination?</p><p>For insurance, this makes the product model a connected domain rather than a stack of disconnected tables.</p><p>Traditional relational systems can answer many of these questions. But as relationships multiply, the answers become slow to assemble, hard to explain, and fragile to maintain.</p><pre>(Product) -[:HAS_VERSION]-&gt; (Product Version)<br>-[:INCLUDES]-&gt; (Cover Definition)<br>-[:EXCLUDES]-&gt; (Exclusion)<br>-[:GOVERNED_BY]-&gt; (Policy Wording)<br>-[:AVAILABLE_THROUGH]-&gt; (Distribution Channel)<br>## Model the business as it actually works: a graph<br>(Policy) -[:HAS_COVER]-&gt; (Policy Cover)<br>-[:SOLD_BY]-&gt; (Broker)</pre><p>A graph data model treats important business entities as nodes and their meaningful connections as relationships. In insurance, those entities include products, versions, covers, policies, customers, risks, claims, brokers, reinsurers, documents, exclusions, endorsements, special terms, approvals, and events.</p><pre>(Policy Cover) -[:DERIVED_FROM]-&gt; (Product Version / Cover Definition)<br>-[:HAS_ENDORSEMENT]-&gt; (Endorsement)<br>-[:SUBJECT_TO]-&gt; (Special Term)</pre><p>The real value lies in the relationships.</p><p>A special term is not merely a paragraph of text. It may have been negotiated by a broker, approved by an underwriter, tied to a specific risk location, applied only for a defined period, and overridden a standard product exclusion. A graph makes each of those connections explicit and traversable.</p><pre>Policy cover<br> → inherited product version<br> → applicable cover definition<br> → exclusion or endorsement<br> → special-term override<br> → underwriting approval<br> → policy wording in force</pre><p>This is not an argument for turning every data field into a node. It is a design choice to treat relationships as first-class when they have business meaning, change independently, or must be explained later.</p><p><strong>Product versions should evolve, not be copied</strong></p><p>One of the strongest uses of a graph is product versioning.</p><p>Instead of copying an entire product every time a wording clause, excess, or eligibility rule changes, a new version can explicitly inherit from its predecessor and declare what changed.</p><pre>Home Plus 2026.1<br> → evolves from Home Plus 2025.3<br> → adds Flood Excess Rule<br> → replaces Storm Exclusion v2<br> → applies in New Zealand</pre><p>That creates a navigable record of product intent. It allows an insurer to identify which policies inherited a benefit from a shared base product, which customers are affected by a change, and what wording was applicable at any historical point in time.</p><p>The same principle can apply to underwriting guidance, rate tables, eligibility rules, delegated authorities, and policy wording.</p><p><strong>Every policy cover can be minted as a unique descendant</strong></p><p>Here is where the model becomes especially interesting.</p><p>The product version is an approved template. It defines what *can* be sold.</p><p>Each cover issued under a policy is a unique, policy-specific descendant of that product version. It defines what was *actually contracted* for one insured risk.</p><pre>Home Plus 2026.1<br> └─ Building cover definition<br> └─ Policy P-100248 / Building cover C-1</pre><p>The policy cover inherits its standard terms from the product version. It then carries the facts that make it unique: the insured asset, sum insured, excess, premium, effective dates, endorsements, exclusions, special terms, underwriting decision, and approvals.</p><p>This is where the NFT concept becomes useful.</p><p>In insurance, an NFT should not be understood as a speculative tradable asset. It is better understood as a non-fungible digital certificate: a unique, tamper-evident identity for one particular issued cover.</p><p>No two policy covers are identical. Even where they descend from the same product version, each has its own insured risk, terms, dates, and history.</p><p><strong>Mint the cover, not the customer data</strong></p><p>At the point of issue, the insurer creates a canonical digital manifest of the cover. The manifest contains the references needed to identify the cover and prove its ancestry: the parent product version, applicable cover definition, terms, endorsements, special-term references, and hashes of the governing documents.</p><p>That manifest is cryptographically hashed and minted to a blockchain record. The resulting record can capture the issued timestamp, issuer signature, product-version lineage, and the hash of the exact cover state.</p><p>Sensitive data should remain in the insurer’s controlled systems. The blockchain does not need to hold customer details, pricing, or full policy wording. It needs only the minimal proof data — hashes, identifiers, timestamps, signatures, and state — that allows participants to verify integrity.</p><p>For most insurers, this points toward a permissioned network with clear governance, not a public cryptocurrency platform.</p><p><strong>Changes should create history, not erase it</strong></p><p>Insurance contracts evolve. The sum insured may change. A special term may be added. An endorsement may be applied at renewal.</p><p>The critical design principle is that material changes should not silently overwrite the original cover. They should mint a new state linked to the one before it.</p><pre>Building Cover C-1, version 1 - issued<br> → version 2 - sum insured increased<br> → version 3 - special term added at renewal</pre><p>This creates a tamper-evident lifecycle. It does not claim that every historical decision was correct; rather, it makes the recorded decision trail transparent and difficult to alter without detection.</p><p>That distinction matters. If an error is found, the insurer issues a corrected state with an explicit link to the prior record. It does not rewrite history.</p><p><strong>Claims become explainable traversals</strong></p><p>The value of this architecture becomes most visible when something goes wrong.</p><p>At claim time, the insurer can traverse from the loss event to the precise cover state that was in force on the date of loss. It can identify the inherited product definition, applicable wording, exclusions, endorsements, special terms, underwriting decisions, and approval evidence.</p><p>It can then rebuild the cover manifest and verify it against the blockchain record.</p><pre>Claim<br> → cover in force at date of loss<br> → policy-specific endorsements and special terms<br> → inherited cover definition and product version<br> → applicable wording and exclusions<br> → approval evidence<br> → verified issued-cover history</pre><p>The output is more than a decision. It is an explainable decision path — one that can be understood by the claims handler, customer, broker, auditor, or regulator who needs to trust it.</p><p><strong>From systems of record to a network of value</strong></p><p>The graph becomes even more valuable when it connects products and policy covers to the broader enterprise: customers, households, insured assets, brokers, delegated authorities, repairers, reinsurers, payments, locations, peril zones, claims, and regulations.</p><p>This allows the insurer to explore questions that cut across traditional system boundaries:</p><p>- What exposure do we have to a particular peril across all products and issued covers?<br>- Which claims share an intermediary, asset pattern, repair network, or payment destination?<br>- Which policies are affected by a regulatory change in a jurisdiction?<br>- Where are exceptions concentrated, and what do they reveal about product design, distribution, or fraud risk?</p><p>Insurance has always been a connected business. Our systems have simply made it look fragmented.</p><p><strong>Start where the pain is already visible</strong></p><p>This does not require replacing core insurance platforms in one sweeping programme. The best starting point is usually a bounded decision domain where manual reconstruction already consumes time and trust: product and wording traceability, coverage determination, broker oversight, catastrophe exposure, or fraud investigation.</p><p>Start with the questions people repeatedly struggle to answer. Map the entities involved, then the relationships, effective dates, evidence sources, and accountable owners. Build the product lineage first. Then mint issued policy covers where unique identity and verifiable history deliver tangible value.</p><p>The graph becomes the connected model of the business. Minting becomes the proof of issuance and change history.</p><p>That may be the golden key for next-generation insurance operations: not another system of record, but a trustworthy network of products, covers, risks, decisions, and relationships that the enterprise can finally navigate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ad6563fb58b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Insurance Was Never a Table Problem]]></title>
            <link>https://medium.com/@beau32/insurance-was-never-a-table-problem-2abb7eeac2bd?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2abb7eeac2bd</guid>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 09:55:33 GMT</pubDate>
            <atom:updated>2026-08-19T10:06:24.124Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why the graph data model is a better foundation for products, versions, exclusions, and connected enterprise operations</h3><p>Insurance products look deceptively tidy at launch. A policy has a name, a premium, a set of benefits, a few exclusions, and terms and conditions. Put those fields in a product table, attach some documents, and the model appears complete.</p><p>Then the business starts operating.</p><p>A product changes in one jurisdiction but not another. A rider is available only to a particular customer segment. An exclusion is overridden for a group scheme. A special term applies to a renewal but not to new business. A broker agreement changes eligibility. A claims rule depends on the policy wording that was in force on the day of loss — not the wording that exists today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QW7zeLKxYFHWbxBehzM3ig.png" /></figure><p>Over time, the question is no longer “What is this product?” It becomes: **What exactly was offered, sold, accepted, and in force for this customer, through this channel, in this place, at this point in time?**</p><p>That is a relationship question. And relationships are where the traditional insurance data model starts to strain.</p><p><strong>The compounding complexity behind a simple policy</strong></p><p>Most insurers have learned to manage complexity with layers: product tables, version tables, benefit tables, rule engines, document repositories, exceptions registers, spreadsheets, and operational knowledge held by experienced people.</p><p>Each system may be sensible in isolation. Together, they create a familiar set of problems:</p><p>- Product versions are copied rather than composed, making it hard to see what actually changed.<br>- Exclusions and endorsements are buried in documents or encoded as one-off rules.<br>- Special terms become detached from the policy, distribution arrangement, customer, or event that gave them meaning.<br>- Analysts can report what is stored, but struggle to explain why a particular decision was made.<br>- A regulatory, claims, or customer query turns into a cross-system reconstruction exercise.</p><p>The root issue is not simply poor data quality. It is that the business is represented mainly as records and foreign keys, while the business itself is a network of entities, agreements, conditions, events, and obligations.</p><p><strong>Model the insurance business as a connected graph</strong></p><p>A graph data model treats entities as nodes and their meaningful connections as relationships. More importantly, both nodes and relationships can carry context: effective dates, jurisdiction, source, status, provenance, and conditions.</p><p>For insurance, this makes the product model a connected domain rather than a stack of disconnected tables.</p><pre>(Product) -[:HAS_VERSION]-&gt; (Product Version)<br> -[:INCLUDES]-&gt; (Cover)<br> -[:EXCLUDES]-&gt; (Exclusion)<br> -[:GOVERNED_BY]-&gt; (Policy Wording)<br> -[:AVAILABLE_THROUGH]-&gt; (Distribution Channel)<br>(Policy) -[:ISSUED_UNDER]-&gt; (Product Version)<br> -[:COVERS]-&gt; (Insured Object)<br> -[:HAS_ENDORSEMENT]-&gt; (Endorsement)<br> -[:SUBJECT_TO {effectiveFrom, effectiveTo}]-&gt; (Special Term)<br> -[:SOLD_BY]-&gt; (Broker)<br>(Claim) -[:ARISES_FROM]-&gt; (Policy)<br> -[:RELATES_TO]-&gt; (Loss Event)<br> -[:ASSESSED_AGAINST]-&gt; (Cover)</pre><p>This is not an argument for turning every column into a node. The design discipline is to make relationships first-class where they have business meaning, change independently, or need to be traversed and explained.</p><p>For example, a special term is rarely just text. It may be negotiated by a broker, approved by an underwriter, apply only to a defined risk location, supersede a standard exclusion, and expire at renewal. A graph gives that term a place in the model — and preserves its connections.</p><p><strong>Versions should inherit and declare differences</strong></p><p>Product versioning is one of the clearest places where a graph changes the conversation.</p><p>Instead of copying an entire product definition for every release, a version can inherit from a previous version and explicitly link to the elements it adds, removes, overrides, or replaces.</p><pre>(Home Plus v2026.1) -[:EVOLVES_FROM]-&gt; (Home Plus v2025.3)<br>(Home Plus v2026.1) -[:ADDS]-&gt; (Flood Excess Rule)<br>(Home Plus v2026.1) -[:REPLACES]-&gt; (Storm Exclusion v2)<br>(Home Plus v2026.1) -[:EFFECTIVE_IN]-&gt; (New Zealand)</pre><p>The result is not merely a smaller data footprint. It creates a navigable history of intent. Product, actuarial, underwriting, compliance, and claims teams can answer questions such as:</p><p>- Which policyholders are affected by this exclusion change?<br>- What terms applied on the date of loss?<br>- Which products inherit this benefit from a common base product?<br>- Which broker-distributed policies received an exception to the standard rule?</p><p>The same version model can be applied to wording, underwriting guidance, rates, eligibility rules, and delegated authority. The business gains an auditable chain rather than a pile of snapshots.</p><p><strong>From enterprise systems to an enterprise network</strong></p><p>The value becomes larger when the product graph connects to the rest of the enterprise.</p><p>An insurer is not only a collection of policies. It is a network that includes customers, households, assets, risks, intermediaries, reinsurers, service providers, claims, payments, geographies, and regulations. Each system of record can remain responsible for its operational data, while the graph creates an integrated relationship layer across them.</p><p>That enables traversals that are difficult, slow, or brittle when reconstructed through repeated joins and manual reconciliation:</p><pre>Customer → Policy → Product Version → Exclusion → Claim → Repairer<br> ↘ Broker → Delegated Authority → Underwriter<br> ↘ Address → Flood Zone → Reinsurance Treaty</pre><p>In practice, this supports a different class of business question:</p><p>- What exposure do we have to a peril, across all products and versions that cover it?<br>- Which claims share an intermediary, repair network, address pattern, or payment destination?<br>- Which policies are affected if a regulatory requirement changes for a given jurisdiction?<br>- Where do exceptions cluster — and are they revealing a product-design problem, a distribution problem, or a fraud signal?</p><p>These are connected-data questions. The point is not that relational databases are incapable of answering them. The point is that a graph makes these connections natural to represent, query, govern, and explain as the network changes.</p><p><strong>Explainability becomes a product capability</strong></p><p>Insurance decisions must often be explained: to a customer, regulator, broker, claims handler, internal auditor, or model-risk team. A graph provides a practical foundation for this because the decision can be linked to the facts, rules, versions, approvals, and relationships that led to it.</p><p>Consider a claim decision. Rather than returning only “declined — exclusion applies,” the system can traverse and present the reasoning path:</p><pre>Loss event<br> → policy in force<br> → product version issued<br> → applicable policy wording<br> → relevant exclusion<br> → special-term override check<br> → delegated authority / approval record<br> → decision</pre><p>That path matters just as much when AI is introduced. A language model may help employees interpret documents or guide a customer through a claim, but it should not be the system of record for coverage truth. The graph can ground AI in governed, versioned, traceable business context — making responses more useful and decisions easier to review.</p><p><strong>Start with the questions that are currently painful</strong></p><p>The graph journey does not require a wholesale replacement of core insurance platforms. The best starting point is usually a bounded, high-value decision domain where relationships are already causing friction.</p><p>Good candidates include product and wording traceability, claims coverage determination, broker and delegated-authority oversight, catastrophe exposure, or financial-crime and fraud investigation.</p><p>Start by identifying the questions that routinely trigger manual research. Map the entities involved, then map the relationships, their effective dates, their sources, and who owns them. That exercise often reveals the real complexity more clearly than a technology-first discussion ever could.</p><p>Then connect the graph to existing systems of record, keep stewardship clear, and make the first traversals visible to the people who need to make decisions. A useful graph earns trust when someone can follow the path and say: “Yes — that is how this part of the business actually works.”</p><p><strong>Insurance is becoming a connected business</strong></p><p>The insurance industry has always been built on connected risk. The policy, product, claim, broker, reinsurer, asset, event, and customer were never truly separate. Our systems merely made them look that way.</p><p>As products proliferate, versions multiply, and exceptions accumulate, the winning data model will be the one that preserves these connections instead of flattening them away.</p><p>A graph does not remove the complexity of insurance. It gives the complexity a form the enterprise can navigate, govern, and use.</p><p>And that is the shift: from managing insurance as a catalogue of records to operating it as a living, traversable network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2abb7eeac2bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentforce Unstructured Data: Data Library vs. Data Stream]]></title>
            <link>https://medium.com/@beau32/agentforce-unstructured-data-data-library-vs-data-stream-3d54804dfd21?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d54804dfd21</guid>
            <category><![CDATA[salesforce-agentforce]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[data-360]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 09:33:20 GMT</pubDate>
            <atom:updated>2026-08-19T09:33:20.628Z</atom:updated>
            <content:encoded><![CDATA[<p>Agentforce Data Library is the fast, packaged route to grounded answers. Data 360 unstructured data streams are the extensible route for organizations that need control over ingestion, parsing, chunking, retrieval, and prompting.</p><ul><li><strong>Data Library</strong> provides a managed retriever over either uploaded files or Salesforce Knowledge articles. You can use that retriever in a custom prompt template to control answer instructions, grounding rules, fallback behavior, citations, and formatting.</li><li><strong>Data 360 Data Streams + Intelligent Context</strong> provide broader source and ingestion support, plus deeper control over parsing, chunking, indexing, and retrieval configuration before that retriever is used in Prompt Builder.</li></ul><p>They can both support RAG, but they are designed for different levels of maturity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apXTUBd0Yagf-nTyxMT-FA.png" /></figure><h3>Agentforce Data Library: the simplified option</h3><p>Agentforce Data Library is deliberately constrained. In the typical setup, an administrator selects one of two data types: <strong>uploaded files</strong> — commonly PDF-based knowledge packs — or <strong>Salesforce Knowledge articles</strong>. A library holds one data type, so an organization using both needs separate libraries.</p><p>Salesforce then handles the underlying mechanics: it indexes the selected content, generates chunks, builds the search index, and creates a retriever that the agent can use through the standard knowledge-answering experience. The value is speed. A service team can connect an agent to approved policy documents or Knowledge articles without building the full Data 360 RAG stack manually. <a href="https://help.salesforce.com/s/articleView?id=sf.agent_setup_data_sources.htm&amp;language=en_US&amp;type=5">Salesforce Help: Assign a Data Library to Your Agent</a></p><p>Data Library also provides its out-of-the-box search experience. This is useful when the goal is conventional question answering over a bounded and relatively stable corpus. It keeps implementation accessible for CRM and Agentforce administrators, but it also means that teams accept more of Salesforce’s default choices for ingestion, chunking, indexing, and retrieval behavior, important information such as paragraph boundry, table formatting or embedded images can be skipped, therefore the resulting chunks carry reduced fidelity in turn could lead to less accurate response from agent.</p><p>Data Library search algorithms:</p><ul><li><strong>General FAQ</strong> — answers from the assigned knowledge source.</li><li><strong>General Web Search</strong> — retrieves current public-web information.</li><li><strong>Deep Search / Deep Research</strong> — performs more expansive research-oriented retrieval where enabled.</li></ul><p>Each comes with Salesforce-defined instructions, action wiring, and response behavior. They are useful accelerators, but their predefined behavior may not match a specific use case — for example, strict citation rules, domain-only retrieval, a particular fallback path, different result counts, or a specialised response format.</p><p>In short, Data Library is best understood as a <strong>managed knowledge package for an agent, with superior speed to market and simplification</strong></p><h3>Data 360 Data Streams: the enterprise unstructured-data route</h3><p>A Data 360 Data Stream starts one layer lower: with the source system and its ingestion lifecycle. It connects content repositories to Data 360 and brings the data into an Unstructured Data Lake Object (UDLO), which is mapped to an Unstructured Data Model Object (UDMO). That model can then feed search indexes, retrievers, prompts, agents, automation, and analytics. <a href="https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-create-googledrive-unstructured-udlo.html">Salesforce Developers: Create a Google Drive Unstructured Data Lake Object</a></p><p>This architecture supports far wider content scenarios than a basic upload library: PDF and Markdown content, cloud-storage repositories, SharePoint, Google Drive, Confluence, GitHub, Jira, website crawls, CRM file attachments, and other supported connectors. <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_connect.htm&amp;language=en_US&amp;type=5">Salesforce Help: Unstructured Data File Formats and Connectors</a></p><p>The significant difference is <strong>Intelligent Context</strong>. Rather than treating chunking and retrieval as fixed implementation details, Data 360 allows teams to design and tune the pipeline. They can select LLM-based parsing where appropriate, inspect generated chunks, decide which metadata matters, configure search indexes, and use retrievers deliberately. This matters when the source content includes complex documents, product documentation, tables, visual assets, long technical pages, or rapidly changing repositories.</p><h3>Intelligent Context: where Data 360 becomes configurable</h3><p>Intelligent Context is the Data 360 capability that turns raw unstructured content into retrieval-ready knowledge. After a Data Stream ingests content such as PDFs, Markdown files, web pages, or repository documents, Intelligent Context controls how that content is parsed, enriched, and divided into chunks for search. Teams can use LLM-based parsing to better interpret complex documents, inspect the generated chunks and metadata, and tune the chunking strategy to suit the content and expected questions. The resulting indexed content can then be exposed through a retriever and consumed in Prompt Builder. This gives architects control over the full RAG path — from source ingestion and content interpretation through retrieval and final agent response — rather than relying solely on the default behavior packaged in a Data Library.</p><h3>Retrieval is where Data 360 becomes more powerful</h3><p>A Data Stream-led implementation does not stop at indexing. A team can create a retriever over the search index and connect it to a custom Prompt Builder template.</p><p>That prompt can specify:</p><ul><li>which retriever to use;</li><li>how many results to return;</li><li>which fields and metadata to pass to the model;</li><li>how the model should behave when retrieved information is weak or absent;</li><li>whether responses must include citations, source URLs, or a prescribed format; and</li><li>the guardrails that keep the answer grounded in retrieved content.</li></ul><p>Salesforce’s Prompt Builder guidance explicitly treats the retriever output as a prompt resource: the user query drives the retriever, the retrieved chunks become knowledge-base context, and the LLM is instructed to answer from that indexed content. <a href="https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-prompt.html">Salesforce Developers: Build and Test a Prompt in Prompt Builder</a></p><h3>What Intelligent Context can accomplish</h3><p><strong>Intelligent Context: turning raw content into retrieval-ready knowledge</strong></p><p>Intelligent Context is where Data 360 becomes especially powerful for unstructured content. It is an AI-powered workspace for preparing content and creating search-index configurations tailored to a business use case. It controls the content-understanding and search-readiness part of the RAG pipeline.</p><p>It can begin with AI-generated smart defaults based on sample documents, giving teams a practical starting point. From there, architects can inspect the results and modify the configuration before it is published.</p><p><strong>Parsing content appropriately</strong></p><p>Intelligent Context lets teams choose how their content is parsed. The default parser is appropriate for straightforward text extraction. LLM-based parsing can extract text, images, and other visual elements from more complex content. The Docling parser is designed to work with document layouts, images, and tables.</p><p>This is important because unstructured documents are rarely just a sequence of paragraphs. A product guide may contain tables that describe compatibility. An invoice may contain fields in a form layout. A technical PDF may use diagrams, captions, headings, and multi-column pages. Better parsing preserves the information that retrieval needs to find.</p><p><strong>Processing images and tables</strong></p><p>Intelligent Context can preprocess multimodal content before chunking. It can extract context from images and data from tables while attempting to preserve the relevant relationships. Image processing can also extract text from tables, forms, and image captions.</p><p>That gives an agent a much stronger chance of answering questions whose evidence is not in the main body text. It also avoids treating visual or tabular content as an invisible attachment to an otherwise searchable document.</p><p><strong>Tuning chunks instead of accepting a default split</strong></p><p>Chunking is one of the biggest influences on retrieval quality. If chunks are too small, the model receives incomplete context. If they are too large, search can retrieve too much irrelevant material. If a section or table is split badly, the answer may be grounded in only half of the relevant information.</p><p>Intelligent Context provides configurable chunking strategies, including section-aware chunking and passage extraction. Teams can adjust maximum-token and overlap settings, then regenerate the chunks and evaluate the result. Section-aware chunking follows headings and titles, while passage extraction uses the semantic meaning in HTML-style document structure.</p><p>This converts chunking from a hidden system decision into an iterative quality-engineering activity.</p><p><strong>Choosing how content is searched</strong></p><p>When the configuration is published, teams can select a vector or hybrid search index. Vector search focuses on semantic similarity: it helps find material that means the same thing even when the user’s wording differs. Hybrid search combines semantic retrieval with keyword matching, which is useful when exact product names, error codes, part numbers, or policy terms matter.</p><p>Intelligent Context also supports embedding-model selection. Together, these choices let teams adapt retrieval to the shape of the corpus and the kinds of questions users actually ask.</p><p><strong>Enriching and evaluating content</strong></p><p>The platform can enrich indexed content with metadata such as keywords, entities, topic summaries, questions answered by the content, and summaries. This makes the corpus easier to search, filter, govern, and present with meaningful citations.</p><p>Just as importantly, Intelligent Context makes quality visible. Teams can inspect generated chunks, search and filter them, compare them with source documents, and review their confidence scores, source-file references, and citations. They can test representative questions before publishing the index rather than discovering weak retrieval only after an agent is in production.</p><h3>The decision</h3><p>Choose <strong>Agentforce Data Library</strong> when the requirement is: “Give this agent access to approved Knowledge articles or a document pack quickly.”</p><p>Choose <strong>Data 360 Data Streams with Intelligent Context</strong> when the requirement is: “Build a governed, reusable, high-quality retrieval layer across many repositories and tune how the agent searches, interprets, and presents knowledge.”</p><p>The latter has a higher implementation cost, but it gives teams the controls that determine RAG quality in production: source freshness, parsing quality, chunk boundaries, metadata, search configuration, retriever behavior, citations, and prompt-level fallback rules. Data Library is the shortcut; Data Stream plus Intelligent Context is the platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d54804dfd21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AgentScript Under the Hood: Prompts, Tools, and Deterministic Control]]></title>
            <link>https://medium.com/@beau32/how-agentscript-works-and-how-to-control-agent-flow-684e853e5abc?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/684e853e5abc</guid>
            <category><![CDATA[agent-script]]></category>
            <category><![CDATA[agentforce]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 10:16:43 GMT</pubDate>
            <atom:updated>2026-08-16T10:27:42.054Z</atom:updated>
            <content:encoded><![CDATA[<p>AgentScript is a declarative language for describing an AI agent: its state, instructions, available tools, and routes between specialist agents. A runtime reads the script, maintains state, builds prompts, exposes tools to the model, executes tool calls, and returns the final response.</p><p><strong>The agent loop</strong></p><p>A user message is handled in a repeated reasoning loop. The runtime loads the agent’s current state, runs `before_reasoning`, renders `reasoning.instructions` into a prompt, and sends that prompt plus enabled actions to the LLM. The model can call an action or return final text. After an action, the runtime stores its result in variables and starts another iteration. After final text, it runs `after_reasoning` and sends the response to the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYS48xz5oPdSO2sR5aegbw.png" /></figure><p><strong>State drives the next prompt</strong></p><p>Variables hold verified facts across iterations. For example, an agent can save an order number supplied by a customer, call an order service, then store the returned status. Because instructions are rendered again for every iteration, the next LLM request includes those new values. The model is never asked to invent the order status.</p><pre>variables:<br> order_number: mutable string = &quot;&quot;<br> order_status: mutable string = &quot;&quot;<br>reasoning:<br> instructions: -&gt;<br> | Help the customer with their order.<br> if @variables.order_number != &quot;&quot;:<br> | Their order number is {!@variables.order_number}.<br> if @variables.order_status != &quot;&quot;:<br> | Its current status is {!@variables.order_status}.</pre><p><strong>Actions extend the agent</strong></p><p>Actions represent external capabilities such as APIs, workflows, or deterministic state updates. The runtime turns eligible actions into tool definitions for the LLM. A condition such as `available when` prevents a tool being offered until its inputs are ready.</p><pre>reasoning:<br> actions:<br> capture_order: @utils.setVariables<br> description: &quot;Save an order number supplied by the customer&quot;<br> with order_number=…<br>lookup_order: @actions.Lookup_Order<br> description: &quot;Retrieve the status of the current order&quot;<br> available when @variables.order_number != &quot;&quot;<br> with order_number=@variables.order_number<br> set @variables.order_status = @outputs.status</pre><p>For the message “Where is order A-104?”, the model can first call `capture_order`. The runtime saves `A-104`, renders a new prompt, and then makes `lookup_order` available. After the external API returns a status, the runtime saves it and asks the model to respond using the verified value.</p><p><strong>Controlling the flow</strong></p><p>Use `before_reasoning` for work that must happen before every LLM call: validation, required data loading, safety gates, or deterministic routing. This is how an application prevents the model from bypassing a required step.</p><pre>before_reasoning:<br> if @context.session_id == &quot;&quot;:<br> transition to @subagent.SessionSetup<br>if not @variables.customer_verified:<br> run @actions.Verify_Customer<br> with customer_id=@context.customer_id<br> set @variables.customer_verified = @outputs.verified</pre><p>Use `after_reasoning` after the model has produced final text. It is suitable for cleanup, audit work, state transitions, and escalation checks. If a value must influence the response itself, load it before the corresponding LLM call instead.</p><pre>after_reasoning:<br> if @variables.order_status == &quot;Cancelled&quot;:<br> transition to @subagent.ReturnsAndRefunds</pre><p>For the message “Where is order A-104?”, the model can first call `capture_order`. The runtime saves `A-104`, renders a new prompt, and then makes `lookup_order` available. After the external API returns a status, the runtime saves it and asks the model to respond using the verified value.</p><p><strong>What a rendered prompt looks like</strong></p><p>AgentScript instructions are not sent to the model verbatim. Immediately before a model call, the runtime evaluates conditions, interpolates variables, adds the user message and conversation history, and converts the currently eligible reasoning actions into tools.</p><p>For example, after `capture_order` sets `<a href="http://twitter.com/variables">@variables</a>.order_number` to `A-104`, but before the order lookup is made, the rendered request conceptually contains:</p><pre>SYSTEM<br><br>You are an order-support assistant.<br>Be concise and never invent an order status.<br><br>Help the customer with their order.<br>Their order number is A-104.<br><br>Available tools:<br>- lookup_order: Retrieve the status of the current order.<br>  Input: { &quot;order_number&quot;: &quot;A-104&quot; }<br><br>USER<br><br>Where is order A-104?</pre><p><strong>What a router prompt looks like</strong></p><p>The `start_agent` block is commonly used as a router. It renders a focused classification prompt plus only the transition tools whose `available when` guards are true.</p><pre>start_agent agent_router:<br>    reasoning:<br>        instructions: |<br>            You are an agent router for this assistant.<br>            Choose the most appropriate subagent for the request.<br>        actions:<br>            go_to_identity: @utils.transition to @subagent.Identity_Verification<br>                description: &quot;Verifies user identity&quot;<br>                available when @variables.verified == False<br>            go_to_order: @utils.transition to @subagent.Order_Management<br>                description: &quot;Handles order lookup, refunds, and updates&quot;<br>                available when @variables.verified == True<br>            go_to_faq: @utils.transition to @subagent.General_FAQ<br>                description: &quot;Handles general questions&quot;</pre><p>For “Where is order A-104?” when `<a href="http://twitter.com/variables">@variables</a>.verified` is `False`, the runtime renders this shape:</p><pre>SYSTEM<br><br>You are an agent router for this assistant.<br>Choose the most appropriate subagent for the request.<br>Customer verified: false.<br><br>Available routing tools:<br>- go_to_identity: Verifies user identity.<br>- go_to_faq: Handles general questions.<br><br>USER<br><br>Where is order A-104?</pre><p><strong>Where determinism actually comes from</strong></p><p>Rendering a variable into a prompt provides context; it does not make the model’s response deterministic. The model can still interpret the value incorrectly, choose an unexpected visible tool, or generate different wording. The same is true when an LLM selects a routing action: the runtime constrains the available choices, but the final choice is still model-driven.</p><p>Deterministic behavior comes from the runtime executing AgentScript procedures and policies:</p><ul><li>Variable interpolation in `reasoning.instructions` is not deterministic. It sends rendered text to the LLM.</li><li>LLM selection of a reasoning action is not deterministic. The model chooses from the tools the runtime exposed.</li><li>`available when` is deterministic. The runtime exposes or hides an action before the model sees it.</li><li>`before_reasoning` is deterministic. The runtime executes its state checks, assignments, calls, and transitions.</li><li>`set <a href="http://twitter.com/variables">@variables</a>.x = <a href="http://twitter.com/outputs">@outputs</a>.y` is deterministic. The runtime writes the specified tool output into state.</li><li>`transition to <a href="http://twitter.com/subagent">@subagent</a>.X` is deterministic. The runtime immediately switches the active subagent.</li></ul><p>If a routing decision must be fully deterministic, the runtime should make it in a procedure rather than asking the LLM to select a transition:</p><pre>before_reasoning:<br> if @variables.intent == &quot;order_status&quot; and not @variables.verified:<br> transition to @subagent.Identity_Verification<br>if @variables.intent == &quot;order_status&quot; and @variables.verified:<br> transition to @subagent.Order_Management</pre><p>This only moves determinism as far upstream as the value of `<a href="http://twitter.com/variables">@variables</a>.intent`. If an LLM populated that variable, the classification remains probabilistic. If a trusted rules engine, validated UI input, or deterministic classifier populated it, the routing procedure can be deterministic end to end. A useful boundary is: the LLM proposes decisions and language; the runtime enforces permissions, state updates, tool execution, and transitions.</p><p><strong>The practical model</strong></p><p>`before_reasoning` prepares trusted state. `reasoning.instructions` explains the task and exposes the relevant state. `reasoning.actions` lets the LLM choose useful capabilities within deterministic limits. Variables preserve the results. `after_reasoning` handles what should happen once the response is complete.</p><p>This gives the model flexibility in conversation while AgentScript and its runtime retain control of data dependencies, business rules, safety checks, and agent routing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=684e853e5abc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Bitemporal Data Models in Azure SQL for Modern Insurance Engineering]]></title>
            <link>https://medium.com/@beau32/building-bitemporal-data-models-in-azure-sql-for-modern-insurance-engineering-0774e8586646?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0774e8586646</guid>
            <category><![CDATA[insurance-technology]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[azure-sql-server]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 10:49:00 GMT</pubDate>
            <atom:updated>2026-08-12T10:49:00.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Why traditional history tracking fails in insurance systems, and how to combine Azure SQL system-versioning with application-managed effective time for complete auditability.</p><p>In high-stakes financial domain engineering — especially commercial and personal line insurance — data accurate to the current second is rarely sufficient. Insurance core systems are governed by two distinct timelines that operate independently:</p><ul><li><strong>Effective Time (Valid Time):</strong> When a coverage, endorsement, or policy modification applies in the real world (e.g., coverage legally bound from Feb 1st to Dec 31st).</li><li><strong>System Time (Transaction Time):</strong> When that fact was actually recorded or modified in your relational database engine (e.g., an underwriter entered the change on Feb 15th backdated to Feb 1st).</li></ul><p>When you attempt to solve this with standard row updates or basic timestamps, you introduce fatal flaws into audit trails, financial reporting, and claims adjudication. This architecture pattern explores how to implement a production-grade <strong>Bitemporal Engine</strong> in <strong>Azure SQL</strong> using a hybrid of native system-versioned temporal tables and application-managed valid periods.</p><h3>The Core Problem: Why Standard Audit Trails Fail</h3><p>Consider a realistic commercial fleet policy scenario. On <strong>January 1st, 2026</strong>, a logistics company buys policy POL-881 covering 10 delivery vans.</p><ul><li><strong>February 1st:</strong> The business purchases an 11th van and emails their broker to add it to the policy. The broker binds coverage starting immediately on February 1st.</li><li><strong>February 15th:</strong> Due to administrative backlog, the policy processing team enters the endorsement into the database on February 15th, backdating the effective start date to February 1st.</li><li><strong>February 20th:</strong> Van #11 gets into an accident that occurred on <strong>February 10th</strong>, and the insured files a claim.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fI5bJDgaUv_JYkTo1ZkmzA.png" /><figcaption>Insurance Use Case</figcaption></figure><blockquote>“If a claims adjuster asks whether Van #11 had coverage on Feb 10th, the answer is <strong>YES</strong>. But if an auditor asks what your database reported as covered on Feb 12th, the answer is <strong>NO</strong>. Standard database tables cannot answer both questions simultaneously.”</blockquote><p>A simple database overwrite destroys the history of what the business knew on Feb 12th. Pure system-versioning records the transaction on Feb 15th but fails to indicate that real-world liability began on Feb 1st. Bitemporal modeling preserves both timelines completely.</p><p>In the age of Large Language Models (LLMs) and autonomous AI agents, bitemporal data architecture transitions from an edge-case enterprise requirement to a critical safeguard. As AI agents move from read-only assistants to active operational actors — executing decisions, updating systems, and retrieving information independently — bitemporal models solve four primary challenges created by autonomous systems:</p><ol><li>Eliminating “Hallucinated” Time for Retrieval-Augmented Generation</li><li>Precise Agent Auditing and “Back-in-Time” Debugging</li><li>Safe Multi-Agent Asynchronous Writes &amp; Backdating</li><li>Regulatory Compliance &amp; Non-Repudiation for AI Actions</li></ol><h3>Step 1: Implementing the Azure SQL Schema</h3><p>Azure SQL provides native support for System-Versioned Temporal Tables. We leverage this for <strong>System Time</strong> and add explicit application columns for <strong>Effective Time</strong>.</p><pre>CREATE TABLE dbo.PolicyCoverage<br>(<br>    -- Primary Keys &amp; Identifiers<br>    PolicyCoverageID INT IDENTITY(1,1) NOT NULL,<br>    PolicyNumber VARCHAR(20) NOT NULL,<br>    VehicleID VARCHAR(50) NOT NULL,<br>    CoverageLimit DECIMAL(12, 2) NOT NULL,<br>    <br>    -- DIMENSION 1: Effective / Valid Time (Application Managed)<br>    EffectiveStartDate DATETIME2(2) NOT NULL,<br>    EffectiveEndDate DATETIME2(2) NOT NULL,<br>    -- DIMENSION 2: System / Transaction Time (Engine Managed)<br>    SysStartDate DATETIME2(2) GENERATED ALWAYS AS ROW START HIDDEN NOT NULL,<br>    SysEndDate DATETIME2(2) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL,<br>    PERIOD FOR SYSTEM_TIME (SysStartDate, SysEndDate),<br>    CONSTRAINT PK_PolicyCoverage PRIMARY KEY CLUSTERED (PolicyCoverageID, EffectiveStartDate)<br>)<br>WITH <br>(<br>    SYSTEM_VERSIONING = ON <br>    (<br>        HISTORY_TABLE = dbo.PolicyCoverageHistory,<br>        DATA_CONSISTENCY_CHECK = ON,<br>        HISTORY_RETENTION_PERIOD = 7 YEARS<br>    )<br>);<br>GO<br>-- Index to optimize real-world valid period slicing<br>CREATE NONCLUSTERED INDEX IX_PolicyCoverage_Effective <br>ON dbo.PolicyCoverage (PolicyNumber, EffectiveStartDate, EffectiveEndDate)</pre><h3>Step 2: Processing Backdated Endorsements Safely</h3><p>When applying an endorsement or correction, the application must manage the Effective Time boundaries while Azure SQL automatically captures the transaction history.</p><pre>CREATE PROCEDURE dbo.sp_ApplyPolicyEndorsement<br>    @PolicyNumber VARCHAR(20),<br>    @VehicleID VARCHAR(50),<br>    @CoverageLimit DECIMAL(12,2),<br>    @EffectiveDate DATETIME2(2)<br>AS<br>BEGIN<br>    SET NOCOUNT ON;<br>    BEGIN TRANSACTION;<br>    BEGIN TRY<br>        -- 1. Close out any active effective period at the backdated effective date<br>        UPDATE dbo.PolicyCoverage<br>        SET EffectiveEndDate = @EffectiveDate<br>        WHERE PolicyNumber = @PolicyNumber<br>          AND VehicleID = @VehicleID<br>          AND EffectiveStartDate &lt; @EffectiveDate<br>          AND EffectiveEndDate &gt; @EffectiveDate;<br>        -- 2. Insert the updated coverage effective from the target date<br>       INSERT INTO dbo.PolicyCoverage <br>        (<br>            PolicyNumber, VehicleID, CoverageLimit, EffectiveStartDate, EffectiveEndDate<br>        )<br>        VALUES <br>        (<br>            @PolicyNumber, @VehicleID, @CoverageLimit, @EffectiveDate, &#39;9999-12-31 23:59:59.99&#39;<br>        );<br>        COMMIT TRANSACTION;<br>    END TRY<br>    BEGIN CATCH<br>        IF @@TRANCOUNT &gt; 0 ROLLBACK TRANSACTION;<br>        THROW;<br>    END CATCH<br>END;<br>GO</pre><h3>How Data Evolves Across Both Timelines</h3><h4>Active State Table (dbo.PolicyCoverage)</h4><p><strong>PolicyNumber | VehicleIDEffective | StartDateEffective | EndDateSysStart <br>| DateSysEndDate</strong></p><p>POL-881Vans #1-#102026-01-01 9999-12-31 2026-01-01 09:00 9999-12-31 23:59</p><p>POL-881Van #112026-02-01 9999-12-31 2026-02-15 14:30 9999-12-31 23:59</p><h3>Querying Bitemporal Timelines</h3><h4>1. Claims Adjudication Query (Current Real-World Validity)</h4><p>To determine if Van #11 was covered on the Feb 10th accident date using our latest knowledge:</p><pre>DECLARE @AccidentDate DATETIME2(2) = &#39;2026-02-10&#39;;<br>SELECT PolicyNumber, VehicleID, EffectiveStartDate, EffectiveEndDate<br>FROM dbo.PolicyCoverage<br>WHERE PolicyNumber = &#39;POL-881&#39;<br>  AND VehicleID = &#39;Van #11&#39;<br>  AND EffectiveStartDate &lt;= @AccidentDate<br>  AND EffectiveEndDate &gt; @AccidentDate;<br>-- RESULT: 1 Row Returned (Coverage existed in real-world time).</pre><h4>2. Regulatory Audit Query (Bitemporal Point-in-Time)</h4><p>To verify what our database system reported on <strong>February 12th</strong> regarding coverage for February 10th:</p><pre>DECLARE @AccidentDate DATETIME2(2) = &#39;2026-02-10&#39;;<br>DECLARE @AuditSystemDate DATETIME2(2) = &#39;2026-02-12&#39;;<br>SELECT PolicyNumber, VehicleID, EffectiveStartDate, EffectiveEndDate<br>FROM dbo.PolicyCoverage <br>FOR SYSTEM_TIME AS OF @AuditSystemDate<br>WHERE PolicyNumber = &#39;POL-881&#39;<br>  AND VehicleID = &#39;Van #11&#39;<br>  AND EffectiveStartDate &lt;= @AccidentDate<br>  AND EffectiveEndDate &gt; @AccidentDate;<br>-- RESULT: 0 Rows Returned (As of Feb 12, the database had no record of Van #11).</pre><h3>Production Performance Optimizations for Azure SQL</h3><ul><li><strong>Clustered Columnstore on History Tables:</strong> History tables created by system-versioning use rowstore B-trees by default. Converting history tables to Clustered Columnstore Indexes (CCI) provides up to 10x compression and accelerates analytical audit queries over huge history datasets.</li></ul><pre>CREATE CLUSTERED COLUMNSTORE INDEX IX_PolicyCoverageHistory  <br>    ON dbo.PolicyCoverageHistory WITH (DROP_EXISTING = ON);</pre><ul><li><strong>UTC Timestamping:</strong> Standardize all system time on UTC (SYSUTCDATETIME()) across all application layers to prevent edge-case bugs during Daylight Saving Time conversions across regional branches.</li><li><strong>Automated Retention Policies:</strong> Set native HISTORY_RETENTION_PERIOD parameters on table definitions to comply with statutory audit limits without writing custom cleanup scripts.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0774e8586646" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Retrieval to Resolution: Building Graph-Enhanced PDF RAG for Better Answers]]></title>
            <link>https://medium.com/@beau32/from-retrieval-to-resolution-building-graph-enhanced-pdf-rag-for-better-answers-0c0f0ce851ba?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c0f0ce851ba</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[lancedb]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 07:58:03 GMT</pubDate>
            <atom:updated>2026-07-15T07:58:03.980Z</atom:updated>
            <content:encoded><![CDATA[<p>Most retrieval-augmented generation systems are built the same way: parse documents, split them into chunks, embed the chunks, retrieve matches, and ask an LLM to answer from them.</p><p>That works when your documents are simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rz2qb8kMaUU7XgwTP1u0Kw.png" /></figure><p>Enterprise PDFs are rarely simple.</p><p>A master agreement often has amendments. A policy has older versions and regional exceptions. A technical manual includes appendices, tables, and definitions. A compliance document embeds a rule in one place and an exception three pages later.</p><p>If retrieval only focuses on similarity, the system may find the right topic and still choose the wrong authority.</p><p>That is the gap Graph RAG fills.</p><p>Vector search provides candidate evidence. A graph makes relationships explicit, so the system can decide which evidence should win when documents overlap or conflict.</p><p>This article describes a practical prototype that proves the pattern without requiring a monolithic platform.</p><p><strong>## Why retrieval is not resolution</strong></p><p>Imagine a user asks:</p><p>&gt; What is the current retention period for EU customer data?</p><p>Your corpus contains:</p><ul><li>Data Retention Policy v2</li><li>Data Retention Policy v3</li><li>EU Privacy Addendum</li><li>Security Overview deck</li><li>Internal FAQ</li><li>Contract Amendment 1</li></ul><p>A plain vector RAG system may surface chunks that all mention “retention period,” “EU,” and “customer data.”</p><p>But then what?</p><p>One chunk says 90 days. Another says 30 days. A deck says “varies by region.” An older policy says 180 days. A contract amendment says the EU addendum controls in case of conflict.</p><p>The model can see all of this, but without explicit rules it may improvise.</p><p>That is dangerous.</p><p>Graph RAG is about making evidence resolution explicit:</p><ul><li>The amendment overrides the old contract.</li><li>The EU addendum is more specific than the general policy.</li><li>The current version beats the old version.</li><li>The signed contract beats the slide deck.</li><li>The definition of “customer data” comes from the glossary.</li></ul><p>The answer is not just what is closest. It is what evidence has precedence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vf3IKQSfVJ-rLw98_2ITSA.png" /></figure><p><strong>## Prototype architecture</strong></p><p>The prototype has a clear separation of concerns.</p><p>Raw PDFs arrive in Azure Blob Storage. An ingestion pipeline extracts their structure, splits texts into chunks, computes embeddings, and writes two complementary stores:</p><ul><li>durable evidence and graph metadata in Parquet</li><li>a vector retrieval index in LanceDB</li></ul><p>A FastAPI service exposes a query endpoint. A gateway or proxy handles API keys, throttling, routing, logging, and versioning.</p><p><strong>### Processing flow</strong></p><p>Raw PDFs -&gt; ingestion pipeline -&gt; Parquet evidence + LanceDB index</p><p>User query -&gt; FastAPI -&gt; LanceDB retrieval + Parquet metadata</p><p>Resolved evidence -&gt; graph precedence -&gt; grounded LLM answer with citations</p><p>A useful way to visualize it is as two linked paths: ingestion and query.</p><ul><li>Ingestion: collect, extract, chunk, embed, store.</li><li>Query: retrieve, enrich, resolve, answer.</li></ul><p><strong>### Diagram summary</strong></p><p>Imagine a simple diagram with four columns:</p><p>1. Source: raw PDFs in Azure Blob Storage</p><p>2. Ingestion: text extraction, chunking, embedding, and Parquet/LanceDB storage</p><p>3. Retrieval: vector search from LanceDB enriched with Parquet metadata</p><p>4. Resolution: graph-based precedence and grounded response with citations</p><p>That diagram highlights the two distinct flows and the central role of the graph in moving from retrieved evidence to resolved answer.</p><p><strong>## A small graph can add big value</strong></p><p>“Graph RAG” sounds like a commitment to graph databases, semantic web tooling, and heavyweight ontology work.</p><p>It does not have to be.</p><p>For a prototype, the graph can be a simple edge table stored alongside your evidence. Each row captures a relationship between document parts, such as:</p><ul><li>this document supersedes that one</li><li>this amendment overrides that clause</li><li>this section defines a term</li><li>this addendum applies to a particular region</li></ul><p>That is enough to turn similarity search into reasoned retrieval.</p><p><strong>## Evidence model</strong></p><p>The prototype uses three sets of durable records.</p><p><strong>### Documents</strong></p><p>Each PDF becomes a document record containing metadata such as authority rank, version, effective date, and supersedes links.</p><p>Authority ranking is critical. The system should not ask the model to infer whether a signed contract is stronger than an FAQ. Store it as metadata.</p><p>Example authority ranks:</p><ol><li>Regulation</li><li>Signed contract or amendment</li><li>Approved policy</li><li>Technical specification</li><li>Research paper</li><li>Internal memo</li><li>Presentation or summary</li><li>FAQ or commentary</li><li>OCR-only uncertain source</li></ol><p><strong>### Chunks</strong></p><p>Each extracted passage becomes a chunk record with the document ID, page range, section context, chunk type, token count, and extracted metadata.</p><p>Chunk type matters. A paragraph, table, footnote, definition, or appendix entry should not all be treated the same.</p><p><strong>### Graph edges</strong></p><p>Each relationship becomes an edge record with source, target, edge type, confidence, evidence text, and page number.</p><p>Useful edge types include:</p><ul><li>SUPERSEDES</li><li>AMENDS</li><li>OVERRIDES</li><li>REFERENCES</li><li>DEFINES</li><li>EXCEPTION_TO</li><li>APPLIES_TO_REGION</li><li>SAME_AS</li><li>DERIVED_FROM</li><li>CITES</li></ul><p>This is not a formal knowledge graph. It is a practical relationship layer that turns retrieval into resolution.</p><p><strong>## Why Parquet?</strong></p><p>Parquet is boring in the best way.</p><p>It is compact, queryable, and supported by Python, DuckDB, Spark, Azure Data Factory, Synapse, and more.</p><p>For RAG systems, debuggability is the deciding factor.</p><p>When an answer is wrong, you want to inspect:</p><ul><li>which PDF produced the chunk</li><li>which page it came from</li><li>what metadata it carried</li><li>which edges were created</li><li>why one chunk beat another</li><li>whether an old policy was treated as current</li></ul><p>If all evidence lives only in a vector database, that inspection becomes painful.</p><p>Use Parquet for the durable evidence record and LanceDB for fast retrieval.</p><p><strong>## Ingestion and retrieval roles</strong></p><p>The ingestion pipeline is responsible for:</p><ul><li>collecting PDFs</li><li>extracting text, tables, headings, and page metadata</li><li>splitting content into meaningful chunks</li><li>generating embeddings for retrieval</li><li>writing durable artifacts for evidence and graph edges</li></ul><p>The query service is responsible for:</p><ul><li>accepting questions</li><li>retrieving candidate chunks from the vector index</li><li>enriching them with Parquet metadata</li><li>applying precedence rules from the graph</li><li>generating a grounded answer with citations</li></ul><p>This separation makes the system easier to debug and evolve.</p><p><strong>## The order of precedence</strong></p><p>The resolver is where the system becomes more than vector search.</p><p>When multiple retrieved chunks are related, the answer should be ranked by explicit precedence rules rather than similarity alone.</p><p>Here are the principles that matter most.</p><p><strong>### 1. Explicit overrides win</strong></p><p>If one document explicitly supersedes, amends, or overrides another, that relationship should dominate.</p><p>Examples:</p><ul><li>an amendment supersedes a previous clause</li><li>a policy revision replaces earlier versions</li><li>a conflicting appendix controls</li></ul><p>Explicit authority should beat semantic similarity.</p><p><strong>### 2. Higher-authority sources beat lower-authority sources</strong></p><p>A signed contract usually beats an internal FAQ. A regulation beats a vendor blog post. A policy beats a presentation.</p><p>Store authority as metadata. Do not leave it to the model.</p><p><strong>### 3. Newer versions beat older versions, inside the same authority tier</strong></p><p>Recency matters, but it should not override authority.</p><p>A new FAQ should not replace an older signed agreement. A newer policy version should replace an older version only when they share the same authority.</p><p><strong>### 4. Specific rules beat general rules</strong></p><p>A general rule may say one thing, while a specific exception says another.</p><p>For an EU question, the EU-specific exception should beat a global statement.</p><p>Specificity can come from region, product, customer type, contract type, date range, appendix, or footnote.</p><p><strong>### 5. Definitions control interpretation</strong></p><p>If a document defines a term, that definition should guide later mentions of that term.</p><p>For example, a glossary entry for “customer data” should shape how later references are resolved.</p><p><strong>### 6. Tables and structured fields beat narrative summaries</strong></p><p>A table cell often contains the actual value, while prose may only summarize it.</p><p>For questions about thresholds, timelines, prices, or limits, structured evidence should often rank higher.</p><p><strong>### 7. Local context beats distant context</strong></p><p>A paragraph under “EU retention policy” is usually more relevant to an EU question than a general introduction.</p><p>Headings, section context, neighboring paragraphs, captions, and appendices are all useful signals.</p><p><strong>### 8. Direct evidence beats inferred evidence</strong></p><p>A chunk that directly states “EU customer data must be deleted within 30 days” should outrank a chunk that only implies GDPR alignment.</p><p>Direct statements drive answers. inferred context is background.</p><p><strong>### 9. OCR confidence matters</strong></p><p>Scanned PDFs with uncertain OCR should not outrank clean digital sources with the same authority.</p><p>Bad OCR can turn “30” into “90” or drop a negation. That risk should be reflected in the score.</p><p><strong>## Building trust with citations</strong></p><p>A good endpoint does not just return an answer. It returns a grounded answer with citations and a short explanation of why each source mattered.</p><p>A response should include:</p><ul><li>the answer itself</li><li>the documents that supported it</li><li>page references or section context</li><li>the reason each citation mattered</li></ul><p>That small amount of transparency changes behavior. It forces the service to explain why one piece of evidence won.</p><p><strong>## Deploying the prototype</strong></p><p>For a prototype, containerize the query service and deploy it in Azure.</p><p>Use Azure Blob Storage for raw PDFs and durable artifacts.</p><p>Use Azure Container Apps or App Service for the FastAPI runtime.</p><p>Use a gateway or proxy for the public endpoint, security, traffic controls, and versioning.</p><p>That gives you a clean external contract and keeps the system manageable.</p><p><strong>## Start with a small graph and grow it</strong></p><p>Start with shallow, practical edges and explicit precedence rules. Add more relationships only as the corpus demands them.</p><p>When the system can say:</p><ul><li>this amendment overrides that policy</li><li>this addendum is specific to the EU</li><li>this table row is stronger than that paragraph</li><li>this definition controls the term</li><li>then you have moved from retrieval to resolution.</li></ul><p>That is the real value of graph RAG for PDFs.</p><p><strong>## Extracting graph edges</strong></p><p>Some edges come from metadata. Some come from text.</p><p>A rule-based extractor is enough for the first version. It can identify common patterns such as supersedes, overrides, defines, and exceptions, then capture those relationships as edges in the graph.</p><p>This will not understand every document. It will miss subtle relationships. That is fine.</p><p><strong>## A simple resolver</strong></p><p>The resolver can begin with a scoring function that rewards:</p><ul><li>explicit overrides and supersedes relationships</li><li>high-authority documents</li><li>current versions</li><li>structured evidence such as tables and definitions</li><li>exception edges that apply to the query context</li><li>good OCR confidence</li></ul><p>That score is not the whole answer. It is a guardrail. It helps the system present the strongest evidence first and explain why.</p><p><strong>## FastAPI endpoint</strong></p><p>The query service should accept a question, retrieve candidate chunks from the vector index, enrich them with Parquet metadata, apply graph precedence, and return an answer with citations.</p><p>The important part is not the exact implementation. The important part is that the API returns a grounded answer with citations and a short explanation for why each source mattered.</p><p>A strong response should include the answer, the supporting documents and pages, and the reason each citation was selected. That reason field is small, but it changes the behavior of the system. It forces the service to explain why one piece of evidence won.</p><p><strong>## Deploying on Azure</strong></p><p>For a prototype, I would deploy the FastAPI app as a container.</p><p>Use Azure Blob Storage for:</p><ul><li>raw PDFs</li><li>Parquet evidence files</li><li>optional LanceDB artifacts</li></ul><p>Use Azure Container Apps or Azure App Service for:</p><ul><li>FastAPI runtime</li><li>retrieval and resolution endpoint</li></ul><p>Use a gateway or proxy for:</p><ul><li>public endpoint</li><li>subscription keys</li><li>rate limits</li><li>request validation</li><li>logging</li><li>versioned routes</li></ul><p>For deployment, keep the container simple and use Azure as the plumbing.</p><p>Package the query service in a container, store raw PDFs and durable artifacts in Azure Blob Storage, and run the FastAPI runtime in Azure Container Apps or App Service.</p><p>Expose a clean external endpoint, enforce API keys, limit traffic, log requests, and manage versions through your gateway or proxy.</p><p>That keeps the service boundary clear and the deployment straightforward.</p><p><strong>## What I would not overbuild at first</strong></p><p>I would not start with a massive knowledge graph program.</p><p>Start with:</p><ul><li>document metadata</li><li>chunk metadata</li><li>a small edge table</li><li>precedence scoring</li><li>citations with reasons</li><li>a working API</li></ul><p>Then improve where the errors are.</p><p>If the system chooses old PDFs, improve version detection. If it misses exceptions, improve exception extraction. If it mishandles tables, improve table parsing. If it confuses entities, add entity resolution.</p><p>The graph should grow from observed failure modes, not from architecture diagrams.</p><p><strong>## Final thought</strong></p><p>Vector search is good at recall. It helps the system find text that might matter.</p><p>Graph RAG is about judgment. It helps the system decide which evidence should matter most.</p><p>That distinction becomes important as soon as your PDFs stop being independent documents and start becoming a web of versions, amendments, definitions, exceptions, and summaries.</p><p>For simple corpora, flat RAG may be enough.</p><p>For related PDFs, especially in domains where the wrong source can change the answer, precedence is the product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c0f0ce851ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Salesforce Agentforce for Enterprise Solutioning, Case Intake, and Assignment]]></title>
            <link>https://pub.towardsai.net/using-salesforce-agentforce-for-enterprise-solutioning-case-intake-and-assignment-27d9ef9323f4?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/27d9ef9323f4</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[agentforce]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 11:14:16 GMT</pubDate>
            <atom:updated>2026-04-18T09:55:37.539Z</atom:updated>
            <content:encoded><![CDATA[<p>An enterprise architecture perspective on how service organizations can use Prompt Builder to transform unstructured requests into governed triage and routing decisions.</p><p>Most enterprise service organizations do not primarily suffer from a case volume problem. They suffer from a context and decision-quality problem.</p><p>Most organizations already have intake channels, queues, routing rules, knowledge articles, and escalation paths. What they often lack is a reliable way to convert messy, incomplete, multi-channel requests into structured work that can be triaged and assigned with speed, consistency, and sufficient auditability.</p><p>That gap is where Salesforce Agentforce becomes operationally relevant. In enterprise settings, the core question is rarely whether AI is available. The more consequential question is whether it can operate within production workflows, use approved business context, and generate outputs that are sufficiently stable to support downstream decisions. Agentforce is significant because it occupies the middle ground between unconstrained generative capability and governed enterprise execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGtoZoiOFnOE3kkpsXJmUg.png" /></figure><p>When implemented well, Prompt Builder helps organizations standardize case intake, improve triage quality, reduce manual reassignment, and make routing decisions more explainable. It does this by grounding generative AI in Salesforce data, instructions, and workflow context.</p><p><strong>## Core Agentforce capabilities</strong></p><p>Before discussing Prompt Builder specifically, it is useful to situate it within the broader Agentforce architecture. Agentforce is not merely a text-generation feature. It is Salesforce’s framework for building AI-assisted agents and guided experiences that reason over CRM context, follow explicit instructions, use approved enterprise data, and participate directly in platform workflows.</p><p>From an enterprise design perspective, Agentforce is useful for five reasons. It grounds responses in Salesforce records and knowledge, supports tasks such as summarization and classification, works with Flow and Apex rather than outside them, gives teams tighter control over prompts and outputs, and standardizes how incoming requests are interpreted across channels.</p><p>The operating benefits follow directly from that design: faster triage, less manual effort, more consistent decisions, better use of CRM context, stronger first-assignment accuracy, and clearer governance than teams usually get from standalone AI tools.</p><p>This is why Agentforce is well suited to enterprise solutioning. It combines AI assistance with process control, which is precisely what case intake and assignment workflows require.</p><p><strong>## LLM access and model flexibility in Agentforce</strong></p><p>One reason Agentforce is attractive to enterprise architects is that it is not simply an abstraction over a single large language model. Its value lies in the way Salesforce exposes model capability within a governed platform experience. Depending on product configuration, region, and current Salesforce support, organizations can use Agentforce through Salesforce-managed model access and supported provider options rather than coupling every workflow directly to a single external endpoint.</p><p>This gives organizations a platform-native way to use LLMs inside CRM workflows, more flexibility to balance model quality, cost, and governance, and a cleaner way to align model access with trust controls, grounded data, and workflow rules.</p><p>From a solutioning perspective, that flexibility is consequential. Different case operations may require different properties from the underlying model layer. One workflow may prioritize concise summarization. Another may require stronger classification consistency. A third may need lower latency for high-volume routing. Agentforce gives architects a more credible design surface for these trade-offs than a one-model-fits-all approach.</p><p>The practical implication is that enterprises are not simply procuring text generation. They are adopting a governed pathway for applying LLM capability within Salesforce service operations.</p><p><strong>## Why Prompt Builder matters in enterprise solutioning</strong></p><p>Enterprise solutioning is rarely just about answering a question. It usually involves understanding intent, identifying urgency, classifying the issue, gathering missing details, evaluating policy constraints, and determining ownership of the next action.</p><p>A customer email might say:</p><p>“We’ve had three failed invoice exports since yesterday and finance can’t close month-end. Please help.”</p><p>A human agent reads that and infers several things almost immediately: the issue likely affects production, it impacts finance operations, it may belong to billing or integration support, it is time-sensitive because month-end close is blocked, and it needs triage rather than a generic acknowledgment.</p><p>Prompt Builder allows that reasoning pattern to be encoded into a governed prompt experience. Instead of asking AI to “summarize the case,” teams can instruct it to classify issue type, infer business impact, identify missing intake fields, recommend assignment, and generate a structured triage payload for downstream automation.</p><p>That distinction separates AI used for content generation from AI used for enterprise solutioning.</p><p><strong>## The role of Agentforce Prompt Builder</strong></p><p>Salesforce Agentforce Prompt Builder gives teams a way to design prompts that are explicitly tied to business context. In practice, that means defining the AI role, the allowed inputs, the output structure, the instructions and constraints, and the next action in the process.</p><p>For case operations, this is valuable because support workflows are already information-dense. Cases carry account information, entitlement details, product context, SLA obligations, prior interactions, installed base information, and historical resolution patterns. Prompt Builder can use that context to improve triage quality before a case reaches a live representative.</p><p>From an operating model standpoint, this is important because it shifts effort away from repetitive interpretive work and toward exception handling, resolution, and escalation management. That is typically where enterprise service organizations want human expertise concentrated.</p><p><strong>## A practical use case: case intake and assignment</strong></p><p>Consider a large enterprise support organization receiving requests from email, portal forms, partner channels, and internal account teams. The intake problem is familiar: request detail is inconsistent, categories are wrong or missing, urgency is often misread, cases land in the wrong queue, and specialist teams spend time re-triaging instead of resolving.</p><p>Prompt Builder can introduce a structured intake layer over that variability.</p><p>A strong intake prompt should read the submitted issue, pull account and entitlement context, classify the request into standard issue domains, estimate impact and urgency, identify missing information, recommend the right queue, and draft a concise internal summary.</p><p>In this design, AI is not replacing routing rules. It is improving the quality of the signal available to them.</p><p><strong>## Designing prompts for enterprise outcomes</strong></p><p>The most common mistake in Prompt Builder is to write prompts that are overly generic. Enterprise prompts should be explicit, constrained, and operational.</p><p>Instead of this:</p><p>“Analyze this support case and suggest what to do.”</p><p>Use something closer to this approach:</p><p>“You are a service triage assistant for enterprise support operations. Review the case description, account context, entitlement details, installed products, and recent support history. Classify the issue into one of the approved support domains. Determine business impact using the company severity policy. Identify any missing information needed for diagnosis. Recommend the correct assignment queue and explain the routing rationale in one sentence. Return the result in a structured format suitable for case update automation.”</p><p>This prompt is stronger because it defines the AI role, the business context, the classification method, the decision logic, the output shape, and the downstream use.</p><p>In enterprise environments, prompt quality is largely a matter of reducing ambiguity, increasing behavioral consistency, and constraining failure modes.</p><p><strong>## Example workflow for case intake</strong></p><p>A practical case intake pattern in Salesforce typically looks like this:</p><p>1. A new case is created from email, form, or API.</p><p>2. Flow or Apex invokes a Prompt Builder experience.</p><p>3. The prompt evaluates the case text plus Salesforce context.</p><p>4. The output returns structured fields such as category, subcategory, severity recommendation, missing fields, and suggested queue.</p><p>5. Salesforce updates the case record.</p><p>6. Assignment rules, Flow, or Omni-Channel use those outputs to route work.</p><p>7. The assigned rep receives a clean internal summary instead of raw intake text.</p><p>This can produce measurable improvements in first-touch quality. It also reduces queue churn, which is costly for both customers and internal teams.</p><p><strong>## Improving assignment accuracy</strong></p><p>Assignment is where many service organizations lose time and operational efficiency. Traditional rules-based routing works well when inputs are clean and deterministic. It performs less well when the case narrative contains the real signal and the structured fields are incomplete.</p><p>Prompt Builder helps bridge that gap by extracting operationally relevant signal from the narrative itself.</p><p>In practice, assignment logic can evaluate product family, signals for integration or billing issues, customer segment, entitlement level, geographic or language needs, existing ownership patterns, open incident correlation, and regulatory sensitivity. On that basis, it may recommend Billing Operations, Tier 2 Technical Support, Integration Engineering, Customer Success Escalation, or a Security Response Team.</p><p>These recommendations should not be treated as autonomous decisions. They are better understood as decision-support signals that complement deterministic rules. In mature implementations, the stronger pattern is to keep policy and compliance logic deterministic, use Prompt Builder where the narrative contains the missing signal, and combine both in final routing.</p><p>That balance provides flexibility without sacrificing governance or operational accountability.</p><p><strong>## Structured outputs matter more than eloquent outputs</strong></p><p>In enterprise solutioning, a fluent paragraph is usually less useful than a reliable schema.</p><p>If the output will drive automation, the prompt should return a stable schema: primary and secondary issue type, severity recommendation, business impact summary, missing information, recommended queue, routing rationale, and suggested next action.</p><p>That matters because structured outputs are easier to validate, audit, store, report on, feed into Flows and assignment logic, and compare against human overrides.</p><p>The more operational the use case, the less value there is in unconstrained AI output.</p><p><strong>## Governance and trust</strong></p><p>Enterprise teams will not adopt AI-based intake at scale if they cannot explain how decisions are being made. Prompt Builder helps, but governance still has to be designed deliberately.</p><p>Key controls are straightforward: constrain prompts to approved classifications, ground them in trusted Salesforce data, log inputs and outputs where appropriate, separate recommendations from final actions in high-risk cases, require human review for legal or regulated workflows, and monitor override rates for drift and taxonomy issues.</p><p>A sound implementation does not aim for full autonomy on day one. It aims for useful, reviewable augmentation that can be improved over time.</p><p>For most organizations, the design objective should be controlled augmentation rather than immediate autonomy. That means defining where human approval is mandatory, where AI recommendations are advisory, and where low-risk actions can be automated with confidence.</p><p><strong>## Where Prompt Builder delivers the most value</strong></p><p>The strongest enterprise use cases usually share three characteristics: high volume, repetitive triage work, and important but pattern-based decisions.</p><p>That makes Prompt Builder a strong fit for service case intake, partner support classification, internal help desk routing, escalation summaries, renewal risk review preparation, complaint intake, and claims or exception pre-triage in industry workflows.</p><p>If teams are spending significant time reading unstructured submissions and rewriting them into CRM fields, there is a strong likelihood of a viable Prompt Builder use case.</p><p><strong>## What success looks like</strong></p><p>The value of Prompt Builder in case intake and assignment is not measured by whether the generated text sounds intelligent. It is measured by operational outcomes.</p><p>The metrics that matter are lower manual triage time, higher first-assignment accuracy, fewer reassignments, faster time to first meaningful action, better intake completeness, lower queue aging, and more consistent severity classification.</p><p>If those metrics improve, the prompt is contributing meaningful operational value.</p><p><strong>## A simple implementation strategy</strong></p><p>For organizations starting out, the most credible path is phased adoption.</p><p>Phase 1:</p><p>Use Prompt Builder to generate internal triage summaries and missing-information prompts for agents.</p><p>Phase 2:</p><p>Add classification recommendations for category, subcategory, and severity.</p><p>Phase 3:</p><p>Use AI outputs to inform assignment recommendations while keeping human approval or deterministic routing controls.</p><p>Phase 4:</p><p>Automate low-risk routing scenarios where prompt accuracy is consistently high.</p><p>This progression helps teams build trust, validate impact, and calibrate governance before expanding autonomy.</p><p><strong>## Final thought</strong></p><p>Salesforce Agentforce Prompt Builder is most valuable when it is treated as a business process instrument rather than merely an AI authoring feature.</p><p>For enterprise solutioning, the real opportunity is not to make support interactions sound smarter. It is to make intake cleaner, routing faster, and decisions more consistent. In case intake and assignment, Prompt Builder can become the layer that translates messy human requests into structured operational action.</p><p>That is also why Agentforce is more compelling in enterprise settings than generic AI tooling. It brings together prompt design, workflow orchestration, trusted business context, and access to LLM capability in a form that service organizations can operationalize with reasonable governance.</p><p>For architects and transformation leaders, the key point is straightforward: the value is not in the model alone. The value is in the system design around the model, including context selection, decision boundaries, workflow integration, and governance controls.</p><p>That is where generative AI starts to earn its place in the enterprise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27d9ef9323f4" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/using-salesforce-agentforce-for-enterprise-solutioning-case-intake-and-assignment-27d9ef9323f4">Using Salesforce Agentforce for Enterprise Solutioning, Case Intake, and Assignment</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting a Production-Grade PDF Document Summarisation Agent]]></title>
            <link>https://pub.towardsai.net/architecting-a-production-grade-pdf-document-synthesise-and-summarisation-agent-3a4d82186b14?source=rss-f93edef1348c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4d82186b14</guid>
            <category><![CDATA[model-evaluation]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[document-processing]]></category>
            <category><![CDATA[agentic-design-patterns]]></category>
            <dc:creator><![CDATA[Beau32]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 21:34:18 GMT</pubDate>
            <atom:updated>2026-04-17T04:47:19.535Z</atom:updated>
            <content:encoded><![CDATA[<h4>A layered approach to extracting structured, verifiable insight from unstructured documents.</h4><p>The ability to extract reliable, structured information from arbitrary PDF documents represents one of the more technically demanding problems in applied natural language processing. On the surface, the task appears tractable: retrieve text, issue a prompt, receive a summary. In practice, however, the gap between a functional prototype and a system that can be trusted on real-world documents — scanned, multi-hundred pages, domain-specific — spans a series of non-trivial engineering decisions.</p><p>This article presents a principled, layered architecture for building such a system. The reference implementation uses the following stack: pypdf and Docling for text extraction, OpenAI GPT-4o vision for scanned or image-heavy pages, OpenAI Embeddings for dense vector retrieval, DuckDB (with SQLite and PostgreSQL also supported) for persisting chunks and embeddings, LangChain for model routing, LangGraph for expressing the agent control flow as a typed state machine, and LangSmith for distributed tracing and observability. The system is exposed as a Python CLI accepting a document path, a natural-language query, and an output profile, producing a structured report.</p><p>The architecture is domain-agnostic. The same pipeline processes legal contracts, financial statements, and medical records with only the terminal prompt schema and domain profile changing between runs.</p><p><strong>The Foundational Problem</strong></p><p>The Portable Document Format is a presentation-oriented specification, not a document interchange format. Content is encoded as a sequence of positioned drawing operators — glyphs, paths, images, and form annotations — with no intrinsic notion of reading order, paragraph structure, or semantic hierarchy. Recovering meaningful, well-ordered text from this representation is a non-trivial extraction problem; the fidelity of every downstream component depends on solving it correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHM7q5Uno7D1gD-TdCIm6Q.png" /><figcaption>ReAct Architecture</figcaption></figure><p>Compounding this, transformer-based language models impose finite context windows. Feeding an entire multi-hundred-page document into a single inference call is not feasible even where token budgets would permit it, as attention dilution and positional degradation measurably reduce output quality on long contexts. A principled retrieval strategy — determining precisely what to send, when to send it, and how to synthesise evidence across multiple inference calls — is therefore a first-class architectural concern, not an optimisation.</p><p><strong>Layer 1: Document Extraction</strong></p><p>The extraction layer is responsible for converting raw PDF bytes into clean, page-scoped text. Three backend strategies address the different populations of documents encountered in practice.</p><p><em>Embedded-text extraction (pypdf / pdfplumber)</em></p><p>Digitally authored PDFs — those produced by word-processing or typesetting software — encode Unicode glyph streams that can be lifted directly from the file structure without rendering.</p><p>Strengths: deterministic output, zero inference cost, negligible latency, no external dependencies.</p><p>Applicability: restricted to documents with embedded text layers; unsuitable for scanned or raster-image content.</p><p><em>Multimodal vision extraction (OpenAI Vision API / GPT-4o)</em></p><p>Each page is rendered to a raster image and submitted to a multimodal language model, which transcribes the visual content and produces a structured textual representation.</p><p>Strengths: effective on scanned documents, handwritten annotations, mixed-layout pages, and embedded figures or charts.</p><p>Trade-offs: per-page inference cost, API latency, and rate-limit considerations at scale.</p><p>Document intelligence libraries (Docling, Azure Document Intelligence)</p><p>Purpose-built document understanding models infer the logical structure of a page — detecting paragraph boundaries, table cells, reading order, and section headings — and produce layout-aware output.</p><p>Strengths: high-fidelity table extraction, robust reading-order reconstruction, moderate cost relative to vision APIs.</p><p>Trade-offs: substantial runtime dependency, first-run model initialisation overhead.</p><p>Design recommendation: expose all three backends behind a unified interface, selected at runtime. The appropriate backend can then be chosen per document type without modifying the downstream pipeline. The embedded-text backend is suitable for the majority of programmatically generated documents; the heavier backends should be reserved for scanned or visually complex content.</p><p><strong>Layer 2: Chunking</strong></p><p>Extracted text must be segmented into retrievable units — chunks — prior to indexing. Chunk boundary placement has a measurable impact on both retrieval precision and synthesis quality, and should be treated as a deliberate design parameter rather than an implementation detail.</p><p><em>Properties of well-formed chunks</em></p><p>Semantic completeness — each chunk should encode a coherent unit of meaning; partial sentences or truncated clauses introduce ambiguity in synthesis.</p><p>Bounded token length — chunks must fit within the context budget of the retrieval prompt alongside several co-retrieved neighbours; a target range of 300 to 600 tokens per chunk is a practical default.</p><p>Boundary overlap — a one-to-two sentence overlap between adjacent chunks ensures that information near a boundary is represented in at least one complete chunk.</p><p>Source provenance — every chunk must carry its originating document name and page range as indexed metadata, enabling citations in the final output.</p><p><em>Sentence-aware sliding window</em></p><p>The recommended general-purpose segmentation strategy proceeds as follows: normalise whitespace and segment the page text into sentences using punctuation-aware splitting; accumulate sentences into a sliding window until the target token budget is reached, then advance the window by a stride shorter than the window size to produce overlap; assign each chunk a composite identifier comprising the document name, page start, page end, and chunk index.</p><p>Fixed-character or fixed-byte segmentation is inadvisable, as it introduces arbitrary cuts at linguistically incoherent positions.</p><p><strong>Layer 3: The Retrieval Index</strong></p><p>The retrieval index maps a natural-language query to the subset of chunks most likely to contain relevant evidence. Three retrieval paradigms are in common use; the optimal configuration combines all three.</p><p><em>Lexical search</em></p><p>Term-frequency-based retrieval (BM25 or analogous scoring functions) operates over tokenised chunk text. It is computationally efficient, entirely deterministic, and well-suited to queries involving specific named entities, dates, citations, or numerical values.</p><p><em>Semantic search</em></p><p>Dense vector retrieval embeds both the query and all document chunks into a shared latent space using a pre-trained embedding model. Cosine similarity between query and chunk embeddings provides a relevance signal that generalises across paraphrase and terminological variation.</p><p><em>Hybrid retrieval with score fusion</em></p><p>Executing both retrieval strategies and merging the ranked result lists via Reciprocal Rank Fusion consistently outperforms either strategy in isolation, particularly on queries that combine specific entity lookup with conceptual reasoning.</p><p>Index persistence: chunk text and computed embeddings are persisted to a local analytical database — DuckDB by default, with SQLite and PostgreSQL also supported — keyed by a deterministic hash of the document path, file size, modification time, and chunking parameters. This ensures that the embedding computation is incurred only once per document per configuration. A rebuild flag is exposed to invalidate the cache when necessary.</p><p><strong>Layer 4: The Agent Loop</strong></p><p>The agent loop is the central orchestration component and has the greatest influence on output quality. A single-pass pipeline issues one retrieval query, passes the results to the model, and returns whatever is produced. A well-designed iterative agent loop decomposes the query into sub-goals, retrieves evidence incrementally, synthesises with citation tracking, reflects on coverage and confidence, and iterates until a termination criterion is met.</p><p>The control flow proceeds through five stages: Plan (decompose the query into targeted sub-steps), Retrieve (execute retrieval for each sub-step), Synthesise (extract structured claims from each evidence batch), Reflect (assess coverage confidence and identify remaining gaps), and Answer (produce the final structured output, returning to Retrieve while confidence remains below the threshold).</p><p>Step 1: Query decomposition</p><p>The model is prompted to decompose the user’s query into two to six concrete, independently addressable sub-questions. The response is constrained to a typed schema, ensuring the output is always machine-parseable and never freeform text. For a financial report query, the system would produce a structured plan containing a stated goal alongside discrete steps such as locating revenue and profit figures, extracting balance sheet totals, identifying cash flow from operations, surfacing significant one-off items, and locating the auditor’s opinion. Each step is handled independently in the retrieval phase that follows.</p><p>Step 2: Selective retrieval</p><p>For each planned sub-step, a retrieval query is issued against the indexed chunk store. The model selects the retrieval modality — lexical, semantic, or hybrid — via a constrained structured output that also records the reasoning behind the choice. This makes every retrieval decision explicit and auditable: a sub-step that combines a specific figure lookup with surrounding narrative context would select hybrid mode, with that rationale preserved in the run trace.</p><p>Step 3: Batch synthesis with claim extraction</p><p>Retrieved chunks are presented to the model in configurable batches. Rather than producing unstructured narrative, the model is instructed to extract discrete, citable claims — each accompanied by a page citation, a verbatim supporting excerpt from the source document, and an importance weight between zero and one. A batch-level summary and a list of identified evidence gaps are also produced alongside the claims.</p><p>Expressing synthesis output as a typed structure enables programmatic operations on the results: deduplication of repeated findings across batches, importance-weighted ranking of claims, and gap-driven generation of follow-up retrieval queries.</p><p>Step 4: Confidence-based reflection</p><p>After each synthesis round, the model performs a structured self-assessment, producing a plain-language observation summary (for example, “revenue and profitability sufficiently covered; cash flow and audit opinion outstanding”), a numeric confidence score between zero and one, and two flags indicating whether the system is ready to produce a final answer and whether a deeper targeted search is warranted.</p><p>When the confidence score falls below a configurable threshold — typically 0.75 — the loop returns to retrieval, issuing targeted queries against the identified gaps. The loop is bounded by a maximum iteration count to ensure termination. If the threshold is not reached after the maximum iterations, the system raises a human-input request rather than returning a low-confidence result without disclosure.</p><p>Step 5: Domain-specific final synthesis</p><p>When the reflection stage signals readiness, the accumulated claims are synthesised into the final output using a domain-specific prompt and output schema. For financial documents this covers the income statement, balance sheet, cash flow, key performance indicators, significant items, auditor’s opinion, risk disclosures, and forward guidance. For legal documents: parties, jurisdiction, material findings, precedents cited, and relief or orders granted. For medical and underwriting documents: diagnoses, procedures, clinical chronology, condition associations, and risk indicators.</p><p>Layer 5: State Machine Orchestration with LangGraph</p><p>Expressing the agent loop as a formal directed graph, rather than as imperative procedural code, provides significant engineering advantages: individual nodes can be unit-tested in isolation, the control flow is visually inspectable, and new nodes — such as a human-review gate — can be inserted without modifying existing wiring.</p><p>LangGraph provides a typed state graph abstraction well-suited to this pattern. Each stage of the loop becomes a discrete node; conditional edges route between them based on the reflection outcome, directing the flow to continue iterating, proceed to the final answer, or pause for human review.</p><p>The state object serves as the canonical data carrier across all nodes, holding the original query, accumulated claim set, iteration counter, current confidence estimate, outstanding evidence gaps, and the in-progress or finalised answer.</p><p>Checkpointing: LangGraph supports serialising the agent state to a persistent store between node transitions. This enables mid-run resumption following process interruption — particularly important when processing documents whose extraction and indexing phases may take several minutes.</p><p><strong>Layer 6: Output Verification</strong></p><p>Language model outputs exhibit well-documented inconsistency properties; production systems must include verification mechanisms to enforce output contracts and maintain result quality.</p><p>Schema validation: each model response is validated against the declared output schema; responses that do not conform are rejected and the model is re-prompted with a targeted repair instruction.</p><p>Citation grounding: for each extracted claim, the supporting excerpt is verified against the source chunk text via substring matching; claims whose excerpts cannot be grounded are flagged for downstream review.</p><p>Structural verification: when the output format is a structured document, it is parsed to confirm section completeness and the absence of malformed constructs.</p><p>Completeness scoring: a quality score is computed as the proportion of required output fields that are populated; this score is emitted alongside the result payload.</p><p>These mechanisms do not constitute a semantic correctness guarantee, but they substantially raise the quality floor of outputs reaching the end consumer.</p><p><strong>Layer 7: Observability and Distributed Tracing</strong></p><p>Operational visibility into agent behaviour is a prerequisite for systematic quality improvement and cost management.</p><p>LangSmith integrates natively with LangGraph to capture a complete execution trace for every run — each node invocation, model call, prompt content, token usage, and wall-clock duration is recorded and queryable. Per-stage token accounting enables attribution of inference cost to specific pipeline components, informing optimisation priorities. Structured run statistics are emitted at the conclusion of each run: total token consumption, end-to-end wall time, iteration count, final confidence, and terminal state (completed, timed out, or escalated to human review).</p><p>Complete System Data Flow</p><p>A document enters the pipeline as a raw PDF file. The extraction layer converts it to normalised page text and metadata using the appropriate backend. The chunking engine segments that text into overlapping, page-scoped units, each assigned a composite identifier. Those chunks are embedded and persisted to the retrieval index, keyed by a deterministic document hash and rebuilt only when the source changes. The agent loop — implemented as a LangGraph state machine — then plans, retrieves, synthesises, and reflects iteratively until a confidence threshold is met, at which point a final structured result is produced.</p><p><strong>Conclusion</strong></p><p>Constructing a document summarisation agent that operates reliably across document types, scales, and domains requires treating each architectural layer as a first-class engineering concern. Extraction fidelity determines the quality of the evidence available to all subsequent components. Chunking precision determines the resolution of retrieval. Hybrid retrieval maximises recall across query types. The iterative agent loop — with structured decomposition, evidence batching, and confidence-based reflection — produces outputs of materially higher quality than single-pass inference. LangGraph provides a testable, extensible substrate for expressing that loop. Output verification enforces structural contracts on every result. Observability enables continuous measurement and improvement.</p><p>The unifying principle across all layers is the same: enforce structure at every model boundary. Define typed input and output schemas for each inference call, validate conformance, and treat any deviation as a first-class event requiring remediation. This discipline transforms the language model from an opaque text generator into a dependable reasoning component whose outputs can be grounded, cited, and audited.</p><p>The cumulative effect is a agentic system whose architecture is composable by design. Extraction backends, domain schemas, output destinations, and retrieval strategies can each be extended or replaced without modifying the remaining components. That composability reflects sound software engineering principles — and it is what makes the difference between a research prototype and a system that can be deployed with confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4d82186b14" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/architecting-a-production-grade-pdf-document-synthesise-and-summarisation-agent-3a4d82186b14">Architecting a Production-Grade PDF Document Summarisation Agent</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>