Knowledge Graph Basics

Knowledge Graph Basics: Build & Understand KGs in SEO & AI

Nov 9, 2025
 

Introduction to This Section

In [[#Understanding the Recommendation System Why is it needed ?]], we established the high-level purpose and structure of the Recommender System. Now we will examine each of the three core layers in depth, understanding not just what they do, but how they accomplish their functions and how they interact with each other.
As we explore each layer, I will show you the internal components, the data transformations that occur, and the decision logic that drives the system. This will give you the detailed knowledge needed to understand how raw performance data becomes a prioritized, actionable recommendation.

Layer 1: Recommendation Generation Layer

Purpose and Role

The Recommendation Generation Layer serves as the opportunity discovery engine. ==Its fundamental job is to take heterogeneous inputs from multiple sources and transform them into structured, domain-organized opportunity packages.==
Think of this layer as a diagnostic system that constantly monitors the health of a supplier's business across multiple dimensions. When it detects patterns that suggest intervention opportunities, it does not simply raise an alert. Instead, it constructs comprehensive opportunity packages that contain all the context needed for the downstream layers to build explanations and rankings.

Core Components and Flow

Let me show you the internal structure of this layer:
graph TB subgraph Inputs["Input Sources"] A[Domain Context<br/>Sales, Digital, Price, Store] B[Supplier Characteristics<br/>Profile, History, Preferences] C[Market Conditions<br/>Benchmarks, Competitors, Trends] D[Performance Data<br/>KPIs, Metrics, Time Series] E[Trigger Events<br/>Anomalies, Thresholds, Patterns] end subgraph Processing["Generation Processing"] F[Profile Analyzer<br/>Understands supplier context] G[Trigger Detector<br/>Identifies performance signals] H[Pattern Matcher<br/>Links triggers to drivers] I[Domain Classifier<br/>Categorizes by action level] J[Opportunity Constructor<br/>Builds complete packages] end subgraph Outputs["Generated Opportunities"] K[Customer Action Opportunities<br/>Customer-level interventions] L[Store Action Opportunities<br/>Store-level interventions] M[Product Action Opportunities<br/>Product-level interventions] end A --> F B --> F C --> F D --> G E --> G F --> H G --> H H --> I I --> J J --> K J --> L J --> M style Processing fill:#e1f5ff style Outputs fill:#d4edda

Detailed Component Explanation

Profile Analyzer Component
This component builds a comprehensive understanding of the supplier by integrating multiple data sources. It examines historical performance patterns to understand what is normal for this particular supplier. It reviews the supplier's product portfolio to understand what categories and brands they manage. It considers the supplier's engagement history to understand their preferences and constraints.
==The output of the Profile Analyzer is a rich context object that describes the supplier's current state, capabilities, and strategic focus areas. This context object is used throughout the generation process to ensure that opportunities are relevant to this specific supplier.==
Trigger Detector Component
==The Trigger Detector continuously monitors performance data looking for meaningful deviations from expected patterns. It employs multiple detection strategies including anomaly detection algorithms, threshold-based alerts, and pattern recognition.==
What makes this component sophisticated is that it does not treat all deviations equally. A five percent decline in sales might be meaningless noise for one supplier but a critical signal for another, depending on context like seasonality, recent marketing activities, or market conditions. The Trigger Detector uses the supplier context from the Profile Analyzer to calibrate its sensitivity appropriately.
Pattern Matcher Component
When the Trigger Detector identifies a performance signal, the Pattern Matcher investigates the underlying drivers. This component looks at correlated metrics to build a causal story.
For example, if total sales are declining, the Pattern Matcher examines related metrics such as customer count, average transaction value, units per customer, purchase frequency, and product mix. It identifies which of these contributing factors are also showing anomalous patterns and constructs a driver hierarchy that explains the trigger.
The Pattern Matcher is essentially building a hypothesis about what is causing the observed performance change. This hypothesis becomes the foundation for the explanation layer's narrative.
Domain Classifier Component
Once we understand what is happening and why, the Domain Classifier determines at what level of granularity intervention should occur. ==This is where the three action domains become important.==
==The classifier asks: Is this a situation requiring customer-level intervention, such as changing how we target or engage customers? Is it a store-level issue requiring operational changes at specific locations? Or is it a product-level problem requiring changes to product content, pricing, or assortment?==
The classification is based on the nature of the trigger and drivers. For instance, if the issue is driven by declining product discovery in search, this is clearly a product-level action. If the issue is out-of-stock problems at specific stores, this is a store-level action. If the issue is declining customer retention, this is a customer-level action.
Opportunity Constructor Component
The final component in this layer assembles all the information gathered by the previous components into structured opportunity packages. Each package contains:
  • The trigger KPI and its characteristics (what changed, by how much, over what time period)
  • The driver KPIs and their relationships (what is causing the change)
  • The classified action domain (customer, store, or product)
  • The relevant supplier context (specific to this supplier's situation)
  • Initial suggestions for action categories (surveys, campaigns, inventory actions, content improvements)
These opportunity packages are comprehensive data structures that carry all necessary context forward to the explanation layer.

Layer 2: Recommendation Explanation Layer

Purpose and Role

The Explanation Layer transforms opportunity packages into human-readable narratives that suppliers can understand and act upon. This layer is critical because without clear explanation, even the most accurate opportunity identification would fail to drive action.
The layer operates on a fundamental principle: every recommendation must answer three questions in sequence. ==Why is this happening? What should I do? How do I execute it? These questions map to the three-tier explanation framework.==

The Three-Tier Explanation Framework

graph TB subgraph Input["From Generation Layer"] A[Opportunity Package<br/>Trigger + Drivers + Domain + Context] end subgraph Tier1["Tier 1: Driver Explanation"] B[Analyze Trigger Type<br/>Sales, OOS, Performance Gap] C[Identify Contributing Factors<br/>Which drivers are active] D[Assess Business Impact<br/>Revenue, operations, growth] E[Determine Time Urgency<br/>How quickly to act] F[Construct WHY Narrative<br/>Complete causal story] end subgraph Tier2["Tier 2: Recommendation Explanation"] G[Map to Action Type<br/>Survey, Campaign, Inventory, Content] H[Define Expected Outcome<br/>Acquisition, Retention, Efficiency] I[Specify Goal Alignment<br/>Strategic business objective] J[Construct WHAT Narrative<br/>Specific action to take] end subgraph Tier3["Tier 3: Action Explanation"] K[Identify Target Scope<br/>Which customers, stores, products] L[Specify Execution Channel<br/>Platform, system, interface] M[Detail Implementation Steps<br/>How to configure and launch] N[Set Success Metrics<br/>How to measure effectiveness] O[Construct HOW Narrative<br/>Complete execution guide] end subgraph Output["Complete Explanation"] P[Three-Tier Narrative<br/>Ready for supplier consumption] end A --> B B --> C C --> D D --> E E --> F F --> G G --> H H --> I I --> J J --> K K --> L L --> M M --> N N --> O O --> P style Tier1 fill:#fff4e1 style Tier2 fill:#ffe1f4 style Tier3 fill:#e1f4ff style Output fill:#d4edda

Tier 1: Driver Explanation - The Why

The Driver Explanation begins by characterizing the trigger type. Different trigger types have different standard patterns of contributing factors. For example, a sales decline trigger typically involves examining customer count changes, average transaction values, and purchase frequency. An out-of-stock trigger focuses on inventory levels, forecast accuracy, and fulfillment rates.
Once the trigger type is characterized, the system constructs a narrative around the contributing factors. This narrative explains which specific metrics are showing unusual behavior and how they relate to the primary trigger. The explanation is structured to build a coherent causal chain rather than simply listing metrics.
The business impact section quantifies what is at stake. If sales have declined by fifteen percent, how much revenue has been lost? If out-of-stock rates have increased, how many missed sales opportunities does that represent? This quantification makes the issue concrete and urgent.
Time urgency provides context for how quickly action is needed. Some situations require immediate intervention while others can be addressed over a longer planning horizon. This helps suppliers prioritize across multiple recommendations.
The complete Driver Explanation reads as a coherent diagnostic statement, similar to a doctor explaining a diagnosis to a patient. It provides enough detail to understand the situation without overwhelming the reader with data.

Tier 2: Recommendation Explanation - The What

==The Recommendation Explanation takes the diagnostic understanding from Tier 1 and translates it into a specific action recommendation. This requires mapping the situation to an appropriate action type from the catalog of available interventions.==
The mapping is not arbitrary. Each action type is suited to particular situations. Surveys are appropriate when you need deeper understanding of customer attitudes or behaviors. Marketing campaigns are appropriate when you need to change awareness or consideration. Inventory actions are appropriate for operational problems. Content improvements are appropriate for discoverability issues.
The explanation specifies what goal or outcome the action aims to achieve. This goal is drawn from a standardized set of strategic objectives like customer acquisition, customer retention, operational efficiency, or competitive positioning. By explicitly stating the goal, the system helps suppliers understand not just what to do, but what success looks like.
The complete Recommendation Explanation is a clear, actionable statement that leaves no ambiguity about what intervention is being suggested and what it is intended to accomplish.

Tier 3: Action Explanation - The How

The Action Explanation provides the practical implementation details. This is where abstract recommendations become concrete action plans.
==Target scope specification is critical. If the recommendation is to launch a survey, who should be surveyed? If it is to run a marketing campaign, which customer segments should be targeted? If it is an inventory action, which stores and products are affected? The system uses the context from the opportunity package to make these specifications precise.==
Execution channel specification tells the supplier which platform or system to use. ==Different action types have different execution mechanisms, and suppliers need clear guidance on where to go and what to do once they decide to act on a recommendation.==
Implementation steps provide a roadmap for execution. While these steps cannot be exhaustively detailed within the recommendation itself, they should provide enough guidance that the supplier understands the general process and can seek additional help if needed.
Success metrics define how the supplier will know if the action was effective. These metrics are tied back to the original trigger and drivers, creating a feedback loop that allows for learning and refinement.

Layer 3: Recommendation Ranking Layer

Purpose and Role

The Ranking Layer solves the prioritization challenge. Even with perfect generation and explanation, a supplier might receive dozens of valid recommendations. The Ranking Layer determines which opportunities should be surfaced first, ensuring that suppliers see the most relevant and impactful recommendations for their specific context.
This layer implements a sophisticated personalization engine that learns from supplier behavior over time. Unlike the previous two layers, which are relatively deterministic given their inputs, the Ranking Layer employs machine learning and heuristic techniques that adapt based on feedback.

Core Ranking Components and Process

graph TB subgraph Input["From Explanation Layer"] A[Explained Opportunities<br/>Full three-tier narratives] end subgraph Context["Ranking Context Inputs"] B[Supplier Profile<br/>Business characteristics] C[User Intent<br/>Current queries and filters] D[Historical Engagement<br/>Past interactions and responses] E[Performance Metrics<br/>Current business state] F[Opportunity Properties<br/>Lead time, complexity, impact] end subgraph Scoring["Scoring Engine"] G[Relevance Scorer<br/>Match to current needs] H[Impact Scorer<br/>Potential business value] I[Feasibility Scorer<br/>Practical constraints] J[Engagement Scorer<br/>Likelihood of action] K[Composite Score Calculator<br/>Weighted combination] end subgraph Ranking["Ranking Logic"] L[Domain-Level Prioritization<br/>Customer, Store, or Product first?] M[Within-Domain Ordering<br/>Rank opportunities within each domain] N[Diversity Enforcement<br/>Avoid redundancy] O[Policy Application<br/>Governance rules] end subgraph Output["Ranked Recommendations"] P[Prioritized Domain List] Q[Ranked Opportunities Per Domain] R[Domain-Level Rationale] S[Expected Impact Indicators] end A --> G B --> G C --> G D --> J E --> H F --> I G --> K H --> K I --> K J --> K K --> L L --> M M --> N N --> O O --> P O --> Q O --> R O --> S style Scoring fill:#f0e1ff style Ranking fill:#ffe1e1 style Output fill:#d4edda

Detailed Ranking Component Explanation

Relevance Scorer
The Relevance Scorer evaluates how well each opportunity matches the supplier's current needs and context. It considers user intent signals such as search queries, filter selections, and page navigation patterns. If a supplier is actively looking at their customer retention metrics, opportunities related to customer retention receive higher relevance scores.
The scorer also considers the supplier's business profile. A supplier in a growth phase has different priorities than a supplier in a mature optimization phase. A supplier with limited resources cannot pursue the same opportunities as one with substantial budgets. The Relevance Scorer incorporates these contextual factors into its assessment.
Impact Scorer
The Impact Scorer estimates the potential business value of acting on each opportunity. This estimation is based on multiple factors including the magnitude of the underlying performance gap, the historical effectiveness of similar interventions, and the scale of the opportunity in terms of revenue or operational metrics.
For example, if sales have declined by twenty percent representing significant lost revenue, and similar situations in the past have shown strong positive response to targeted surveys, the Impact Scorer would assign a high score to a survey recommendation in this case.
Feasibility Scorer
The Feasibility Scorer assesses practical constraints. Some opportunities require significant time investment, others require budget allocation, and others require coordination across multiple teams. The Feasibility Scorer evaluates whether the supplier has the resources and capabilities to realistically pursue the opportunity.
This scorer also considers lead time requirements. If an opportunity requires weeks of preparation but the performance issue demands immediate attention, the feasibility score is adjusted accordingly. The goal is to ensure that highly-ranked recommendations are actually actionable given the supplier's constraints.
Engagement Scorer
The Engagement Scorer predicts the likelihood that the supplier will actually act on the recommendation based on historical patterns. Over time, the system learns which types of recommendations each supplier tends to engage with and which they tend to ignore.
This learning happens at multiple levels. If a specific supplier consistently acts on survey recommendations but rarely acts on advertising recommendations, the Engagement Scorer weights survey opportunities higher for that supplier. If the supplier has recently taken action on a similar opportunity and is unlikely to be ready for another similar action, the scorer adjusts accordingly.
Composite Score Calculator
The Composite Score Calculator combines the individual scores using a weighted function. The weights are tunable parameters that can be adjusted based on business priorities and empirical performance data. The composite score represents the overall priority of each opportunity considering all factors simultaneously.
Domain-Level Prioritization
==Before ranking individual opportunities, the system first determines which action domain should be emphasized. This is based on analyzing where the supplier has the most critical needs and the highest concentration of high-scoring opportunities.==
The result is a domain ordering such as: Customer Actions should be the primary focus, followed by Product Actions, followed by Store Actions. This domain-level prioritization helps suppliers understand where to focus their strategic attention.
Within-Domain Ordering
Within each prioritized domain, opportunities are ranked according to their composite scores. The highest-scoring opportunities appear first, with the ranking reflecting the sophisticated scoring logic described above.
Diversity Enforcement
To prevent redundancy, the Ranking Layer enforces diversity constraints. If multiple opportunities are essentially addressing the same underlying issue through slightly different mechanisms, the system avoids showing all of them. Instead, it selects the highest-ranked variant and suppresses the others, noting their existence but preventing recommendation overload.
Policy Application
Finally, the system applies governance policies that may override purely score-based rankings. For example, certain recommendations might be time-sensitive and need to be elevated despite moderate scores. Others might have been recently dismissed by the supplier and should be temporarily suppressed. These policy rules ensure that the ranking respects business constraints and supplier preferences.

Integration: How the Three Layers Work Together

To solidify your understanding, let me walk through a complete example showing how an opportunity flows through all three layers:

Example Scenario: Sales Decline Detection

Starting Condition: The system detects that Supplier ABC's sales in the Laundry Detergent subcategory have declined by eighteen percent quarter-over-quarter.
Layer 1: Generation Process
The Profile Analyzer retrieves Supplier ABC's context, noting they are a premium brand supplier with historically stable performance and recent investments in product innovation.
The Trigger Detector flags the eighteen percent sales decline as significant because it represents a sharp deviation from Supplier ABC's stable historical pattern.
The Pattern Matcher investigates and finds that customer count has decreased by fifteen percent and units per customer have decreased by twelve percent. Both contributing factors are statistically significant.
The Domain Classifier determines this is a Customer Action opportunity because the drivers are customer-level metrics related to retention and engagement.
The Opportunity Constructor builds a package identifying this as a customer retention issue in the Sales Performance domain, with all relevant context attached.
Layer 2: Explanation Process
Tier 1 Driver Explanation: "Your sales in Laundry Detergent have declined eighteen percent compared to last quarter, representing approximately one hundred twenty-five thousand dollars in lost monthly revenue. This decline is driven by a fifteen percent reduction in customer count and a twelve percent decrease in units purchased per customer. The pattern suggests customers are both leaving and purchasing less when they do buy."
Tier 2 Recommendation Explanation: "We recommend launching a Customer Retention Survey focused on Product Performance Understanding. This survey will help identify why customers are reducing purchases or switching to competitors, with the goal of uncovering actionable insights to reverse the declining trend."
Tier 3 Action Explanation: "Target the survey to customers who have shown decreased purchase frequency over the past three months. Deploy through the Customer Perception platform. Include question modules on product satisfaction, competitive alternatives, and price perception. Expected survey size: fifteen hundred to two thousand respondents. Lead time: two to three weeks for design and deployment."
Layer 3: Ranking Process
The Relevance Scorer assigns a high score because Supplier ABC has recently been reviewing their customer retention metrics, indicating this is top of mind.
The Impact Scorer assigns a high score because the revenue impact is substantial and historical data shows strong effectiveness of retention surveys in similar situations.
The Feasibility Scorer confirms this is actionable given Supplier ABC's resources and the reasonable lead time.
The Engagement Scorer notes that Supplier ABC has historically responded well to survey recommendations.
The composite score places this opportunity in the top three across all domains. At the domain level, Customer Actions is prioritized highest because this is where the most critical issues exist.
The final output presents this as the number one recommendation, with complete explanation and clear action steps.

Key Design Principles Across All Layers

As you have seen, each layer has distinct responsibilities, but they share common design principles:
Separation of Concerns: Each layer focuses on its specific function without overstepping into the responsibilities of other layers. Generation focuses on identification, Explanation focuses on narrative, Ranking focuses on prioritization.
Composability: The layers are designed to work together seamlessly with well-defined interfaces between them. The output of one layer becomes the input of the next in a clean data pipeline.
Transparency: Every transformation and decision is traceable. If a supplier asks why they received a particular recommendation, the system can point to the specific triggers, drivers, scores, and rules that led to that outcome.
Adaptability: While the core logic is structured and deterministic where appropriate, the system incorporates learning mechanisms that allow it to improve over time based on feedback and engagement patterns.
Supplier-Centricity: Every component is designed with the supplier's perspective in mind, ensuring that recommendations are not just technically correct but also practically useful and contextually appropriate.

Summary of Part 2

You now understand the three core layers of the Recommender System in depth:
The Generation Layer identifies opportunities by analyzing performance triggers against supplier context, constructing comprehensive opportunity packages organized by action domain.
The Explanation Layer transforms these packages into three-tier narratives that answer why the opportunity exists, what action should be taken, and how to execute it.
The Ranking Layer prioritizes opportunities using sophisticated scoring that considers relevance, impact, feasibility, and engagement likelihood, ensuring suppliers see the most appropriate recommendations first.
These layers form a complete pipeline that transforms raw performance data into prioritized, actionable, well-explained recommendations that suppliers can confidently act upon.

Next: We will explore the Action Domain Framework in detail, learning about Customer Actions, Store Actions, and Product Actions, and understanding how opportunities are classified and structured within each domain.

 
Read More
Blogs
Blogs

Related Articles

 
Â