Jaco van der Laan

AnaCredit and GenAI: Extracting Reusable Semantics from the ECB’s Credit Data Model

22/09/2025  ·  Data Architecture  ·  Data Engineering  ·  Data Modeling

article base/genai dbt genai metadata
‹ ›

Turning a 200-page regulatory manual into metadata, ERDs, and dbt scaffolding

Summary

AnaCredit is one of the most detailed credit exposure models in European banking. By applying GenAI, we can transform its dense regulatory manuals into structured metadata, identify reusable entities, and scaffold dbt models that form the backbone of a generic financial services logical data model (LDM).

Key Takeaways

  • AnaCredit scope: Counterparty, Instrument, Protection, and their associations.
  • Problem: 200+ pages of attributes and code lists buried in PDFs.
  • GenAI advantage: Extract structured metadata, normalize semantics, generate YAML/dbt scaffolding.
  • Output: Enterprise-friendly Counterparty and Instrument entities with role/association clarity.
  • Lesson: Regulatory models can seed enterprise LDMs if reimagined with metadata-first thinking.

The Context: What Is AnaCredit?

AnaCredit (Analytical Credit Dataset) is an ECB initiative requiring granular loan-level reporting. Its Logical Data Model (LDM) defines:

  • Counterparty: borrowers, creditors, servicers
  • Instrument: loans, leases, revolving facilities
  • Protection: guarantees, collateral
  • Associations: Counterparty–Instrument roles, Instrument–Protection links

It’s a rich semantic blueprint, not just a compliance burden. As I’ve argued in The Case for a Business-Shaped Integration Layer, these blueprints can serve as integration anchors if captured as metadata.

The Challenge: From PDF to Metadata

The official AnaCredit manuals run hundreds of pages. Data modelers typically extract attributes into Excel or PowerPoint ERDs. The result: brittle, non-reusable mapping artifacts.

This echoes a broader pattern I discussed in Metadata as Data: until regulatory models are represented as metadata, they can’t be automated, governed, or reused effectively.

The GenAI Approach

GenAI augments data modelers by:

  1. Parsing PDFs → entity names, attributes, PK/FK definitions, code lists.
  2. Normalizing entities → aligning Counterparty (AnaCredit) with Party (BIRD).
  3. Generating YAML → machine-readable definitions for dbt and ERD generation.
  4. Visualizing ERDs → automated Mermaid or diagrams.net diagrams.
  5. Scaffolding dbt models → sources, staging, marts for Counterparty, Instrument, Protection.

This is the practical embodiment of what I described in From Coding to Modeling: The Rise of Model-Driven Data Engineering: shift away from manual coding, embrace reusable metadata.

Example: YAML for AnaCredit Instrument

entities:
  Instrument:
    description: Credit instrument reported to AnaCredit
    attributes:
      - instrument_id: unique identifier
      - contract_id: reference to legal contract
      - type_of_instrument_code: LN, RV, LS
      - currency: ISO 4217 code
      - orig_amount: original amount granted
      - outstanding_nominal: current balance
      - interest_rate_type: FX, VR, FIX
    associations:
      - CounterpartyInstrumentRole
      - InstrumentProtectionLink

This YAML becomes the single source of truth, from which both ERDs and dbt SQL scaffolding can be generated.

ERD (simplified)

Mermaid — convert via mermaid.live

This highlights a crucial lesson: AnaCredit makes roles and associations explicit, which supports the business-friendly mapping approach I outlined in Cooking with Data.

dbt Scaffold: Staging Counterparty

with src as (
  select
    counterparty_identifier as counterparty_id,
    lei,
    legal_form_code,
    residence_country_code as residence_country,
    sector_code,
    counterparty_name as name
  from {{ source('anacredit','counterparty_reference') }}
)
select * from src

This turns regulatory deliveries into reusable enterprise LDM views.

Lessons from AnaCredit

  • Granularity matters: AnaCredit reports at contract-level, a goldmine for analytics.
  • Reference richness: code lists for instruments, sectors, and residence are reusable.
  • Role clarity: Counterparty–Instrument roles map perfectly into associative entities.
  • Anchor potential: Counterparty and Instrument can serve as enterprise-wide anchors in a generic LDM.

Why It Matters

AnaCredit demonstrates that regulatory models are semantic assets. With GenAI and dbt, we can repurpose them to strengthen enterprise architectures, as I also explored in How Universal Data Models Support Business-Oriented Data Modeling.

What’s Next

In the next article, I’ll explore the RRE model, focusing on property, valuation, and collateral — and how GenAI helps translate spatial and temporal complexity into business-friendly models.