Example: The Semantic Layer in Retail

Miguel Garcia

From Concept to Reality

Part of the Semantic Layer Series (Part 4)

The Semantic Layer in Retail: From Concept to Reality

Introduction

In Article 3, we explored how RegionalHealth uses a semantic layer to bridge the gap between simple healthcare concepts (Patient, Provider, Encounter) and complex system reality (Epic, Workday, specialty systems). The approach works because it preserves conceptual simplicity while managing implementation fragmentation.

But does this pattern hold across industries? Is the semantic layer concept universal, or specific to healthcare?

Let's return to ModernRetail Inc., our mid-sized retail merchant from Article 1. We'll see that the same principles apply—simple conceptual model, inevitable fragmentation, semantic layer as the solution. The entities are different (Customer, Product, Order instead of Patient, Provider, Encounter), but the pattern is identical.

This universality is important. It means the semantic layer isn't a niche solution for one industry—it's a fundamental pattern for managing enterprise data complexity anywhere.

ModernRetail's Reality: A Quick Recap

ModernRetail operates physical stores and e-commerce, with data scattered across:

  • SAP ERP: Product master, inventory, suppliers, purchase orders
  • Salesforce: Customer relationships, marketing campaigns, sales pipeline
  • E-commerce platform (Shopify Plus): Online store, digital customers, web orders
  • Supply chain system (Blue Yonder): Demand forecasting, warehouse operations, shipment planning
  • Integration platform (Boomi): Connecting all the systems

Remember the fragmentation:

  • Customer data lives in Salesforce but gets copied to SAP (for billing) and e-commerce (for personalization)
  • Product data lives in SAP but exists in Salesforce (for selling), supply chain (for planning), and e-commerce (with web-specific attributes)
  • Orders start in either Salesforce or e-commerce but land in SAP for fulfillment
  • Inventory lives in SAP but is queried constantly by e-commerce and replicated to supply chain

This fragmentation creates the same problems we saw in healthcare: inconsistency, complexity, slow insights, and frustrated business users.

The Retail Semantic Layer: ModernRetail's Solution

Getting the righ answers

The Conceptual Model

ModernRetail's semantic layer maintains the simple model from Article 1:

Customer: A person or business that buys from us

  • System of Record: Salesforce
  • Key attributes: Customer ID, contact info, preferences, loyalty status
  • Related entities: Orders, payments, interactions

Product: Something we sell

  • System of Record: SAP (product master data)
  • Key attributes: SKU, description, category, price, supplier
  • Special case: E-commerce adds digital attributes (images, web descriptions, SEO metadata)
  • Related entities: Inventory, orders, suppliers

Order: A customer purchase

  • System of Record: Depends on origin (e-commerce or Salesforce), eventually SAP for fulfillment
  • Key attributes: Order number, customer, line items, total, status
  • Related entities: Customer, products, shipments, payments

Inventory: What we have in stock

  • System of Record: SAP
  • Key attributes: SKU, location (warehouse/store), quantity available, quantity allocated
  • Real-time challenge: E-commerce needs current inventory to avoid overselling

Shipment: Movement of products

  • System of Record: Supply chain system (for planning), SAP (for actuals)
  • Key attributes: Origin, destination, contents, carrier, tracking, status
  • Related entities: Orders (outbound), purchase orders (inbound)

Supplier: Companies we buy from

  • System of Record: SAP
  • Key attributes: Supplier ID, terms, lead times, products supplied
  • Related entities: Products, purchase orders, shipments

How It Works: A Business Question

Let's walk through a realistic business scenario: "Which products are we losing sales on due to stockouts, and how much revenue are we missing?"

This seems straightforward, but it requires:

  1. E-commerce: Which products customers tried to buy but were out of stock
  2. SAP: Actual inventory positions and stockout duration
  3. E-commerce + SAP: Price and historical sales velocity
  4. Supply chain system: When will restock shipments arrive

Without a semantic layer, the VP of Merchandising would:

  • Ask IT for a custom analysis
  • Wait 1-2 weeks while analysts extract data from multiple systems
  • Get a static report answering this specific question
  • Need another report next month with slightly different parameters

With a semantic layer + AI agent, the conversation goes like this:

VP of Merchandising: "Show me revenue lost to stockouts this month"

AI Agent (using the semantic layer):

  • Recognizes "stockouts" means inventory quantity = 0 when customer demand exists
  • Queries e-commerce for "out of stock" events (attempted purchases that failed)
  • Queries SAP for inventory positions and stockout timing
  • Calculates lost revenue based on average selling price and missed units
  • Returns: "Estimated $340K revenue lost to stockouts across 127 SKUs"

