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 Understanding | Extract structured data from unstructured financial documents | Parse a 10-K filing into a structured JSON of revenue, liabilities, and risk factors |
| Agentic Workflows | Agentic Workflows | Chain multiple Claude calls with tool use to complete multi-step tasks | Orchestrate a loan application from document intake → risk scoring → compliance check → decision memo |
| Compliance & Risk | Compliance & Risk | Evaluate documents or transactions against regulatory criteria | Check a client profile against AML / KYC requirements and flag red-flag indicators |
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:
- Ingest — PDF or structured form arrives. Claude extracts fields: applicant name, income, existing debts, requested amount.
- Enrich — Tool call: query credit bureau API. Tool call: calculate debt-to-income ratio.
- Compliance check — Claude evaluates extracted profile against KYC/AML rules. Outputs:
[PASS, PASS, FLAG: PEP match]. - Risk score — Claude synthesizes extracted data + credit bureau result → risk tier (A/B/C/D).
- 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
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:
- Clone the repo from
github.com/anthropics/financial-services[anthropics/financial-services on GitHub] . - Set your
ANTHROPIC_API_KEYenvironment variable. - Browse the
examples/directory — each subdirectory is a self-contained use case with a README. - Run the example closest to your use case against a sample document.
- 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 extraction | Yes — start here | Avoids reinventing extraction patterns; saves days of prompt engineering |
| Deploying a compliance tool directly to regulators | Deploying a compliance tool directly to regulators | No — use as reference only | The patterns are not certified compliance software; legal review required |
| Prototyping or internal tooling | Prototyping or internal tooling | Yes — ideal use case | Fast 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 portable | Prompt 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 throughput | Not designed for this | Claude API latency (~1–5s per call) makes sub-second transaction screening impractical |