# Reliable, Smart Workflows for Finance, Wealth and Insurance — Karthic Rao, Perpetual

## Executive summary

This presentation outlines an architecture for building reliable and intelligent workflows in highly regulated sectors (Finance, Wealth, Insurance). The core challenge is reconciling the need for deterministic compliance (reliability) with the ambiguity of real-world processes (intelligence). The proposed solution is a hybrid system where control flow, evidence, and external actions are managed by a deterministic system, while Large Language Models (LLMs) are restricted to explicit, typed points for interpretation and judgment. This approach ensures that any judgment made by AI must pass through a compiler that validates it against predefined 'action contracts,' creating immutable, auditable plans.

## Key takeaways

- The Reliability vs. Intelligence Boundary: In regulated industries, reliability and intelligence are not contradictory. The key is defining the boundary: Determinism must govern the flow of control, evidence, and side effects, while intelligence handles interpretation and judgment (e.g., reading ambiguous instructions or client responses).
- The Problem of Ambiguity in Wealth Management: A simple request, like 'Fill out the W-9 form for Mr. Harper,' can become a multi-day process involving resolving ambiguity (e.g., identifying the correct 'Harper' family), gathering missing data, and obtaining multiple signatures. Fixed flowcharts fail when ambiguity arises.
- Deterministic Planning and Compilation: The system uses a planner to translate a request into a semantic graph. This graph is then passed to a compiler, which validates it against the firm's action contracts. The compiler returns a valid plan, a clarification request, or a refusal. Approved plans are immutable and hashed.
- State Management and Controlled AI Usage: Waiting and follow-ups are managed as state machine steps, not automatic retries. External actions (like sending an email or requesting a signature) have separate gates tied to the exact payload, ensuring no action leaves the company without explicit approval.
- Scaling Inference and Compliance: The design targets using smaller, 'Flash'-class models for the majority of decisions (e.g., 19 out of 20 decisions), reserving the larger, frontier model only for the most complex cases. This allows for private, locally hosted inference while maintaining compliance.

## Technical details

- Workflow Architecture: The system separates concerns: the Planner translates the request into a semantic graph (nodes point back to the request). The Compiler validates this graph against the firm's action contracts (e.g., 42 procedural nodes covering models, documents, emails, signatures).
- Action Contracts and Gates: Every external action (e.g., sending an email, requesting a signature) must pass through a dedicated gate. This gate requires explicit, typed payload approval, ensuring the action is safe and known to the company.
- State Machines and Auditing: Waiting periods and follow-ups are modeled as state machine steps. The system tracks the provenance of data (how and when a value was obtained), which is critical for compliance. The process is designed to handle partial responses, pausing the workflow until confirmation.
- Model Efficiency and Deployment: The architecture minimizes reliance on large models by designing workflows such that 95% of decisions can be handled by smaller, specialized models. This allows the system to achieve local, private inference, significantly lowering compliance risk.

## Practical implications

- For build engineers, this model suggests treating complex business logic not as monolithic code, but as a graph of validated, state-managed steps.
- The concept of a 'Compiler' validating AI-generated plans against 'Action Contracts' provides a robust pattern for integrating LLMs into regulated enterprise systems.
- The focus on 'typed, logged judgments' and 'private inference' offers a clear path for deploying advanced AI features while satisfying strict data privacy and compliance requirements.

## Topics

Workflow Automation, Regulatory Compliance, Large Language Models (LLMs), State Machines, Semantic Graph Theory, Build Engineering, Financial Technology (FinTech), hackintoshrao, Karthic Rao

Source: https://www.youtube.com/watch?v=8g0g1ncwzG0
