Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Financial Crime Case Handoff Continuity and Evidence Timeline Engine

Format
Code-aware
Lines
103
Sections
11
Linked challenge
Build a Financial Crime Case Handoff Continuity and Evidence Timeline Engine

Prompt source

Original prompt text with formatting preserved for inspection.

103 lines
11 sections
No variables
1 code block
## Build
Reconcile fragmented multi-shift investigation logs into an immutable chronological timeline. Synthesize open leads, evidentiary gaps, and continuity briefs for incoming compliance teams.

## User
AML Operations Shift Lead

## Workflow
1. Ingest heterogeneous case notes, transaction logs, screening hits, and previous shift records in normalized tabular JSON format.
2. Sort and deduplicate events into a chronological evidence ledger while calculating timestamp deltas across related transactions.
3. Identify unaddressed alerts, expiring document verification windows, and conflicting investigator assessments.
4. Compile a shift continuity handoff dossier featuring an executive chronology, open lead tickets, and evidence checklists.

## Interface
Analyst operations terminal showing chronologically ordered milestone streams, open lead priority cards, and exportable shift transition dossiers.

## Data
Construct synthetic multi-shift case notes and ledger snapshots using standardized Frictionless Data resource definitions representing mock AML reviews.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Frictionless data validation](https://raw.githubusercontent.com/frictionlessdata/frictionless-py/main/README.md)
Uses Frictionless tabular schema concepts to validate and normalize heterogeneous investigator event logs and timestamps.

## Tools
mastra-ai, frictionless, fastapi.
Mastra AI orchestrates structured step workflows and typed schema transformations across fragmented shift records.
Fast local or API-based LLM capable of robust tabular summarization and chronologic reasoning.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Consolidates unsorted multi-analyst case entries into a strict chronological sequence without dropping logged evidence IDs.
- Identifies and flags open leads where disposition notes conflict or pending requests exceed 24 hours.
- Generates a structured handover brief with clear assignment rosters for the incoming shift.
- Maintains an immutable audit log of merged entries without modifying underlying historical records.

## Starter Examples
```json
[
  {
    "input": {
      "case_id": "CASE-4401",
      "subject": "Acme Trade Corp",
      "shift_entries": [
        {
          "entry_id": "log-002",
          "timestamp": "2025-05-10T14:30:00Z",
          "analyst": "analyst_a",
          "action": "screened_counterparty",
          "details": "Screened Global Logistics BV; PEP hit flagged as false positive by analyst A."
        },
        {
          "entry_id": "log-001",
          "timestamp": "2025-05-10T09:15:00Z",
          "analyst": "analyst_b",
          "action": "flagged_rapid_movement",
          "details": "Rapid wire transfer of 250,000 EUR received from offshore account."
        },
        {
          "entry_id": "log-003",
          "timestamp": "2025-05-10T17:00:00Z",
          "analyst": "analyst_a",
          "action": "rfi_requested",
          "details": "Requested commercial invoice from relationship manager; awaiting response."
        }
      ]
    },
    "expected_output": {
      "case_id": "CASE-4401",
      "sorted_timeline_count": 3,
      "first_event": "2025-05-10T09:15:00Z",
      "last_event": "2025-05-10T17:00:00Z",
      "unresolved_leads": [
        {
          "lead_id": "LEAD-01",
          "action_needed": "Follow up on RFI for commercial invoice",
          "status": "pending_external_response",
          "assigned_to": "incoming_shift"
        }
      ],
      "shift_handoff_summary": "Initial rapid wire transfer of 250k EUR logged at 09:15. Counterparty PEP cleared at 14:30. Open RFI for invoice remains outstanding as of 17:00."
    }
  },
  {
    "input": {
      "case_id": "CASE-4402",
      "subject": "Zenith Retail Ltd",
      "shift_entries": [
        {
          "entry_id": "log-101",
          "timestamp": "2025-05-11T11:00:00Z",
          "analyst": "analyst_c",
          "action": "periodic_review_complete",
          "details": "All vendor invoices match delivery orders. No adverse media found."
        }
      ]
    },
    "expected_output": {
      "case_id": "CASE-4402",
      "sorted_timeline_count": 1,
      "first_event": "2025-05-11T11:00:00Z",
      "last_event": "2025-05-11T11:00:00Z",
      "unresolved_leads": [],
      "shift_handoff_summary": "Routine review completed at 11:00 with no discrepancies or open leads."
    }
  }
]
```

## Safety
Confines analysis to mock operational case logs without publishing unredacted personal identifiers or executing production case management lockouts.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.