Skip to content

oroxenberg/finance-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Financial Operations Agent

An agentic financial operations assistant built with the Claude Agent SDK, exposed via an Express HTTP API. Designed for a large-scale digital bank serving millions of customers across checking accounts, savings accounts, and digital wallets.

Architecture

Express Server (:3000)
  POST /api/chat   → Claude Agent (claude-sonnet-4-5)
  GET  /api/health → Health check
                          │
                          ▼
                    5 Custom MCP Tools
                          │
                          ▼
                    Mock Data Layer
              (accounts, transactions, risk profiles)

The agent runs as a single Claude instance with custom tools registered via createSdkMcpServer. It connects to Azure AI Foundry as the model provider.

Tools

Tool Description
get_account_balance Look up account balance, status, and metadata
get_transaction_history Query transactions with date range and limit filters
calculate_risk_score Get risk score (0-100), risk factors, and recommendation
generate_compliance_report Generate AML, KYC, or daily summary reports
flag_suspicious_activity Flag a transaction and create a fraud investigation case

Setup

Prerequisites

  • Bun runtime
  • Claude Code CLI installed (claude command available)
  • Azure AI Foundry credentials (or a direct Anthropic API key)

Install

bun install

Configure

Copy the example env file and fill in your credentials:

cp .env.example .env
ANTHROPIC_FOUNDRY_API_KEY=your-azure-foundry-api-key
ANTHROPIC_FOUNDRY_BASE_URL=https://your-resource.services.ai.azure.com
PORT=3000

To use a direct Anthropic API key instead of Azure Foundry, set ANTHROPIC_API_KEY and remove the Foundry variables. You'll need to update src/agent.ts to skip the initAzureFoundry() call.

Run

bun run start

Or with auto-reload:

bun run dev

API

GET /api/health

Returns server status.

curl http://localhost:3000/api/health
{ "status": "ok", "timestamp": "2026-03-15T13:35:05.027Z" }

POST /api/chat

Send a message to the agent.

curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Check the balance and risk score for account ACC-004"}'
{ "response": "Account ACC-004 belongs to Can Öztürk..." }

Example queries

# Account investigation
curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Check the balance and risk score for account ACC-004"}'

# Compliance report
curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Generate an AML compliance report"}'

# Fraud flagging
curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Flag transaction TXN-030 — appears to be structuring to avoid reporting thresholds"}'

# Transaction analysis
curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Show me the recent transactions for account ACC-008 and assess if anything looks suspicious"}'

Project Structure

src/
├── index.ts              # Express server
├── agent.ts              # Agent config, system prompt, Azure Foundry init
├── tools/
│   ├── index.ts          # Barrel export
│   ├── helpers.ts        # toolResponse/toolError utilities
│   ├── balance.ts        # get_account_balance
│   ├── transactions.ts   # get_transaction_history
│   ├── risk-score.ts     # calculate_risk_score
│   ├── compliance.ts     # generate_compliance_report
│   └── fraud.ts          # flag_suspicious_activity
└── data/
    ├── accounts.ts       # 10 mock accounts
    ├── transactions.ts   # 31 mock transactions
    └── risk-profiles.ts  # 10 mock risk profiles

Mock Data

The agent operates on realistic mock data representing a Turkish digital bank:

  • 10 accounts across checking, savings, and digital wallet types
  • 31 transactions including normal activity, suspicious patterns, and structuring attempts
  • 10 risk profiles ranging from low (score 5) to critical (score 92)

Notable accounts for testing:

  • ACC-004 — Frozen account, risk score 92, multiple large withdrawals
  • ACC-008 — Active account, risk score 68, crypto structuring pattern
  • ACC-001 — Normal active account, low risk

Tech Stack

About

Agentic financial operations assistant built with Claude Agent SDK, Express, and Azure AI Foundry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors