03 — Solution patterns

Seven archetypes. Each one has a known shape, a known boundary and a known way to prove it works.

Classifying a transformation project into an archetype fixes the architecture, the evaluation method, the risk profile and the skills needed.
3.1

Choosing between deterministic code, retrieval and agents

Executive

Most delivery risk comes from applying an agentic pattern to a problem a scheduled query would have solved.

Q1Output is a number someone acts on financially?Deterministic service. Model may narrate, never compute.
Q2Correct answer already written down authoritatively?Retrieval with citations. No free generation without sources.
Q3Fixed sequence of steps with known inputs?Workflow automation. Model only inside a step, structured output.
Q4Dynamic tool selection, bounded actions, human gate before writes?Agentic pattern — step limits, allow-listed tools, traces.

None apply? It is not yet a well-defined problem — define it before building.

Whywhy the bias against agents by default

Multi-step autonomous loops multiply the failure surface. Our default is the simplest pattern that satisfies the requirement, with a documented reason whenever we move up the ladder.
3.2

Pattern catalogue

Effort and risk are relative across these transformation projects — planning estimates to be revised after discovery.

A1

Deterministic calculation engine

Effort HighRisk Medium

Spreadsheet economics become a maintainable service with scenarios, explainability and audit — without changing the answers.

InputsSnapshotRules engineTraceApproval

⟊ determinism boundary

Pure calc core, rules as dataGolden-master + property testsUndefined case → human, never guessed
Architecture, evaluation & when to avoid

Recommended architecture

  • · Pure calculation core in a typed language: a function of (inputs, rule_version) with no I/O, using decimal arithmetic and explicit rounding per field.
  • · Rules held as data, not code branches, so a rule change is a reviewable diff with an effective date rather than a deployment of new logic.
  • · Input resolution layer that snapshots every source value with its lineage at submission time; results are always reproducible from the snapshot.
  • · Scenario evaluation as stored input deltas replayed through the same core — no parallel implementation.
  • · Trace object emitted alongside every result: inputs used, rules fired in order, intermediate values, warnings.
  • · Thin approval application over the service: submit, review trace, approve or reject, immutable audit record with both identities.

Determinism boundary

100% deterministic. AI is used only during construction (translating legacy macro logic into a candidate specification) and afterwards for narrating a result — never for producing one.

How correctness is proven

  • · Golden-master regression against a corpus of historical runs, executed on every commit, with per-field tolerances agreed in writing.
  • · Property tests for invariants that must hold regardless of inputs (e.g. monotonicity, conservation between components and total).
  • · Mutation testing on the rule set to confirm the corpus actually detects a changed rule.

When not to use this pattern

Do not use a language model in the calculation path to 'handle edge cases the rules miss'. Undefined cases must fail loudly and route to a human.

A2

Governed conversational analytics

Effort MediumRisk High

Colleagues ask questions in natural language and receive trusted figures with explanations, within their own data permissions.

QuestionResolve measureExecute (permissioned)Narrate

⟊ determinism boundary

Registered measures onlyCurated Q&A + adversarial setNumeric reconciliation or regenerate
Architecture, evaluation & when to avoid

Recommended architecture

  • · Measure registry as the tool catalogue: each approved measure exposed with description, synonyms, valid filter dimensions, owner and grain.
  • · Two-stage handling: resolve question → plan (measure + filters + as-of), then execute the plan in the user's security context.
  • · Retrieval over curated definition notes for the 'why' half of an answer, returned with document identifiers and versions.
  • · Numeric reconciliation post-check: every figure in the drafted answer must match a tool result token-for-token, or the answer is regenerated.
  • · Explicit refusal path with a named human owner per domain, plus a logged gap so unanswerable-but-reasonable questions become a backlog.
  • · Conversation memory limited to the current thread and never used as a source of facts.

Determinism boundary

Figures deterministic; language generated. The model may choose a measure but may never define one, and may never compose arithmetic across measures unless that combination is itself a registered measure.

