How to Build a claims processing Agent Using AutoGen in TypeScript for wealth management

By Cyprian AaronsUpdated 2026-04-21
claims-processingautogentypescriptwealth-management

A claims processing agent for wealth management takes a client-submitted claim, gathers the supporting facts, checks policy and account rules, routes exceptions to the right human, and produces an auditable decision trail. In wealth management, that matters because claims often touch regulated assets, beneficiary instructions, tax-sensitive events, and jurisdiction-specific compliance requirements.

Architecture

  • Client intake layer

    • Receives claim data from a portal, CRM, or case management system.
    • Normalizes inputs like claimant identity, account IDs, timestamps, and attachments.
  • AutoGen orchestrator

    • Coordinates specialized agents using GroupChat and GroupChatManager.
    • Keeps the workflow deterministic enough for audit and review.
  • Policy verification agent

    • Checks claim facts against product rules, account terms, KYC/AML flags, and jurisdiction constraints.
    • Escalates if the claim conflicts with compliance or missing documentation.
  • Document evidence toolchain

    • Extracts data from statements, ID docs, death certificates, transfer forms, or letters of authority.
    • Stores hashes and metadata for auditability.
  • Decisioning and escalation layer

    • Produces approve/reject/manual-review outcomes.
    • Sends high-risk or ambiguous cases to a human reviewer.
  • Audit and observability sink

    • Persists prompts, model outputs, tool calls, approvals, and final rationale.
    • Supports retention policies and data residency controls.

Implementation

1) Install AutoGen for TypeScript and define your agent runtime

Use the TypeScript AutoGen package that exposes AssistantAgent, UserProxyAgent, GroupChat, and GroupChatManager. The pattern below keeps the LLM-facing logic separate from your application boundary.

npm install @autogenai/autogen
import {
  AssistantAgent,
  UserProxyAgent,
  GroupChat,
  GroupChatManager,
} from "@autogenai/autogen";

const policyAgent = new AssistantAgent({
  name: "policy_agent",
  systemMessage:
    "You verify wealth management claim eligibility using policy rules. " +
    "Return concise findings with citations to provided case data only.",
});

const triageAgent = new AssistantAgent({
  name: "triage_agent",
  systemMessage:
    "You classify claims into approve, reject, or manual_review. " +
    "Always prefer manual_review when documentation is incomplete.",
});

const userProxy = new UserProxyAgent({
  name: "ops_proxy",
});

const groupChat = new GroupChat({
  agents: [userProxy, policyAgent, triageAgent],
  messages: [],
  maxRounds: 6,
});

const manager = new GroupChatManager({
  groupchat: groupChat,
});

2) Add a structured case payload and start a controlled conversation

For wealth management claims, do not let the model infer missing fields. Pass a strict case object with account metadata, residency context, and document status.

type ClaimCase = {
  claimId: string;
  clientId: string;
  accountType: "brokerage" | "advisory" | "retirement" | "trust";
  jurisdiction: string;
  residencyCountry: string;
  claimantRelationship: string;
  eventType: "death" | "incapacity" | "transfer_request" | "beneficiary_claim";
  documentsReceived: string[];
};

const claimCase: ClaimCase = {
  claimId: "CLM-20491",
  clientId: "C-88102",
  accountType: "trust",
  jurisdiction: "GB",
  residencyCountry: "GB",
  claimantRelationship: "executor",
  eventType: "death",
  documentsReceived: ["death_certificate", "grant_of_probate", "id_document"],
};

async function run() {
  const prompt = `
Review this wealth management claim case:
${JSON.stringify(claimCase, null, 2)}

Tasks:
1. Check whether required documents are present.
2. Flag any compliance issues based on jurisdiction/residency.
3. Return one of approve | reject | manual_review.
4. Provide an audit-friendly rationale.
`;

  const result = await userProxy.initiateChat(manager as any, prompt);
}

run().catch(console.error);

3) Force a machine-readable decision format

In production you want downstream systems to consume structured output. Ask the agents to emit JSON only so your orchestration layer can validate it before any action is taken.

const decisionSchemaHint = `
Return JSON in this exact shape:
{
  "claimId": string,
  "decision": "approve" | "reject" | "manual_review",
  "reasonCodes": string[],
  "missingDocuments": string[],
  "complianceFlags": string[],
}
`;

const promptWithSchema = `
${decisionSchemaHint}

Case:
${JSON.stringify(claimCase)}

Do not include markdown or extra text.
`;

await userProxy.initiateChat(manager as any, promptWithSchema);

Step-by-step workflow pattern

  1. Ingest the claim

    • Normalize identity fields and attach document metadata.
    • Reject incomplete payloads before they hit the model.
  2. Run policy review

    • Let policyAgent inspect only approved case fields.
    • Keep external lookups behind explicit tools you control.
  3. Triage the outcome

    • Use triageAgent to convert findings into one of three actions.
    • Route anything ambiguous to manual review.
  4. Persist the audit trail

    • Store input payloads, agent messages, final decision JSON, timestamps, and reviewer overrides.
    • Hash documents so you can prove what was reviewed later.

Production Considerations

  • Deployment boundaries

    • Keep the agent inside a private VPC or equivalent isolated network segment.
    • For regulated accounts, pin storage and inference routing to approved regions to satisfy data residency requirements.
  • Monitoring


Keep learning

By Cyprian Aarons, AI Consultant at Topiax.

Want the complete 8-step roadmap?

Grab the free AI Agent Starter Kit — architecture templates, compliance checklists, and a 7-email deep-dive course.

Get the Starter Kit

Related Guides