Warddocs
Cookbooks

AML statement review

A compliance analyst has twelve monthly PDFs for a customer and needs to know whether to escalate.

from pathlib import Path
from ward import Ward

client = Ward()
files = sorted(Path("cust_1042").glob("*.pdf"))

d = client.statement(files, profile={"monthly_income": 3200, "occupation": "nurse"}, focus="aml",
                     subject_ref="cust_1042", subject_consent=True, session_id="case_771")

print(d.decision, d.band, d.signals)          # e.g. STEP_UP medium ['STM_PASS_THROUGH', 'STM_FAN_IN']

for q in ["why is the risk high?", "which counterparties matched a list?", "largest movements"]:
    print(client.ask(q, decision=d).answer)

if d.decision != "APPROVE":
    pack = client.evidence(d.id)              # facts, signals, flagged rows, lists, goAML draft
    open_case("cust_1042", pack)

Large histories: send run_async=True and wait with client.jobs.wait(job.id). Unknown layouts: handle needs_mapping once as in Files in any format.

When the case closes, send the outcome:

client.feedback(d.id, correct=True, label="money_laundering")