VP: "Which categories are worst?"

AI Agent:

  • Groups stockout losses by product category
  • Returns: "Women's apparel $120K (35%), electronics $95K (28%), home goods $75K (22%)"

VP: "For women's apparel, what are the top 5 SKUs and when will we have them back in stock?"

AI Agent:

  • Identifies top 5 SKUs by lost revenue in women's apparel
  • Queries supply chain system for incoming shipments
  • Returns: SKU list with estimated restock dates (3 arriving next week, 2 in 10 days)

VP: "Can we expedite those shipments?"

AI Agent:

  • This requires human judgment, not data
  • Returns: "Based on carrier tracking, shipments are in transit. I've notified supply chain operations about the high-priority restock request."

This entire conversation takes 5 minutes. The VP thinks in business terms (revenue, stockouts, categories). The semantic layer translates to system-specific queries. The AI agent orchestrates it all.

The Knowledge ModernRetail's Semantic Layer Maintains

Entity Definitions: Customer, Product, Order, Inventory—what they are, their attributes, how they relate.

System Mapping:

  • Salesforce: Customer master, customer interactions
  • SAP: Product master, inventory, financial orders
  • E-commerce: Web-specific product attributes, online orders, browse behavior
  • Supply chain: Shipment planning, warehouse operations

Ownership Rules:

  • Customer: Salesforce is authoritative. If customer email differs between Salesforce and SAP, Salesforce wins.
  • Product: SAP owns core product data (SKU, description, base price). E-commerce owns digital presentation (images, web description). The semantic layer knows this split ownership.
  • Inventory: SAP is authoritative, but e-commerce queries it in real-time

Data Lineage:

  • Customer flows: Salesforce → SAP (for billing), Salesforce → E-commerce (for personalization)
  • Product flows: SAP → E-commerce (nightly sync), SAP → Supply chain (nightly sync)
  • Order flows: E-commerce → SAP (real-time for fulfillment), Salesforce → SAP (for B2B orders)
  • Inventory flows: SAP → E-commerce (real-time API), SAP → Supply chain (nightly extract)

Business Rules:

  • "Available to Promise" inventory = on-hand quantity minus allocated quantity minus safety stock
  • "Active customer" = made a purchase in last 12 months OR opened an email in last 3 months
  • "Bestseller" = top 20% of SKUs by revenue in the category
  • These composite rules are encoded once in the semantic layer, not duplicated across systems

