Anthropic's financial-services repo: Claude for finance, explained

A guided tour of Anthropic's open-source reference implementations for deploying Claude in financial services contexts — document understanding, agentic compliance workflows, and risk assessment pipelines.

Estimated time
~30 min
Difficulty
intro
Sources
3 sources

What problem does this repo solve?

Large language models can read text — but “reading” an earnings report, a KYC packet, or a regulatory filing is not the same as reading a news article. Financial documents carry dense domain conventions: XBRL tags, Basel III ratios, ISDA schedules, FATF red flags. A general-purpose chatbot can summarize them; a well-engineered Claude integration can extract structured data, flag anomalies, and trigger downstream actions.

The anthropics/financial-services repository [anthropics/financial-services on GitHub] is Anthropic’s open-source collection of reference implementations — working code templates that show how to wire Claude into financial services workflows correctly. It is not a product you ship to customers. It is a starting kit that answers the question: “What does a production-grade Claude integration for finance actually look like?”

What's inside: the three pillars

The repository organizes its patterns around three core capability areas:

Capability area What it does Example use case
Document Understanding Document UnderstandingExtract structured data from unstructured financial documentsParse a 10-K filing into a structured JSON of revenue, liabilities, and risk factors
Agentic Workflows Agentic WorkflowsChain multiple Claude calls with tool use to complete multi-step tasksOrchestrate a loan application from document intake → risk scoring → compliance check → decision memo
Compliance & Risk Compliance & RiskEvaluate documents or transactions against regulatory criteriaCheck a client profile against AML / KYC requirements and flag red-flag indicators
The three core areas in the financial-services repo

Document Understanding patterns teach Claude to go beyond summarization. Instead of “this report mentions declining revenue,” the extracted output is { revenue_trend: "declining", pct_change: -12.3, period: "FY2024" } — machine-readable, downstream-usable.

Agentic Workflows patterns use Claude’s tool-use capability. Claude doesn’t just respond to a single prompt; it calls functions (fetch document, run calculation, query database, send alert) and orchestrates a multi-step process. The repo provides the scaffolding for this loop.

Compliance and Risk patterns show how to represent regulatory criteria as prompts or tool definitions, then have Claude evaluate documents against them systematically — with citations back to the specific text that triggered each flag.

What is 'tool use' in the context of Claude and why does it matter here?

Claude’s tool-use feature (sometimes called “function calling”) lets you define a set of functions — lookup_customer(id), calculate_debt_to_income(income, debts), write_case_note(text) — and tell Claude it may call them. Claude decides when to call which tool, interprets the result, and continues reasoning.

In financial services this matters because the real work is never just reading a document. It is reading a document, querying a database for historical context, calculating a ratio, checking a compliance list, and writing a memo. Tool use is what connects Claude to all those steps in a single orchestrated workflow rather than requiring a human to copy-paste between systems.

How the pipeline works: a concrete example

Let’s trace a single document — a loan application — through the kind of pipeline the repo enables. The interactive diagram below lets you select a document type and watch which modules activate.

Pipeline trace (static fallback)

For a loan application:

  1. Ingest — PDF or structured form arrives. Claude extracts fields: applicant name, income, existing debts, requested amount.
  2. Enrich — Tool call: query credit bureau API. Tool call: calculate debt-to-income ratio.
  3. Compliance check — Claude evaluates extracted profile against KYC/AML rules. Outputs: [PASS, PASS, FLAG: PEP match].
  4. Risk score — Claude synthesizes extracted data + credit bureau result → risk tier (A/B/C/D).
  5. Decision memo — Claude drafts a structured memo with findings, flags, and a recommended decision. A human underwriter reviews.

Each step corresponds to a pattern in the repo. No step is magic; each is a well-scoped Claude API call with a clear input/output contract.

Getting started as a developer

extract_document.py Minimal pattern: extract structured data from a financial document
import anthropic
import json

client = anthropic.Anthropic()

# The schema you define becomes the output contract
EXTRACTION_SCHEMA = {
    "type": "object",
    "properties": {
        "company_name": {"type": "string"},
        "fiscal_year": {"type": "integer"},
        "total_revenue_usd": {"type": ["number", "null"]},
        "net_income_usd": {"type": ["number", "null"]},
        "risk_factors": {"type": "array", "items": {"type": "string"}}
    }
}

def extract_from_10k(document_text: str) -> dict:
    response = client.messages.create(
        model="claude-opus-4-5",
        max_tokens=1024,
        messages=[{
            "role": "user",
            "content": f"""Extract the following fields from this 10-K filing.
Return ONLY valid JSON matching this schema: {json.dumps(EXTRACTION_SCHEMA)}
If a field cannot be found, use null.

Document:
{document_text}"""
        }]
    )
    return json.loads(response.content[0].text)

The repo extends this pattern significantly — adding retry logic, schema validation, confidence scoring, and multi-document batch processing. But the core is exactly this simple shape.

Practical steps to get started:

  1. Clone the repo from github.com/anthropics/financial-services [anthropics/financial-services on GitHub] .
  2. Set your ANTHROPIC_API_KEY environment variable.
  3. Browse the examples/ directory — each subdirectory is a self-contained use case with a README.
  4. Run the example closest to your use case against a sample document.
  5. Adapt the extraction schema to your domain’s specific fields.

When NOT to use this repo — trade-offs

Situation Use the repo? Why
Building a new Claude integration for document extraction Building a new Claude integration for document extractionYes — start hereAvoids reinventing extraction patterns; saves days of prompt engineering
Deploying a compliance tool directly to regulators Deploying a compliance tool directly to regulatorsNo — use as reference onlyThe patterns are not certified compliance software; legal review required
Prototyping or internal tooling Prototyping or internal toolingYes — ideal use caseFast path to a working prototype with real document types
Need a non-Python integration (e.g., Java, Go) Need a non-Python integration (e.g., Java, Go)Partial — patterns are portablePrompt patterns and workflows translate to any language; code needs rewriting
Need real-time transaction monitoring at high throughput Need real-time transaction monitoring at high throughputNot designed for thisClaude API latency (~1–5s per call) makes sub-second transaction screening impractical
When to use vs. when not to use the financial-services repo