Architecture

How ComplyFlow AI works

A deterministic wrapper around a language model: structured output, verbatim evidence for every extracted obligation, explicit confidence, and a full audit trail. Summaries, risk scores, owners and plans stay drafts for human review.

Organisation profileSource ingestionAnalyseValidate & classifyOrganisation relevanceSource groundingDeadline detectionRisk scoringHuman review & handoffAudit trail

Stage 1

Organisation profile

Configured once: industry, regions, monitored topics and which internal team owns each obligation category. Every later stage is explained against it. The profile is stored in your browser and the seeded organisation is an illustrative demo company.

output: Region · topics · category-to-team mapping

Stage 2

Source ingestion

A change arrives by public URL import, file upload or pasted text, and is normalised into plain text before anything else happens. Email, webhook and drive connectors are described on the inbox page as integration-ready, not connected.

output: Normalised document text + metadata

Stage 3

Analyse

A hosted model produces a structured object. If it is unavailable — no key, rate limit, network failure — an on-device deterministic engine produces the same structure from explicit wording.

output: Structured result from model or fallback

Stage 4

Validate & classify

The reply is parsed against a Zod schema with safe defaults, then document type (regulatory notice, industry bulletin, contract change, policy update), issuer and jurisdiction are identified so routing rules can apply.

output: Type · issuer · jurisdiction

Stage 5

Organisation relevance

The document is explained against the organisation profile by deterministic rules only: the jurisdiction is string-matched to configured regions, a fixed keyword table matches monitored topics, and each obligation category is looked up in the category-to-team mapping. There is no semantic or model-based relevance filtering.

output: Region match · topic tags · illustrative owning teams

Stage 6

Source grounding

Grounding mechanically checks obligation evidence and dates only: an obligation survives if its quote appears literally in the source text, a date survives if that exact day is written in the document, and everything else is dropped and counted in the confidence rationale. Summaries, risk scores, owner suggestions, plans and the draft response are not mechanically grounded — they remain drafts for human review.

output: Grounded obligations and dates only

Stage 7

Deadline detection

Effective dates, submission dates, notification windows and remediation dates are normalised to ISO dates and typed, so the dashboard can count days remaining.

output: Typed, dated deadline set

Stage 8

Risk scoring

A 0-100 score is produced from weighted factors — financial exposure, scope, deadline pressure, dependencies — each returned with a written rationale rather than an opaque number.

output: Score + level + factor breakdown

Stage 9

Human review & handoff

Obligations become an ordered plan, owner suggestions, a status-tracked checklist and a draft acknowledgement. A person reviews before tasks are published, then JSON and CSV exports carry the work into the system of record.

output: Plan · owners · checklist · exports

Stage 10

Audit trail

Ingest, analysis, owner confirmation and every status change are appended to an immutable-style activity timeline that can be exported for evidence.

output: Timestamped activity log

Guardrails

What keeps the output trustworthy in a regulated workflow.

  • Evidence or it didn't happen. Obligations are rendered next to the exact sentence they came from, highlighted inside the original text.
  • Stated confidence. Every analysis carries a confidence percentage and the reason for it, so reviewers know where to look hardest.
  • Human ownership. Owner suggestions are proposals; a person confirms them and the confirmation is logged.
  • No legal advice. The product organises compliance operations work; interpretation stays with qualified people.

ComplyFlow AI is a compliance operations copilot. It drafts and organises work for review by qualified people — it does not provide legal advice, and every obligation links back to the text it was extracted from.

Technical shape

How the prototype is put together.

