Objective
SAR-narrative quality is analyst-dependent: the same fact pattern yields a strong narrative from a senior and an inconsistent one from a junior, and the examiner sees the variance. This recipe retrieves the most semantically similar prior SARs for a new case, so the analyst starts from proven language for the matching typology — consistency by construction.
Step 1: Your SAR history with narrative embeddings
DROP TABLE IF EXISTS sar_hist;
CREATE TABLE sar_hist (
sar_id TEXT PRIMARY KEY,
typology TEXT,
narrative TEXT,
emb VECTOR(384)
);
INSERT INTO sar_hist VALUES
('SAR-9001','structuring',
'Customer made repeated sub-10k cash deposits across several days totaling well over the reporting threshold.',
EMBED('Customer made repeated sub-10k cash deposits across several days totaling well over the reporting threshold.')),
('SAR-9002','layering',
'Funds moved rapidly through three shell accounts before an offshore cashout.',
EMBED('Funds moved rapidly through three shell accounts before an offshore cashout.'));