Finance Demo

Regulatory Document Agent

A spec-driven compliance agent that compares MAS notice changes, checks evidence quality, and emits a cited impact report.

Runnable demo · Repo path: workshops/workshop1-compliance

Structure Blueprint

Regulatory Document Agent blueprint

Clickable pattern simulator

Interactive Browser Demo

This simulator does not replace the CLI run, but it makes each step, state, log, gate and final output visible in the browser.

Live pipeline

State inspector

Execution log

Current output

Step-by-step Design

01

SDD Contract

The spec defines input evidence, output schema, citation requirements, confidence threshold, and quality checks.

Spec as Contract
02

Document Intake

The agent reads the revised notice, previous baseline, and internal AML/KYC SOP as separate evidence sources.

Context Triage
03

Semantic Diff

Long regulatory text is compacted into changed clauses, obligations, impact rows, and action candidates.

Semantic Compaction
04

Policy RAG

Internal policy context grounds the interpretation and keeps source references attached.

RAG Pipeline
05

Impact Report

The output is a structured compliance report with severity, owner, due date, and rationale.

Prompt Chaining
06

Quality Gate

Weak citation, low confidence, or high-impact missing action triggers review.

Approval Gate

Screenshots

Terminal output: parsing, analysis, quality gate, compliance report.
Terminal output: parsing, analysis, quality gate, compliance report.

Pattern Mapping

PatternDesign role
Context TriageSeparate changed clauses, baseline text, and internal policy before deeper reasoning.
Semantic CompactionCompress long documents into obligations, impacts, and actions without losing traceability.
RAG PipelineGround conclusions in retrieved policy and source anchors.
Approval GateUse confidence and impact to decide when the agent must stop and escalate.
Observability HarnessExpose citations, confidence, checks, and generated action items.

Design Insights

Evidence is the product

The useful deliverable is not only a summary; it is a chain from clause to impact to action.

Quality gates define autonomy

The agent should know when it can proceed and when it must ask for review.

SDD makes compliance executable

The specification becomes a contract for prompts, code, output, and evaluation.

Run Path

cd workshops/workshop1-compliance python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt cd src python main.py # optional visual walkthrough open ../visual/index.html
READMEworkshops/workshop1-compliance/README.md
Blueprintimages/training/visual/workshop1-pattern-blueprint.png