Frontend
TypeScript, React 19, TanStack Start/Router, Tailwind v4, shadcn/ui
Model call
Server function → Lovable AI Gateway, JSON-object response mode, bounded by a request timeout
Fallback engine
If the model is unreachable, an on-device rule engine returns the same structure from explicit wording — the app runs with no keys
Validation
Zod schema parse with safe defaults, so a malformed reply never breaks the UI
Grounding
Unquotable obligations and unsupported dates are removed before anything is stored
URL import
Server-side fetch of public pages only: protocol check, DNS-resolved address checks on every hop, at most 3 manual redirects, 10s budget, 1 MB cap enforced while streaming, markup stripped without execution. This reduces SSRF risk but is not absolute.
State
Workspace and organisation profile persisted in browser storage — no authentication, no shared backend, no database
Relevance
Deterministic only: region string comparison, a fixed topic keyword table and a literal obligation-category to team lookup. No embeddings, no semantic filtering.
Demo data
Four seeded analyses with tasks and timelines. One quotes a real public EU text — Delegated Regulation (EU) 2025/301, Article 5, supplementing Regulation (EU) 2022/2554 (DORA); the other three are fictional. In all four, the owners, plans, checklists and audit actors are illustrative internal workflow.
Failure modes
Rate limit, credit exhaustion, import failures and parse failures surface as readable errors

Deployment — prototype today

What actually runs in this build.

  • Browser-local workspace: analyses, task status, audit trail and the organisation profile live in this browser's storage.
  • No authentication, no database, no multi-user backend, nothing shared between visitors.
  • Hosted analysis runs through the Lovable AI gateway when a key is configured.
  • A deterministic offline engine produces the same structure with no key and no analysis request.
  • URL import runs server-side for public HTML and plain-text pages only.
  • Relevance is deterministic rules over the organisation profile — no semantic or model-based filtering.

Deployment — production path

Architecture roadmap. None of the items below are implemented in this prototype.

Not implemented · roadmap

ComplyFlow Cloud (managed)

Hosted multi-tenant service with accounts, persisted workspace and audit storage, SSO and role-based access, and managed source connectors.

Not implemented · roadmap

ComplyFlow Private (customer VPC / on-prem / self-hosted)

Deployment inside the customer's own environment, customer-approved or bring-your-own model endpoints, customer-controlled storage, SSO and RBAC, private network connectors and persisted audit records.

These are design intentions for how the product would be deployed, not capabilities available today. This build is not self-hosting ready and offers no tenancy, authentication or data-residency controls.

Prototype limitations

What this build does not do, stated plainly.

  • The workspace lives in your browser. There is no authentication, shared backend or database, and nothing is shared between visitors.
  • Only URL import, file upload and pasted text are implemented. Email intake, webhook/API push, RSS monitoring and drive watching are integration-ready or roadmap — they are not connected.
  • URL import works on public HTML and plain-text pages only. Authenticated pages and PDFs are not supported.
  • Handoff to Jira, ServiceNow, Teams or Slack is illustrative. Exports are real files; the integrations are not connected.
  • The deterministic engine is rule-based triage, not a model. It matches explicit wording and misses implied requirements.
  • Organisation relevance is keyword and string matching over a locally stored profile for one illustrative demo organisation. It does not understand the document.
  • ComplyFlow Cloud and ComplyFlow Private are architecture roadmap only. This build has no tenancy, authentication, persistence, SSO/RBAC or self-hosting support.
  • Output is a draft for human review. ComplyFlow is not legal advice.
  • Where a demo record quotes a real regulation, only the quoted legal text is real. The owners, tasks, plan and risk score beside it are an illustrative internal workflow, not something the regulation prescribes.

3-minute demo path

Follow this order for a live walkthrough. One demo document quotes a real published EU regulation; the vendor, policy and network examples are fictional. Internal owners and tasks are illustrative throughout, and no affiliation with any regulator, network or company is implied.

Open the run sheet
  1. 0:00

    Open the compliance inbox

    Where change arrives: URL import and upload working, other channels labelled integration-ready.

  2. 0:30

    Open the highest-risk analysis

    DORA major ICT incident reporting time limits, quoted from the published regulation: summary, obligations, risk.

  3. 1:15

    Click an obligation

    The quoted evidence pins and highlights inside the original source text.

  4. 1:45

    Move a task and export

    Status change writes to the audit trail; JSON and CSV exports carry the work onward.

  5. 2:15

    Run a live analysis

    Import a public page or load a sample and watch the pipeline produce a fresh workflow.

  6. 2:45

    Close on architecture

    This page: ingest → analyse → validate → ground → review → handoff → audit.