Indu Learning Platform
Course/Unit 6 · AI inside MDG
Lesson 6-3

AI-assisted match and merge

Add embeddings and LLM explanations on top of MDG's classic matching, and keep every merge decision with the steward.

Watch firstSAP Community Call News And Expert Insights About Consolidation In SAP Master Data Governance · SAP CommunityOpen on YouTube ↗

Layer AI on top of MDG matching

MDG already has the duplicate check in central governance (typically HANA-based fuzzy search) and consolidation (standardize, match, best record, activate). AI adds three narrow things: recognizing differently written names, explaining pairs so stewards decide fast, and tuning thresholds from decisions. Replacing MDG matching with an LLM is a red flag.

Standardizenames, addressesBlockingpostcode, country, taxClassic match scorefuzzy, exact keysEmbedding similaritynamesLLM explanationJSON verdictSteward decisionin MDGFeedbacktune thresholds
Rules for keys, embeddings for names, explanations for people.

Embeddings and blended scores

An embedding turns text into a vector; similar meanings land close together (cosine similarity near 1). 'Larsen & Toubro Ltd' and 'L&T Limited' score high. Embeddings handle abbreviations, legal forms and transliterations but are bad at numbers ('Plant 12' vs 'Plant 21'), so tax numbers, IBANs and postcodes stay deterministic. Blocking first limits comparisons to plausible pairs.

Record ARecord BName simKeysBandLarsen & Toubro LtdL&T Limited0.91tax + postcodeHighAcme GmbH, KoelnACME Gesellschaft mbH, Cologne0.88postcodeHighNordic Steel ABNordic Steel Oy0.93noneMiddleBlue Star LogisticsBluestar Logistics Pvt0.86postcodeMiddleCity PlumbingCity Plumbing Supplies0.79noneLow
Nordic Steel AB (Sweden) and Oy (Finland): similar names, separate legal entities. Keys matter.
Python
import numpy as np

def cosine(a, b):
    return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)))

def score_pair(rec_a, rec_b, vec_a, vec_b):
    # vec_a / vec_b: name embeddings from your chosen model (e.g. via the hub)
    name_sim = cosine(vec_a, vec_b)
    same_tax = bool(rec_a["tax_no"]) and rec_a["tax_no"] == rec_b["tax_no"]
    same_post = rec_a["postcode"] == rec_b["postcode"]
    # Simple, explainable blend. Tune weights on steward decisions.
    score = 0.5 * name_sim + 0.35 * same_tax + 0.15 * same_post
    return round(score, 3)

Keep the formula visible. Stewards and auditors will ask how a score was built.

Try it: be the steward

Try it · Sort

Sort each candidate pair into the right decision.

Merge
Keep both
Review further
Click an item, then a bucket (or drag it).

The LLM explains, it does not decide

For middle-band pairs, ask for a fixed JSON shape: agreeing and conflicting fields, patterns found, and what to check before merging. Mask contact persons, emails and bank details first. The result is shown as a note on the steward's work item and logged.

JSON
{
  "pair_id": "SUP-004211|SUP-118907",
  "verdict": "likely_duplicate",
  "confidence": 0.86,
  "agreeing_fields": ["postcode", "street", "city", "tax_no"],
  "conflicting_fields": ["name1"],
  "patterns": ["abbreviation (L&T = Larsen & Toubro)", "legal form (Ltd = Limited)"],
  "check_before_merge": ["open items in both company codes",
                         "different bank accounts: confirm with AP"],
  "explanation": "Same tax number and address; names differ by a known abbreviation."
}

'check_before_merge' is where the LLM saves the most steward time.

Getting results back into MDG

Three routes: consolidation for cleanups and new sources (AI standardizes names before the load and adds explanations), the central governance duplicate check for ongoing creation (validate enhancement options for the release), and mass processing to block confirmed losers as governed CRs.

Step through · 1 of 6
Scheduled AI jobBTP or PythonPairs + explanationsstaging tableConsolidationprocessload, match, reviewSteward decidesmatch group, best recordActivateMDG standardDecisions exportedfeedback
A nightly or on-demand job blocks, scores and explains pairs. It reads through released APIs or a replicated copy, never writing to MDG tables.
AI prepares and explains; consolidation and the steward decide.

Why stewards stay in the loop

A wrong merge moves open items, POs and payment history, replicates through DRF, and can send payments to the wrong legal entity. Explanations make the control affordable: 3,000 pairs at four minutes each is 200 hours; at one minute, 50. Watch precision per band, minutes per decision and reversals within 90 days.

Score 0.95-1.0099%Score 0.90-0.9594%Score 0.85-0.9081%Score 0.80-0.8557%Score 0.75-0.8031%
Illustrative precision by score band. Set bands from your own decisions.

Try it: the auto-merge request

Try it · What would you do?

The backlog is 3,000 middle-band pairs. A finance manager asks you to auto-merge everything scoring above 0.85 to clear it this week. What do you answer?

Survivorship: AI helps, rules decide

Best-record survivorship must be explainable and repeatable, so it stays in configured rules. AI standardizes inputs before consolidation and flags conflicts rules cannot resolve, such as two active bank accounts.

Match group fieldsBest record sourceName (3 variants)Street + house no.Tax numberBank accounts (2)Payment termsSurvivorship: most completeAI-standardized, then ruleExact key, must agreeSteward decisionRule: source prioritysplit + normalizeAI flags conflict
Deterministic per field; AI standardizes and flags.

Try it: who handles which field?

Try it · Match

Match each best-record field to how it is decided.

Pick an item on the left, then its match on the right.

Remember

  • Keep MDG's duplicate check and consolidation; add embeddings for names, explanations for stewards, and feedback for thresholds.
  • Numbers and keys stay deterministic; the LLM explains in fixed JSON but never decides a merge.
  • Measure precision per band, minutes per decision and reversals; survivorship stays rule-based.

Check yourself

Two suppliers have names with cosine similarity 0.93 but different tax numbers in different countries. What should the pipeline do?
What is blocking for in a matching pipeline?
Where does the LLM add the most value in match and merge?
Which metric would show that score thresholds are too low?