Objective
Quarterly compliance reviews are weeks of human ticking against transactions, KYC docs, and regulatory updates. In this recipe you set up a tiny FinServ database with wires, KYC notes, and regulation snippets, then ask a compliance-reviewer persona to audit Q2 wires for PEP exposure via SELECT AGENT_RUN(...). The full audit trail — every query the agent ran, every doc it touched, every regulation it cited — stays in the same database that holds the answer.
Requires: SynapCores v1.6.6.9+ (
AGENT_RUN). Configure a tool-capable model in[query.ai_service]— recommended:qwen2.5-coder:7bvia the embeddedlocalprovider (v1.8 default — no Ollama daemon required), or via Ollama / OpenAI / Anthropic.
Step 1: Create transactions + KYC + regulation tables
CREATE TABLE IF NOT EXISTS recipe_fs_wires (
wire_id INTEGER PRIMARY KEY,
customer_id INTEGER,
counterparty TEXT,
country TEXT,
amount_usd DOUBLE,
posted_at TIMESTAMP
);
CREATE TABLE IF NOT EXISTS recipe_fs_kyc (
customer_id INTEGER PRIMARY KEY,
legal_name TEXT,
pep_status TEXT, -- 'clear' | 'self' | 'family' | 'associate'
risk_rating TEXT, -- 'low' | 'medium' | 'high'
notes TEXT
);
CREATE TABLE IF NOT EXISTS recipe_fs_regs (
reg_id INTEGER PRIMARY KEY,
section TEXT,
body TEXT,
embedding VECTOR(384)
);
Step 2: Seed
INSERT INTO recipe_fs_wires VALUES
(5001,1,'Acme Imports GmbH','DE', 240000.00,'2026-04-12 09:31:00'),
(5002,1,'Acme Imports GmbH','DE', 9800.00,'2026-04-14 10:02:00'),
(5003,1,'Acme Imports GmbH','DE', 9800.00,'2026-04-14 10:04:00'),
(5004,1,'Acme Imports GmbH','DE', 9800.00,'2026-04-14 10:09:00'),
(5005,2,'BlueOak Trading Ltd','UK', 18500.00,'2026-04-18 14:11:00'),
(5006,3,'Polaris Holdings','VG', 145000.00,'2026-04-22 08:55:00');
INSERT INTO recipe_fs_kyc VALUES
(1,'Marcus Klein','clear','medium','Long-standing import client. EU.'),
(2,'Susan Wright','self','high','Listed on national PEP list (former minister).'),
(3,'Anonymous Director, Polaris Holdings','associate','high','BVI shell. UBO opaque. Politically exposed associate of named individual.');
INSERT INTO recipe_fs_regs (reg_id, section, body) VALUES
(1,'BSA Structuring','Multiple cash or wire transactions in close succession that individually fall below the $10,000 reporting threshold but in aggregate exceed it are presumed to be structuring under 31 USC 5324. SAR filing is required where the pattern is identified.'),
(2,'OFAC Sanctions','Transactions involving counterparties in sanctioned jurisdictions or sanctioned individuals are prohibited. Verify against OFAC SDN list before posting.'),
(3,'PEP Enhanced Due Diligence','Customers identified as Politically Exposed Persons (PEPs), or their family members or close associates, are subject to enhanced due diligence including source-of-funds review and senior compliance approval for transactions over $50,000.'),
(4,'High-Risk Jurisdictions','Wires to or from FATF high-risk jurisdictions or known offshore secrecy havens (BVI, Cayman, Panama, certain others) require additional documentation and explicit risk-based review.'),
(5,'Beneficial Ownership','Where the beneficial owner of a counterparty is unclear or shielded by nominee directors, escalate for UBO investigation before processing transactions above $25,000.');