Integration Timing:

  • E-commerce inventory checks: Real-time (can't risk overselling)
  • Product catalog updates: Nightly (acceptable lag)
  • Customer data sync: Every 15 minutes (good enough for personalization)
  • Order fulfillment: Real-time (SAP must receive orders immediately)

The semantic layer knows these timing requirements and surfaces data freshness to users.

Real Business Scenarios

Let's see more examples of how ModernRetail's semantic layer enables faster, better decisions:

Scenario 1: Promotional Planning

Merchandising Manager: "Show me products with high inventory and low sales velocity that we should put on promotion"

AI Agent:

  • Queries SAP for inventory levels and aging
  • Queries e-commerce and SAP for recent sales velocity
  • Calculates "days of inventory" for each product
  • Identifies products with 90+ days of inventory and declining sales
  • Returns: 43 SKUs that are candidates for clearance promotion, sorted by inventory value at risk

Manager: "For the top 10, what discount would we need to move them in 30 days?"

AI Agent:

  • Analyzes historical price elasticity from past promotions
  • Suggests discount levels based on desired velocity increase
  • Returns: Recommended discounts ranging from 25% to 40% based on historical response

Scenario 2: Supply Chain Optimization

Supply Chain Director: "Which suppliers are causing us the most stockouts?"

AI Agent:

  • Identifies stockout events from SAP inventory data
  • Links products to suppliers via SAP supplier relationships
  • Links stockouts to missed sales from e-commerce
  • Calculates lost revenue by supplier
  • Returns: "Top 3 suppliers by stockout impact: SupplierA ($180K lost revenue), SupplierB ($120K), SupplierC ($95K)"

Director: "What's the root cause for SupplierA?"

AI Agent:

  • Analyzes delivery performance from supply chain system
  • Compares promised vs. actual delivery dates
  • Returns: "SupplierA has 45% on-time delivery rate (industry standard 90%). Average delay: 12 days."

Scenario 3: Customer Experience

CMO: "Are we losing high-value customers due to poor inventory availability?"

AI Agent:

  • Identifies "high-value customers" (top 20% by lifetime value from Salesforce)
  • Finds stockout events experienced by these customers from e-commerce
  • Analyzes subsequent behavior (did they return? did they buy?)
  • Returns: "37% of high-value customers experienced stockouts last month. Of these, 22% haven't returned for a subsequent visit."

CMO: "What products were out of stock for these customers?"

AI Agent:

  • Lists products and categories where high-value customers hit stockouts
  • Returns: Primarily bestselling items in women's apparel and electronics

This insight drives action: maintain deeper inventory on items popular with high-value customers.

Why This Works: The AI + Semantic Layer Combination

The magic isn't just the semantic layer—it's the combination with agentic AI.

The Semantic Layer provides:

  • Conceptual model that humans understand
  • System mapping that reflects technical reality
  • Business rules encoded consistently
  • Data lineage and freshness information

The AI Agent provides:

  • Natural language interface
  • Contextual understanding of follow-up questions
  • Ability to navigate complex multi-step analyses
  • Presentation of insights in business terms

Together, they create something neither could do alone: truly accessible enterprise data.

What Makes This Different from Traditional BI

Traditional BI tools (Tableau, Power BI, Looker) help, but they still require users to understand:

  • Which tables to query
  • How to join data across systems
  • What the technical field names mean
  • How to apply business rules correctly

The semantic layer + AI approach is different:

  • Users speak in business language
  • The semantic layer handles technical translation
  • Business rules are applied automatically
  • The AI agent guides the exploration

Traditional BI is "self-service" but still requires significant training. Semantic layer + AI is genuinely conversational.

The Implementation Path

ModernRetail didn't build their semantic layer overnight. They took a phased approach:

Phase 1: Define the conceptual model

  • Workshop with business and IT to document core entities
  • Identify system of record for each entity
  • Document known data flows and integration points
  • Time: 2 months

Phase 2: Build inventory and order semantic layer

  • Start with highest-value use case: preventing stockouts
  • Map inventory and order entities to SAP and e-commerce
  • Create APIs that expose conceptual model
  • Time: 3 months

Phase 3: Add customer semantic layer

  • Map customer entity across Salesforce, SAP, and e-commerce
  • Handle split ownership (Salesforce for relationships, SAP for transactions)
  • Time: 2 months

Phase 4: Deploy AI agent

  • Connect AI to semantic layer APIs
  • Train on business terminology and common questions
  • Roll out to merchandising team first, then expand
  • Time: 2 months (ongoing refinement)

Phase 5: Expand coverage

  • Add products, suppliers, shipments
  • Continuously refine based on user questions
  • Ongoing

The key: start with high-value use cases, prove value quickly, expand iteratively.

The Business Impact

After 12 months, ModernRetail measured these results:

Faster insights: Questions that took days now take minutes. The merchandising team asks 10x more questions, making more data-informed decisions.

Reduced stockouts: By quickly identifying stockout patterns, they reduced stockout-related lost revenue by 35% ($2M annually).

Lower IT burden: Custom report requests to IT dropped 70%. IT focuses on maintaining the semantic layer, not fielding ad-hoc requests.

Better inventory management: Faster visibility into slow-moving inventory led to more proactive promotions, reducing clearance losses by 20% ($1.5M annually).

Improved collaboration: Business and IT speak the same language (the conceptual model). Less time lost to misunderstandings.

The ROI was clear within the first year.

Conclusion: The Universal Pattern

Compare ModernRetail (retail) to RegionalHealth (healthcare):

Different domains: Products vs. Patients, Orders vs. Encounters, Inventory vs. Clinical Supplies

Different systems: SAP vs. Epic, Salesforce vs. Workday, supply chain systems vs. lab systems

Same pattern:

  • Simple conceptual model
  • Inevitable fragmentation across systems
  • Semantic layer preserves conceptual simplicity
  • AI agents enable natural language access
  • Business value through faster, better decisions

This pattern is universal. Whether you're in manufacturing, financial services, logistics, or any other industry, you have:

  • Core entities everyone understands
  • Fragmented systems for historical and practical reasons
  • Business users who want to think conceptually, not technically

The semantic layer is the bridge. It works in healthcare. It works in retail. It will work in your industry.

The conceptual simplicity of enterprise data is real. The implementation complexity is unavoidable. But the practical accessibility—enabled by semantic layers and AI—is finally achievable.


This concludes the series on Enterprise Data Systems and the Semantic Layer approach.