How correctness is proven

  • · A curated question set built from real historical questions, each with a known-correct measure, filter set and expected value.
  • · Scored on measure-resolution accuracy, numeric exactness, citation correctness, groundedness of prose, and refusal precision.
  • · Paired-identity tests to prove permission inheritance.
  • · Adversarial set: prompt-injection attempts embedded in retrieved documents, leading questions, requests for figures that do not exist.

When not to use this pattern

Do not launch this before the semantic layer has certified measures and owners — answer quality is bounded by definition quality.

A3

Document intelligence

Effort HighRisk High

Unstructured agreements turned into a structured, searchable database of parties, dates, territories, obligations and terms.

DocumentExtract (confidence)Human validationStructured store

⟊ determinism boundary

Confidence-routed extractionGold set, field-level precision/recallObligations always human-confirmed
Architecture, evaluation & when to avoid

Recommended architecture

  • · Target data model designed first, from the questions the database must answer — not inferred from whatever the extractor happens to produce.
  • · Deterministic pre-processing: format detection, text layer extraction, OCR fallback, page and clause segmentation with stable offsets.
  • · Schema-constrained extraction per field group, each returned value carrying a confidence signal and a character-offset citation back to source.
  • · Three-lane routing: high-confidence auto-accept, mid-confidence human validation queue, low-confidence routed to manual capture, thresholds set per field.
  • · Immutable extraction versions: re-running a better extractor creates a new version and a diff for review, never an in-place overwrite.
  • · Search served from the structured store with permission filters; document text is a citation target, not the primary query surface.

Determinism boundary

Extraction is a proposal. Any field that creates an obligation, a date-driven action or a payment term is human-confirmed before it is treated as fact downstream.

How correctness is proven

  • · A gold set of documents annotated by a human, held out from prompt iteration, scored field-by-field on precision, recall and exact-match.
  • · Calibration check: does the confidence signal actually predict correctness?
  • · Stratified sampling by document type and vintage, because older or non-standard templates are where accuracy collapses.
  • · Ongoing production audit: a random sample of auto-accepted fields reviewed monthly, feeding the accuracy trend.

When not to use this pattern

Do not promise full automation on heterogeneous historical documents. Plan for a validation workforce and a fast queue.

A4

Controlled knowledge system

Effort MediumRisk Medium

Definitions, mappings, processes and past decisions made reliably available to both colleagues and machines.

Draft noteOwner reviewApproved indexRetrieval

⟊ determinism boundary

File-based, versioned notesRecall@k + freshness metricsNothing approved without an owner
Architecture, evaluation & when to avoid

Recommended architecture

  • · Markdown-first, file-based, version-controlled notes as the source of truth — diffable, reviewable, portable.
  • · Required front-matter: owner, status (draft/approved/deprecated), effective date, review date, source system, related measure identifiers.
  • · Structure by domain with a stable identifier per note so citations remain valid across renames.
  • · Retrieval index rebuilt on change; approved notes ranked above drafts, deprecated notes excluded from answering but retained for history.
  • · Review workflow: notes past their review date surface on an owner dashboard; unreviewed notes lose 'approved' status automatically.
  • · Write-back loop: recurring unanswerable questions become suggested notes assigned to the domain owner.

Determinism boundary

Authorship is human. AI drafts, restructures and summarises; nothing enters the approved set without an owner's explicit approval.

How correctness is proven

  • · Retrieval quality on a question set: recall@k against known-correct notes, plus citation-correctness of generated answers.
  • · Freshness metrics: proportion of approved notes within their review window, and the age distribution of the corpus.
  • · Coverage metrics: proportion of the measure registry with a corresponding definition note and owner.

When not to use this pattern

Do not index the whole document estate and call it knowledge management — retrieval over uncurated content produces confident answers from superseded drafts.

A5

Planning & simulation experience

Effort MediumRisk Medium

Planning, target setting and simulation improved via better interfaces, validated calculations and tighter integration.

Guided inputPlanning platform APIIndependent reconciliationNarration

⟊ determinism boundary

Platform stays system of recordReconciliation + contract testsNo write without human submission
Architecture, evaluation & when to avoid

Recommended architecture

  • · Integration through the planning platform's API with a typed client and a contract test suite, so a platform-side change fails a test, not a month-end.
  • · Validation harness that recomputes selected planning outputs independently and reconciles, converting silent model errors into alerts.
  • · Guided input surfaces for high-friction steps, with client-side validation, saved drafts and clear submission state.
  • · Scenario comparison built on stored parameter sets rather than duplicated models.
  • · AI assistance restricted to narration of variances, anomaly flagging against history, and drafting commentary — always alongside the figure.

Determinism boundary

The planning platform stays the system of record for plan data. Nothing in the AI layer writes a plan value without an explicit human submission action.

How correctness is proven

  • · Reconciliation tests between the independent validation harness and the planning platform on every cycle.
  • · Contract tests against the API, run on a schedule to detect upstream change.
  • · Task-level UX measurement: time to complete a submission, error rate, rework rate — baselined before any change.

When not to use this pattern

Do not rebuild planning logic outside the planning platform to make it easier to automate — two sources of plan truth is worse than the problem being solved.

A6

Workflow automation at scale

Effort LowRisk Low

Manual routines across forms, chat, tasks, mail and reporting replaced by monitored, reusable, resilient automations.

TriggerIdempotent stepAI (bounded task)Outcome + logging

⟊ determinism boundary

Deterministic control graphRecorded-payload tests + chaos checksAI never decides if a step runs
Architecture, evaluation & when to avoid

Recommended architecture

  • · Start with an inventory: every existing automation with owner, trigger, criticality, failure history and manual workaround.
  • · Standard flow skeleton: validated trigger payload → idempotency key → typed work step → outcome event → structured logging → dead letter + alert.
  • · Logic-heavy steps extracted from low-code into versioned, testable services so they can be unit-tested.
  • · Reusable components: shared error handler, notification format, retry policy, secret access — published as templates.
  • · AI used inside flows for bounded tasks with structured outputs, always with a deterministic fallback when confidence is low.
  • · A single operations view: run counts, success rate, latency and failure reasons across the automation estate, with an owner per flow.

Determinism boundary

The flow control graph is deterministic. AI decides content within a step; it never decides whether a step runs or what it is allowed to do.

How correctness is proven

  • · Automated tests per flow against recorded trigger payloads, including malformed and duplicate ones.
  • · Chaos checks: connector timeout, partial failure, the same event delivered twice.
  • · Operational metrics: success rate, mean time to detect and recover, tracked per flow and reviewed monthly.

When not to use this pattern

Do not automate a process that is about to change, or one nobody owns — both produce automation debt.

A7

Semantic and data foundation

Effort HighRisk Medium

A trusted, documented modelled layer with approved measures and data-quality controls, prepared for machine consumption.

BronzeSilver (contracts)Gold (certified measures)Consumers

⟊ determinism boundary

Medallion + promotion gatesAssertion pass rate + reconciliationOne owner approves each measure
Architecture, evaluation & when to avoid

Recommended architecture

  • · Medallion layering with contracts: bronze immutable landings, silver conformed entities with tested keys, gold business-shaped tables.
  • · Data-quality assertions as promotion gates — uniqueness, referential integrity, freshness, accepted ranges, row-count deltas — a failure blocks publication.
  • · One certified semantic model with named owners per subject area; a measure exists once, described for a non-specialist with synonyms for a machine.
  • · Row-level security defined in the model and inherited by every consumer, including AI surfaces.
  • · Machine-readability as a requirement: complete descriptions, synonyms, valid dimension combinations, documented grain.
  • · Lineage captured from source to measure, so an answer can be traced back to a landing file and load timestamp.

Determinism boundary

Fully deterministic. AI may help draft descriptions and propose synonyms; approval is by the measure owner.

How correctness is proven

  • · Assertion pass rate and freshness SLAs per gold table, monitored and alerting.
  • · Reconciliation against an independent trusted source for key totals, run every load.
  • · Documentation coverage: proportion of measures with owner, description, synonyms and lineage complete.

When not to use this pattern

Do not defer this because it is not visible to users — every downstream transformation project inherits its defects.

3.3Shared components the patterns reuseImplementation