Română
Last updated: 12.03.2026
Public preview
CHAPTER
02
THE TECHNOLOGY

How does it work?

Did you know that there are B2B advantages for implementing AI in sales as compared to B2C? Basket sizes are large, products usually have unique codes, and there are many recurring transactions. Before debunking myths in the next chapter, right here we will dissect the technology. The non-technical reader can skip straight to the following chapters.
CHAPTER PLAN
2.0

Introduction

This chapter covers the evolution of recommendation systems, measurable AI objectives, and the architecture of top-tier solutions. Then it compares the Build approach (custom development) with the Managed approach (native cloud solution) and presents the diagram of a "privacy-first" hybrid implementation from our projects. Finally, we discuss the challenges of implementing AI for recommendations.

B2B Specifics

In B2B, recommendations must simultaneously maximize relevance, margin, and availability, which leads to specific challenges. How guardrails are imposed and how the data contract that guarantees recommendation relevance is defined.

As a technological introduction, this is the funnel architecture diagram for a recommendation system:

AI Recommendation Pipeline: finding candidates, ranking them, and applying business rules

   FULL PRODUCT CATALOG (e.g., 1 million)
                    │
                    ▼
STEP 1: RETRIEVAL/GENERATION (High speed, wide coverage)
"Find 500 similar products"
(Vector search + lexical filters)
│
▼
CANDIDATES (e.g., 500 products)
│
▼
STEP 2.1: SCORING / RANKING (Medium speed)
"Top results by probability of purchase (pCVR)"
(Deep Learning Neural Network)
│
▼
STEP 2.2: RE-RANKING AND RULES (Fast)
"Remove out-of-stock and low margin"
(Post-processing via guardrails)
│
▼
FINAL RESULT (e.g., 3 recommended products)

                
Fig. 2.1: AI Recommendation Pipeline: finding candidates, ranking them, and applying business rules

For reading flow, we will illustrate technical concepts using the Google Cloud ecosystem. However, the architecture presented is universal: it can be replicated in other clouds, such as Microsoft Azure or Amazon Web Services, or with various SaaS solutions.

Products and technologies
Products
Google Cloud Google's cloud platform.
Vertex AI Platform for AI technologies, open-source or proprietary within Google Cloud.
Vertex AI Search Google-managed technology for AI search and search-based applications, including file search. See Guide #4
Vertex AI Search for commerce (formerly Retail) Google-managed technology for RecSys (recommendation system) or product search, corresponding to the Managed variant in this chapter.
AI Models
Foundation Model Generative LLM model (e.g., Google Gemini).
Tuned Model A foundation model trained by the company (e.g., via Tuning API in Vertex AI).
Pre-trained Model Predictive AI model (Deep Learning, Gen 3) trained on previous global transactions (e.g., Google Shopping). Generally synonymous in the text with the recommendation system.

Note: Product names and functionalities may change. See the full Glossary here

Guide: How to choose a Google Cloud implementation partner

HISTORY AND SCALING
2.1

From Organizational Knowledge to Deep Learning

The history of recommendation generations explains how we arrived at the present moment. We will see an evolution from human intuition to mathematical engineering, which is becoming accessible at scale through AI.

Gen 0: Non-automated Organizational Knowledge

In many sales teams, recommendations are based on the expertise of senior agents and the company's know-how. The company knows that "X prefers brand Y" or that "Only this specific fitting works for this type of pump."

The major limitation is scalability and personnel risk. Beyond a certain point, the company:

  • Can only grow its own know-how through rigorous training programs
  • Can only apply commercial policy with detailed internal documentation and strict procedures

When a senior agent leaves the company, logical connections are lost. New agents sell basic products, missing upsell opportunities for 6-12 months ('ramp-up'). In fact, indicators cited in Ch. 1 show the maximum impact of AI in the case of junior sales agents.

This type of knowledge is essential for custom AI configuration because it directly expresses the company's specific factors of success. AI does not replace the intuition of senior agents, it scales it.

Gen 1: Expert Systems and Static Rules (2000-2015)

With the emergence of e-commerce and ERP platforms, companies began to institutionalize their own know-how and rules.

Technology

Expert systems are collections of IF-THEN conditions organized logically. Functionality depends on customization. Ex: In many ERP systems, a Product Manager manually sets compatibilities per category or per product: "If the product is Lenovo T480 Laptop, display in accessories: Lenovo Docking Station." In distribution, the features to correlate are usually too numerous for manual management.

The major limitation is maintenance:

  • In a catalog with 50,000 items, it is impossible to maintain links manually.
  • Successful companies rigorously define a hierarchical taxonomy that allows them to manage rules.
  • Rules can become outdated: accessories go out of stock or are removed from the manufacturer's catalog.

Another limitation is rigidity. The system is "blind" to the customer, forcing B2B companies to operate a manual approval hierarchy or a loyalty system for discounts.

Gen 1 logic remains essential in data preparation for machine learning and for ranking and filtering AI recommendations to gain control.

Gen 2: Collaborative Filtering (2015 - 2020)

Well known for "Customers who bought this also bought..." sections, this is classic Amazon-style technology used by global and local e-commerce giants. This is why many popular plugins (e.g., WooCommerce) sell this logic under the generic "AI" label.

Technology

Based on working with mathematical matrices (Matrix Factorization) and k-NN algorithms (k-Nearest Neighbors). The cross-matrix of historical transactions is analyzed. Algorithms find patterns in the purchase history only between the IDs of products ordered together.

The major limitation is the Cold Start problem, especially in B2B:

  • The algorithm only analyzes products already purchased and only their IDs.
  • New products (e.g., products from supplier catalogs that haven't established themselves in the market) and new customers do not receive relevant recommendations.
  • Companies will still rely on organizational knowledge (Gen 0): senior agents know from experience with other similar products and other similar customers what the recommended sales approach is.

Another limitation is popularity bias. Gen 2 algorithms tend to recommend only best-sellers, ignoring niche products that often have higher margins (long tail).

Gen 3: Contextual Deep Learning Recommendations

Today's standard in Predictive AI was accelerated by major platforms like YouTube, Google Shopping, and Netflix. It has been used in recent years by major players, including regional e-commerce giants, and AI progress is democratizing it for the mid-market segment; see the Managed approach in Ch. 2.4.

The same technique underlies hybrid search, which combines lexical search (e.g., SKU, close dimensions) with semantic search (e.g., wood screw = self-tapping screw). It brings the greatest benefits to B2B software; see applications in Guide #4.

Technology

Deep Learning means applied neural networks operating in (near) real-time. DCN (Deep & Cross Network - promoted by Google) and Transformer architectures are used for sequential recommendations (based on clicks, not words as in ChatGPT).

What Gen 3 adds:

1. Understanding the Sales Sequence

The system understands the cyclicality of consumables. If a clinic bought an ultrasound machine today, it won't buy another one tomorrow. But it will usually need conductive gel. The algorithm predicts the probability of purchase, and a "Buy it again" widget can be generated.

With an added time-series modeling AI model, it can also predict the date the customer's stock will be depleted, activating the Predictive Replenishment deliverable from Ch. 3.

Hybrid Approach Scenario:

  • The middleware of a distributor with 500,000 products queries a temporal prediction model (e.g., Vertex AI Forecast) and calculates "Product X will be depleted in 8 days."
  • The result is written to the database as an "Estimated stock depletion date" attribute.
  • The attribute is sent to Vertex AI Search for commerce where a control promotes (Boost) or demotes (Bury) it for sale, depending on strategy.
  • The middleware triggers an automated supplier order workflow.

2. Content-Based Understanding (including Multimodal)

When a new product appears without history, predictive AI analyzes the attributes (complete and descriptive). It "understands" it and recommends it to relevant customers, solving the Cold Start problem from Gen 2.

See attribute extraction from images and PDFs in Guide #3: Multimodal Input

3. Context Processing

It takes into account not just "who you are," but also "what you are doing now." For example: the customer is on mobile, is in a hurry, is during working hours or on a weekend.

Deep Learning-based recommendation systems can sell a new product to a new customer, whereas Gen 2 sells what is already popular.

Additionally, pre-trained models in products like Vertex AI Search for commerce are excellent for anonymous or new customers, even without personalization, following experience on systems like Google Shopping.

We can have generative applications like chatbots added on top of the predictive base. These are available in both the Build (custom) and Managed variants. Note that in B2B we won't train an LLM from scratch (for cost reasons), but open-source variants can be integrated.

Gen 4: AI Agents

Already in 2026, AI agents based on LLMs are everywhere in the press, for example, after the launch of UCP for automatic negotiation between agents. LLM models are excellent as a conversational interface and as an orchestrator: they can explain the recommendations made, summarize the commercial context, and can quickly compose business rules, although they cannot apply them with guarantees (due to the risk of hallucinations) and operate at a slow speed.

For a scalable recommendation system with strict latency and predictable cost, the system usually remains Gen 3. LLM applications intervene selectively, for example through chatbots that explain and justify for the customer. See the Copilot deliverable in Ch. 3.3.1.

Technology

LLMs are also forms of Deep Learning but trained generatively on a massive amount of data (nearly all written knowledge). The global impact of ChatGPT and AI agents justifies the name Gen 4. There are implementation variants where generation time falls below 0.5 sec (e.g., Small Language Models).

Generation Decision Basis Advantages Risks
Gen 0 Memory Excellent context Loss of know-how with staff turnover. Difficult training.
Gen 1 Static Rules Total control Impossible maintenance at high volume.
Gen 2 Statistics Automation Cold Start: Does not recommend new products or to new customers.
Gen 3 (predictive) Deep Learning
Intent prediction.
Semantic search.
Chatbots (LLM-enhanced).
Requires pre-trained models (e.g., Google) or tuning on sufficient data.
Gen 4 (agentic) Generative Deep Learning
Reasoning, performs actions.
Not the first choice for a scalable and stable recommendation system.

Context vs. prompt and the predictive-generative combination

In predictive AI (Gen 3), models operate on structured context: products, events, customers, rules. Context engineering (selecting and cleaning attributes, defining correct events, guardrails) has a major impact on result quality.

The prompt as a tone control instrument only appears in applications built on top of the predictive foundation with the addition of a generative function (Gen 4). For example, in Vertex AI Search for commerce, you can create chatbots that separate search intent from purchase intent by connecting in the new Conversational mode (see Guide #4). The Conversational agent will run over the predictive base that associated the products.

In brief

  • Gen 0-1 provide context and control.
  • Gen 2-3 provide scaling and personalization and today allow for chatbots.
  • Gen 4 provides applied intelligence, but is still slow for recommendations and upsell.
  • Hybrid architecture combines them, it doesn't replace them.

For the 2027 horizon, see AI News - Evolving Technologies.

OBJECTIVES AND KPIs
2.2

How do we measure AI success?

You can organize your sales engine with AI around fundamental notions that can be transformed into measurable indicators for the company. See also the deliverables in Ch. 3 .

Business Goals

1. Optimizing customer experience

The engine of sales performance. AI is used to link company data to the customer experience (usually frontend via e-commerce, but also in direct or multi-channel sales) through personalization and contextual intelligence.

"Adopting gen AI into external-facing use cases is the difference between providing a personalized, accurate response versus a generic one. " - Source: Google Cloud State of AI 2025

2. Automating internal processes

What it is: Using AI to help the internal agent (acting as a copilot), with the goal of allowing people to concentrate on high-value activities, without repetitive tasks.

"Automating repetitive tasks [...] frees up human capital for higher-value activities."

Source: Google Cloud State of AI 2025

Technological Foundation

3. Models and tuning (personalization)

Adapting AI to the specific data, products, and customers of the company brings digital literacy to the company and the adoption of top technologies. Pre-trained models can be used, or you can customize (tune) foundation models (e.g., Google Gemini).

"Customers can customize foundation models for specific use cases by tuning them using our tuning APIs."

Source: Google Cloud - Delivering trusted and secure AI Whitepaper 2025

4. Data cleanliness and relevance

Recommendations based on the exact context of the customer depend on quality data from all company systems. Cleaning and controlling your own data are the keys to success.

"Deliver more data relevance [...] directly relevant to the specific context."

Source: Google Cloud - Delivering trusted and secure AI Whitepaper 2025

5. Guardrails (safety rules)

Rules that protect the company and its image, avoid absurd recommendations, and prevent losses (e.g., selling below margin). These can be deterministic like expert systems, in line with the hybrid architecture idea. Google Cloud also includes safety controls in its AI products.

"Customizable technical controls such as safety filters [...] configured based on both probability and severity scores."

Source: Google Cloud - Delivering trusted and secure AI Whitepaper 2025

Fine-tuning

6. Explainable AI (xAI)

The ability to explain why a recommendation was made, to gain the trust of the agent, management, and ultimately the customer.

"Explainable AI tools [...] help understand and interpret predictions made by machine learning models."

Source: Google Cloud - Delivering trusted and secure AI Whitepaper 2025

7. Human-AI Interaction

An unspoken fear in B2B sales is: "If the customer buys the product recommended by AI, do I get my commission?" To prevent resistance to new technology, the agent can use AI recommendations as an instant product sheet to win more customers.

"Organizations can successfully implement AI by following best practices like identifying stakeholders, defining principles, [...] visibility, and implementing an AI training program."

Source: Google Cloud - Delivering trusted and secure AI Whitepaper 2025

Example:

In the Copilot approach, the agent receives full commission, even if the idea came from AI.

In brief:

Establish KPIs that can be tracked internally per contract, customer, or customer group:

  • Change in AOV (Average Order Value) (%)
  • Click-through rate on recommendations - in e-commerce (%)
  • Average quoting time (minutes)
  • Wrong recommendations (e.g., 0 stock / below margin / incompatible, for guardrails)
  • Internal and external tickets related to recommendations (for explainability)
  • Number of employees using AI (%)
  • Technical metrics: NDCG@k (ranking relevance), Recall@k (search relevance)
ARCHITECTURE
2.3

What to implement?

Today's established model uses Deep Learning to achieve recommendations, upsell, cross-sell, and understanding of the purchase sequence, product content, and customer context.

This architecture is implemented from scratch by e-commerce giants, or included in fully managed solutions like Google Cloud's Vertex AI Search for commerce technology.

Technology

Deep Learning uses three stages: an approximate one (generation), a re-ordering and control one (post-processing), plus a final feedback loop stage. The first stage has two brains: one that knows the products and one that knows the customer.

Simplified logical diagram

The stages of a Deep Learning-based AI recommendation system:

Data systems Systems for RecSys Applied technologies
Step 1: Candidate Generation (Retrieval) - the two-towers approach

Company data: ERP, CRM, WMS, e-commerce (tower 1)

Data warehouse (+ simple pre-processing filters)

Candidate Generation

Vector databases / Vector search (FAISS / ScaNN)

Live customer data: history, details, time, and day (tower 2)

Data streaming / Feature store

Infrastructure: API / Apache Kafka / Spark Streaming / Databricks / Vertex AI Feature Store

Separation: context, sequence, content

Sequence modeling: RNN / Transformers / State Space Models

Step 2: Ranking: ordering and scoring

Candidates obtained at Step 1

Scoring model

Objective optimization, by price sensitivity, biases, other rules

Re-ranking via guardrails, post-processing

Low-code (e.g., Boost / Bury)

Deterministic filters

Constraint engine

Continuous learning: feedback loop

Client feedback: positive: click / negative: hide

Data warehouse / Feature store / ML Ops Pipeline

Continuous re-training, Databricks / Vertex AI Pipelines

Case Study: Quoting time -68%, +14% average order value for distribution ERP

STANDARD ARCHITECTURE
2.3.1

Upsell and cross-sell via two-stage funnel and the two-towers approach

1. Top-tier architecture

Many e-commerce giants, as well as companies using a managed approach like Vertex AI Search for commerce, implement this architecture with two main stages: initial candidate generation (Retrieval) and their careful selection (Ranking).

"Two-towers" technology
  • The generation stage has two distinct neural networks. The first tower understands the product catalog (relatively stable) and the second understands the customer context (highly dynamic).
  • AI performs semantic matching, measuring the mathematical distance between the two towers.
  • The two-towers architecture is the standard that makes the Gen 3 described above possible.

Below we present the technical stages, but remember that in 2026 implementing from scratch is not necessary, see the Managed approach in Ch. 2.4.

2. Step 1: Candidate Generation (Retrieval)

From the millions of products in the catalog (possibly pre-processed with basic filters), a fast algorithm selects a few hundred relevant ones.

Technology

For searching, Vector Databases (e.g., Milvus, Qdrant, pgvector) or Vector Search (e.g., Facebook's FAISS library / Google's ScaNN) technologies are used.

Two data streams have created the search space in advance:

  • Products have been transformed into vectors (embeddings), via batch processing (daily) or via streaming (near real-time) for new products. As the similarity is semantic, synonyms (on clean data) are understood automatically: "drill" becomes very close to "hammer drill."
  • Through sequence modeling (Sequence Modeling) and continuous ingestion, hot data about the customer accessing the system reaches the same vector search space in (near) real-time.

Advantage: On both towers, the system looks for the nearest neighbors to deliver the right product to the right customer at the right time.

3. Step 2: Ranking (ordering / scoring and post-processing)

From the hundreds of candidate products, the model must calculate a numerical score for conversion probability. For example, pCVR: probability of conversion (purchase, offer acceptance, other success event). These candidates rank first.

Technology
  • Generated products are passed through a complex model (e.g., gradient boosted trees or DCN: Deep & Cross Network) for scoring.
  • In the next stage, guardrails are applied for re-ranking.
  • Guardrails can be written by programmers (e.g., Python, libraries like Drools) in Build or configured manually (or JSON) in the console as Serving Controls in Managed.

Business rules (guardrails) applied at the end during post-processing are essential for AI control (see details in Ch. 2.5.1):

  • Ensure alignment with commercial policy: some scores are adjusted, some results are removed.
  • Express the priority of deterministic business rules over AI non-determinism.

Example of re-ranking:

B2B sales teams often recommend the product with the highest purchase probability that simultaneously has the best margin and is also available.

To maintain this logic, in the post-processing stage, you can take the top products ranked by pCVR and compare margins, check stock, and then re-rank them.

4. Upsell, cross-sell, discounting

A custom AI system that estimates pCVR and blocks discounts below margin

APPLICATION OR SITE             AI ENGINE + RULES (CUSTOM)                    APPLICATION OR SITE

┌───────────────────────┐       ┌─────────────────────────────────┐       ┌───────────────────────────┐
│ Customer: Cart        │       │ 1. Estimate pCVR                │       │ Reload cart:              │
│ Products: [A, B, C]   │ ─────>│    (conversion probability)     │ ─────>│                           │
│ Total: 950 USD        │       │ 2. Check margin                 │       │ - Product A               │
└───────────────────────┘       │    (via guardrails)             │       │ - Product B               │
                                │ 3. Decide:                      │       │ - Product C               │
                                │    "Worth -4% to close now"     │       │ [DISCOUNT: -38 USD]       │
                                └─────────────────────────────────┘       │ (limited availability)    │
                                                                          └───────────────────────────┘

                
Fig. 2.2: A custom AI system that estimates pCVR and blocks discounts below margin

Upsell: upgrade

Based on product features and attributes. For a 1,200 USD laptop, the model can push laptops with similar but marginally better specs (and better margins) in the ranking because it learned: customers comparing specs tend to upgrade.

Cross-sell: accessories

Based on compatibility rules reinforced by behavioral data.

For example, the vector of an excavator is strongly associated transactionally with the vector of the specific hydraulic filter kit (for maintenance). This is the first foundation for deliverable #8: Technical Compatibility Engine.

The other foundation is a system of exact compatibilities between products, for which you need detailed technical sheets and to specify filters in the guardrails (e.g., which fields must be identical).

See the generation of a Bill of Materials (BOM) with advanced technologies in AI News

 

Discounting: price optimization

The architecture can treat the discount as a conversion optimization variable. In fact, AI models will estimate the conversion probability for each scenario in the background.

Tactical example: If the customer is price-sensitive, a small discount can unlock a volume order.

Dynamic threshold example: If the customer adds products worth X USD, they will unlock a 5% discount.

This is the foundation for the Dynamic Price Optimization deliverable from Ch. 3. In Managed solutions, this logic is often custom (a separate component).

BEYOND MATRICES
2.3.2

Customer context and sequence modeling

The major difference between collaborative filtering (Gen 2) and Deep Learning recommendations (Gen 3 - current) is the ability to understand immediate intent, not just history.

1. Session Sequence Modeling

The current architecture doesn't just look at the global history, but at the current session.

Technology Uses RNN (Recurrent Neural Networks) models, Transformer-based architectures (similar to ChatGPT, but for clicks, not words), or State Space Models (newer, faster technology). A popular extension is time-series modeling.

B2C Example

If a phone has been added to the cart, the context vector changes instantaneously. The next recommendation will no longer be another phone (even if that's what they were looking for 5 minutes ago), but accessories, because the model has learned the logical sequence:

                          Phone view  Add to cart  Search cases
                        

B2B Example with time-series forecasting

AI can learn order cadence. If a customer buys toner exactly every 45 days, the system sends the recommendation on day 42, just before the customer looks for another supplier.

At first glance, AI is not needed for this simple case (you could take the simple average distance between orders). But if some customers have actual seasonality (e.g., a farm orders only in autumn and winter), AI will find these patterns too.

2. Device and time context

Hot data about the customer (session time, device used) is essential to recommend what the customer wants now.

Technology
  • Customer data becomes variables (Features) that enter the neural network alongside the product ID.
  • They are sent to a Feature Store (a collection of variables for AI), and the model will receive structured inputs:
  • [User_id, Product_id, Time_of_day, Device_type, Last_5_actions]

Example: If you log in from mobile in the evening, the model may favor easy-to-consume content or quick decisions, compared to desktop access during business hours (B2B purchases).

In highly specialized e-commerce, context is also ensured through guardrails, manually defined to optimize the current shopping session.

B2B Example: If you have an AMD processor in the cart, the "other recommended products" banner in the cart can be forced to recommend only AMD products.

DATA
2.3.3

Data ingestion and (near) real-time flow

The quality of recommendations varies directly with the quality and speed of input data (the GIGO principle: Garbage In, Garbage Out). For the AI model to be relevant, the data must be clean and pre-correlated.

For B2B, we recommend unifying data from all sources and continuous ingestion via API.

See in Guide #2 how we build the single source of truth to correctly feed the algorithms

1. Product catalog (Primary source: ERP, Secondary sources: WMS, PIM, e-commerce)

This is fundamental company data. AI can have access not just to the product name, but also to critical business metadata.

Required data

Title, Technical specifications (e.g., normalized dimensions), OEM codes / equivalent codes, Stock (often multi-warehouse), Margin, Images, etc.

AI must know that 'Filter X' is technically equivalent to 'Filter Y' to deliver the Smart Substitutes deliverable from Ch. 3.

Transfer to AI

Via API / queues / file import / CDC / RPA. Any price or stock change in the ERP (e.g., NetSuite, Epicor, Sage, Infor, Microsoft D365, Oracle JD Edwards) can be transmitted almost instantaneously (with data access). For relevance, incremental updates can be used (e.g., API Patching).

Example: If stock hits 0 at 2:00 PM and the recommendation needs to disappear at 2:01 PM, batch ingestion (once a day) would risk recommending unavailable products for 24 hours. Commercial rules (guardrails) can block this effect in any case.

Retraining the recommendation model can take place daily, processing large amounts of data for all products.

2. Customer history (Primary source: CRM)

AI needs to know who the customer is:

  • Before the first interaction in the sequence (e.g., click) or before their request for quotation is transcribed.
  • Continuously throughout their purchase flow (see Ch.4.3.2).
  • With correct aggregation per unit of measurement. In B2B, aggregation is done by account, company, or contract. For example, by Tax ID/EIN, not email as in B2C.
Without customer data, a cheap product might be recommended to a customer willing to pay for premium quality.

With the generalization of LLMs, ingesting unstructured data is also possible: sales calls and sent emails are permanently transcribed, then a sentiment or recommended action score (next best action) is obtained and can be written back into the CRM.

Case study: Financial sentiment analysis with GenAI & Google Cloud

Required data

Purchases from the last 12-24 months, other data: location, business size, unstructured data (calls, emails).

Transfer to AI

For B2B customers, the CRM profile (e.g., HubSpot / Salesforce / Pipedrive) can be injected (ETL) into the AI context, for example through tags to the API in the Managed version or through a new segment in the Build version.

Example: If a customer is a reseller, the algorithm can automatically prioritize components, not finished products. Additionally, if agent A of company X buys pipes, AI will recommend fittings to agent B of the same company X, even if agent B has never bought before.

3. Live events and clickstream (Source: e-commerce, other company applications)

These are immediate data and the strongest predictor of purchase intent, at least in e-commerce.

Required data

Events like detail-page-view, add-to-cart, remove-from-cart, purchase-complete.

Transfer to AI

Unlike a tracking system (e.g., Google Analytics) which only reports, this transfer implicitly trains the AI recommendation model.

Live data ingestion flow (e-commerce)

For clickstream, systems like Apache Kafka or Spark are used in the Build version, or API (userEvents) in the Managed version.

On product click, an event is sent to a Feature Store or via API. When the next page loads, the system queries the Feature Store: "What are the last 5 clicks of this customer?" and the model takes the updated context into account.

This prevents stale recommendations. The application (UX) can pivot directly to cross-sell. For example, it will recommend a warranty extension or an accessory.

Continuous relevance, guaranteed by low latency (milliseconds in optimized scenarios), explains why the average order in e-commerce with AI personalization and recommendations increases by 15%. See McKinsey indicator in Ch. 1.

Notes: For a successful AI implementation over company data, see the Data Contract and Business Rules in Ch. 2.5 for:

  • Data cleaning and avoiding GIGO
  • Protecting company prices, stock, and permissions
WHAT HAPPENED?
2.3.4

Explainable AI (xAI)

The neural networks used in custom architectures are largely black box. The human operator does not know exactly why product X was recommended to customer A now.

Risk reduction strategies are used.

A/B testing

We don't try to guess why it worked; we measure if it worked.

  • A/B frameworks allow 50% of customers to see algorithm A and 50% to see algorithm B. The Managed version (Google) has a native Experiment function.
  • The decision will be based on commercial KPIs: revenue, CTR.
  • For management, it is usually enough to see that version B brings +X% revenue.

In B2B:

  • The number of customers is smaller, sometimes lacking statistical relevance.
  • A recommended strategy is testing per customer (Account-Based Testing). Activate AI recommendations for the SMB segment and measure results before activating it for strategic customers. Don't forget to apply the strategy simultaneously on all channels on which you interact with customers.
  • In Ch. 4, we recommend running algorithms in Shadow Mode (internal use) before any external launch.

See the automated A/B testing methodology and feedback loops in Guide #5.

Tools for technical teams in the Build approach

Offline visualization (t-SNE, UMAP)

Data engineers can analyze 2D/3D charts of vectors/embeddings to see if products have grouped. Ex: if pans are near oil, the model has learned correctly.

Feature importance

Analyses can be performed to see which variable mattered most (e.g., price, brand, click sequence), but rarely in real-time. SHAP values (sampled) can be obtained, and Google Cloud has Feature Attribution for Custom Models and AutoML (personalized models).

Explainable AI tools in the Managed approach

In Vertex AI Search for commerce (recommendation mode), only when connecting with the new Conversational Commerce mode (see Guide #4), you can directly obtain the natural language explanation produced by the LLM. In the classic modality, you can only get a numeric relevance score, on the Evaluate dashboard page.

Feature importance

In Vertex AI Search and Vertex AI Search for commerce (search mode), there is a visual explainability dashboard with textual explanations, see Guide #4 for AI search.

In brief:

  • The system works in two steps: it finds many candidates, then ranks them intelligently and prioritizes or filters them using the company's rules (guardrails).
  • Data quality and product codes matter just as much as the AI model.
  • AI implementation requires testing and an internal pilot (Shadow Mode) to succeed.
CUSTOM VS. CLOUD NATIVE
2.4

Comparison between the Build and Managed approach

In business-to-business sales, the stakes of recommendations and upsell are not psychological impulse (as in the fashion industry), but the compatibility of supply with demand and the sales value. The challenge is managing a vast catalog, often supplemented with untested new products (Cold Start) and complying with strict business rules (e.g., do not recommend cheap products to premium customers).

We compare building your own models (in-house data science) with using pre-trained models, such as those in Vertex AI Search for commerce. How do we recommend a complementary product alongside a "24kW Heating Boiler" in the two approaches?

Build: Custom architecture (DIY / tech-agnostic)

This is the classic data science approach. You will develop a Deep Learning model (Gen 3). For simplicity's sake, we illustrate via Gen 2 a simplified collaborative filtering workflow with open-source technologies:

Data flow:
Gen 2 recommendation flow: from product batch processing to recommendation display

1. CUSTOMER EVENTS
(Order history, Data warehouse)
        │
        ▼
2. APACHE SPARK / PYTHON PANDAS
(Batch processing, e.g., nightly)
        │
        ▼
3. ALS MODEL / MATRIX FACTORIZATION
(Algorithm training: "Who bought X also bought Y")
        │
        ▼
4. REDIS / MEMCACHED
(Storing pre-calculated pairs.
E.g.: "product A" -> "recommend B, C, D")
        │
        ▼
5. API SERVER
        │
        ▼
6. DISPLAY in APPLICATION / E-COMMERCE

                
Fig. 2.3: Gen 2 recommendation flow: from product batch processing to recommendation display
In 2026, the standard is to use vector bases (e.g., Milvus, Qdrant, pgvector) and Deep Learning models (e.g. Transformers) for semantic understanding (Gen 3). For example, "yellow, utility, reflective uniform" will sit next to "ISO 20471" (the protective equipment standard), even if the words do not match.

The advantage is (usually) ownership of the developed code and the possibility of implementing any type of learning.

There are specialized time-series models that can be used in the cloud (e.g., Vertex AI Forecast), and many types of models in Google's Model Garden (open-source as Llama / Mistral or commercial such as Gemini). These can be connected to the data and the rest of the logic developed internally.

As for infrastructure, the Build approach requires provisioning and maintaining servers (e.g., Kubernetes), either in-house or in a cloud like Google Cloud (IaaS), for which you will pay for the infrastructure (IaaS - Infrastructure as a Service).

As for limitations, because matrix calculation is intensive, it is usually done once a day (batch). If a product suddenly becomes popular at 10:00 AM, special logic (which is achievable) is needed to update the recommendations before the next batch; otherwise, the algorithm will not adjust until the following day.

Effort and time estimate:
  • Team: Developer, data/ML engineer, DevOps engineer, business analyst
  • Model development: 2-3 months (with iterations required for accuracy).
  • Infrastructure (events, models, API): 1-2 months.
  • Total until launch: from 4-6 months.

Managed: Cloud Native Architecture (Google)

This is an approach where the AI model is fully managed externally. We use a service like Vertex AI Search for commerce, which includes Deep Learning models known in the market to be similar to Google Shopping or YouTube.

Data flow:
Full recommendation flow: from product batch processing to recommendation display in the Managed version

1. CUSTOMER EVENTS                   2. ERP / E-COMMERCE CATALOG
  (Click, add to cart,                 (Metadata: category, price,
   view, real-time)                     attributes, description)
            └─────────────────┬─────────────────┘
                              │
                              ▼
               3. VERTEX AI SEARCH FOR COMMERCE
                   (Google-managed engine)
       ┌───────────────────────────────────────────────┐
       │ • Deep & Cross Network (DCN)                  │
       │ • Business rules (explicit filters)           │
       │ • Optimization setting: CTR (click-through    │
       │   rate) or Revenue                            │
       └───────────────────────────────────────────────┘
                              │
                              ▼
                4. API SERVER/MINI-APP (WIDGET)
                              │
                              ▼
                5. DISPLAY IN APP / E-COMMERCE
            ("For customer X, now, show product Y")

                
Fig. 2.4: Full recommendation flow: from product batch processing to recommendation display in the Managed version

The advantage is the bundled resolution of the Cold Start problem and semantic comparison. If a new product appears in the ERP (e.g., "Boiler model 2026") with all its specifications, the algorithm indexes its attributes (e.g., power, brand, category) and even the image. It will recommend it to customers looking for similar products and, furthermore, Google algorithms are known in the market as being excellent for new customers without a history.

As for limitations, the product does not currently include some types of learning, such as time-series modeling for cadence or discounting logic. These require orchestrated implementation in the control middleware. A selected open-source model from Google Cloud's Model Garden can be used.

Secondly, you do not have access to the code of Managed models, but you can configure their objectives from the list available in the console (e.g., maximizing CTR or Revenue).

Effort and time estimate:
  • Team: Developer, Data Engineer, business analyst
  • Catalog synchronization (if data is clean): 2-3 weeks.
  • Infrastructure (events, API): 1-2 weeks.
  • Initial training: 1-2 weeks (automatic).
  • Total until launch: from 2-3 months.

Comparative table

Criterion Build: agnostic architecture (custom) Managed: Vertex AI Search for commerce (Cloud Native)

Adaptability

Medium. Requires re-training (batch) to learn new trends.

(Near) real-time. Learns within the session (upon click, recommendations change).

Technologies

In-house and open-source. E.g. TensorFlow/PyTorch, Vector Databases / Vector Search.

Pre-trained models by Google, with configurable objectives, accessible via API.

Infrastructure

Usually in the cloud (including Google Cloud) via technologies like Databricks, paid by consumption.

Google Cloud, paid mainly per business events (queries, predictions, training).

Context

Current session + history. Sequential models (e.g., Transformers).

API captures the session. Google excels at anonymous customers (without history).

Explainability (xAI)

Medium (low in real-time). Based on offline metrics.

Limited, via Conversational (for recommendations). Higher for search mode.

New data

Architecture required (Kafka/Spark) to inject recent clicks into the model.

Managed automatically after sending the event to the API.

New products (Cold Start)

Requires effort. Possible with the usage of a Feature Store.

Functional. Uses metadata, even images and model pre-training.

Learning types

Individual implementation. Any model can be developed.

Pre-defined models and objectives. Requires custom implementation for extra features.

Business rules

Requires custom code ("IF brand = X THEN…").

Partially configurable via the Visual console / JSON for Boost, Bury, Filter.

Critical dependency

The implementation team. Usually, you have access to the source code.

Mature technology, without access to source code. Specialized in product relevance.

Maintenance

Constant monitoring of models (for drift). You can do debugging.

Automatic tuning of models.

Do they allow chatbots/assistants?

Of course, see Guide #4

Building a recommendation system from scratch (the Build version) is an option for companies with a high volume of traffic and a need for code-level control.

Building with Vertex AI Search for commerce (the Managed version) is an option for fast implementation. Components that are not available, such as time-series forecasting, can be implemented custom.

In brief:

  • The Build version requires a mature ML team for development.
  • The Managed (Cloud Native) version allows a company to quickly use established but proprietary algorithms.
  • In both cases, additional programming or configuration is necessary to guarantee that the system respects commercial rules (e.g., stock, margin).
  • In practice, some companies use a hybrid approach, with different use cases and different components.
CASE STUDY
2.4.4

Hybrid model with "privacy-first" middleware

For companies with strict security requirements or on-prem ERP systems, we illustrate from OPTI Software projects what a centralized middleware for commercial truth looks like.

It can function in the cloud or on-prem and connects selectively to AI functions, whether managed by Google or custom via Model Garden.

Middleware as a single source of commercial truth, isolated for security

       INTERNAL DATA ZONE                    MIDDLEWARE ZONE             AI ZONE                        
 ┌─────────────────────────────┐     ┌─────────────────────────────┐     ┌─────────────────────────────┐
 │ 1. DATA SOURCES             │     │ 2. DATA HUB & SYNC          │     │ 3. Vertex AI (Search +      │
 │                             │     │                             │     │    Search for commerce,     │
 │ ┌───────────┐ ┌───────────┐ │     │ ┌─────────────────────────┐ │     │    Model Garden)            │
 │ │ ERP       │ │ FILE SRV  │ │     │ │ Fast database           │ │     │ ┌─────────────────────────┐ │
 │ │ (Master)  │ │ (PDF/Docs)│ │     │ │ (Cache)                 │ │     │ │ Vectors                 │ |
 │ └─────┬─────┘ └─────┬─────┘ │     │ └────────────┬────────────┘ │     │ │ Index                   │ |
 │       ▼             ▼       │     │              ▼              │     │ └────────────▲────────────┘ │
 │ [Secure unidirect. Sync]    │────>│ [Filtering & sanitization]  │     │              │              │
 └─────────────────────────────┘     │              │              │────>│ [Ingestion (public only)]   │
                                     │              ▼              │     │                             │
                                     │ ┌─────────────────────────┐ │     │ ┌─────────────────────────┐ │
                                     │ │ API Gateway             │ │<────│ | Gemini / LLM            | │
                                     │ │ (Combining AI + ERP)    │ │     │ | (RAG & Processing)      | │
                                     │ └────────────▲────────────┘ │     │ └─────────────────────────┘ │
                                     └──────────────┼──────────────┘     └─────────────────────────────┘
                                                    |                                                   
                                                    ▼                                                   
                                       ┌──────────────────────────┐                                     
                                       │ 4. Applications          │                                     
                                       │    (Quoting / Chatbot)   │                                     
                                       └──────────────────────────┘                                     

                
Fig. 2.5: Middleware as a single source of commercial truth, isolated for security
Concern Checklist

Intelligence

  • When a customer or agent searches or requests recommendations, the AI Zone returns the relevant product IDs.
  • The Middleware enriches the IDs with the correct price, actual stock, and verifies permissions.

Data minimization and separability

  • Sensitive data does not reach the AI zone, with the live system delivering it from the caching layer.
  • Prices can be completely lacking in the AI Zone, but AI re-ranking will then be based solely on pCVR (probability of conversion).

Security

  • Three distinct security perimeters.
  • The Middleware does not expose all ERP data.
  • The AI Zone does not have access to all middleware data.
  • The balance between on-prem / cloud remains the company's decision, according to its own security and compliance procedures.
Privacy in-transit / at-rest / PII in Google Cloud:
  • Google Cloud offers default in-transit encryption (TLS) during data transfer.
  • Google Cloud supports CMEK (Customer-Managed Encryption Keys) for at-rest data (stored). The company can hold the encryption keys for the index. Revoking the keys makes the encrypted data unusable.
  • The official instructions for Vertex AI Search for commerce require that the implementation must not send Personal Identifiable Information (PII). Thus, they require hybrid architecture.
See Guide #6 for security requirements in the AI world and compliance in the cloud

Comparative Architecture: Sales Quoting Software with AI from OPTI

Bonus
2.4.5

Visual configuration: Business user controls

In Vertex AI Search for commerce, integrating the API into the application and building deliverables requires programmers, but the sales strategy can be partially defined from the interface (low-code).

1. ServingConfigs: The rule builder

Want to clear winter stocks? For Vertex AI Search for commerce, there is a visual editor for business rules. It can be used by analysts or power users who know the data schema (fields) and the JSON format. You build a ServingConfig which may have:

  • Filter (Exclusion): Select "Exclude products without image" to protect the company image.
  • Boost (Promotion): Select the condition category = "winter" and move the slider to +50%. The products will appear higher in the recommendations.
  • Bury (Demotion): Select stock < 5 with Bury if you want to send low-stock products to the end of the list.
  • Can be scheduled in advance: You set them to be active only on March 10 or Black Friday.
  • Can be tested or simulated: The Evaluate screen allows you to test the effect based on some parameters (user, time, products) without public activation.

Be careful with control logic to avoid inefficient or contradictory configurations. For example:
When products in cat. X have actual stock < 5, a Boost X rule plus a Bury stock < 5 rule results in zero effect.

2. Pinning: Manually defined campaigns

Sometimes, a specific product (e.g., a new model launched by the supplier) must mandatory be the first one recommended, regardless of the AI. In the dashboard, you can create a Pinning control.

  • Search for the product by name in the console and pin it to position 1 in the Recommended widget.
  • AI will complete the rest of the list (e.g., positions 2-10).

3. A/B Testing in a few clicks

To compare whether the "Others You May Like" model sells better than "Frequently Bought Together," there is no need to modify the company's application.

  • Create an experiment in the dashboard.
  • Select "Model A" vs "Model B".
  • Google splits the traffic automatically and will generate comparative charts (e.g., Revenue Uplift).
  • You can click "Apply Winner" to move the winner into production.
Low-code/no-code control flow:


Low-code control flow in the Managed approach (Vertex AI Search for commerce)

BUSINESS ANALYST               VERTEX AI DASHBOARD (UI)                E-COMMERCE (live)

┌─────────────────────────┐       ┌───────────────────────────┐       ┌───────────────────────────┐
│ Strategy:               │       │ 1. ServingConfig          │       │ "Recommended" Widget      │
│ "I want to push         │ ─────>│    [ Add Rule ]           │ ─────>│                           │
│  MAN trucks to          │       │ 2. Condition:             │       │ 1. MAN TGX 480            │
│  the front."            │       │    Brand == "MAN"         │       │    (promoted)             │
└─────────────────────────┘       │ 3. Action:                │       │ 2. Other products         │
                                  │    Boost score 0.5        │       │    (standard)             │
                                  └───────────────────────────┘       └───────────────────────────┘

                
Fig. 2.6: Low-code control flow in the Managed approach (Vertex AI Search for commerce)

For a commercial department with a technical analyst, display rules can be controlled from dashboards using visual controls. Training and communication with the technical team are essential to avoid misconfigurations, as the risks are considerable.

BUSINESS CHALLENGES
2.5

Business rules (guardrails) and the data contract

Implementing AI is the first step. The systems that actually sell in B2B are defined by control. Deterministic business rules tame probabilistic AI algorithms.

CONTROLLED AI
2.5.1

Guardrails: Business rules and post-processing

We do not want to sell below the minimum margin, recommend impossible / incompatible products, or leave the customer or sales agent without a suggestion when the AI integration fails.

The hybrid approach does not just mean AI + Cloud, but also predictive or agentic AI (Gen 3-4) controlled by explicit rules as in Gen 1. The purpose of using company data is to control the AI output. Guardrails are the safety net of the business.

1. Business Protection

Rules are invisible to the customer, but critical for the finance or marketing department:

What do we protect?

  • Commercial margin: Do not recommend products with a markup below X%, even if they are popular.
  • Liquidity: Prioritize products in available stock (Slow-moving) or prioritize a warehouse close to the customer to free up working capital. If the requested product has 0 stock, guardrails allow the automatic activation of the Smart Substitutes deliverable from Ch. 3, displaying a valid technical alternative (according to the specification sheet).
  • Positioning: If you are a premium brand, you will not recommend entry-level (too cheap) products, to avoid diluting the cart value.
  • Relationship protection: If the customer is B2B, remove products from the "Hobby/DIY" range from recommendations, even if they are generally popular.

Especially for upsell in B2B, rules are essential to avoid violating the contract, which may provide, for example, for only certain approved manufacturers.

Additionally, AI models can learn incorrect correlations, leading to repetitive or absurd recommendations. A high-volume customer who bought a fleet of Apple laptops should not be recommended Asus bags and accessories.

The solution is metadata-based exclusion rules that encode human expertise.

Example: If the first 3 products are from the same brand and subcategory, force the insertion of a product from another brand at position 4.

2. Fallback: Experience continuity

What happens if the API has latency, if the customer is new (no history), or if there is no reliable recommendation for an obscure product (e.g., score > 0.5 derived in the Build approach)?

The hybrid architecture ensures continuity:

  • Define a fallback (e.g., best-sellers / category).
  • When the AI system returns no results or when they lack high confidence (in this case, the Managed variant usually includes automatic fallback), you can display "Best-selling products" based on a classic SQL database query.
  • There will be no empty space in the interface.

3. Expert systems: Humans can know better

While AI is powerful, it can know too little (underfitting) about the complete commercial context. A manager can override AI recommendations.

Forcing campaigns:

For new campaigns where no relevant contextual data exists, promotion periods (e.g., Boost) can be defined with forced priority.

Example: The company will launch a 12.12% discount on a new category tomorrow (e.g., December 12), but the AI won't know to promote that category if it doesn't have the business priority of the campaign in its context.

Seasonality:

The human calendar differs from pure statistics, for example:

  • January (start of budgets): Prioritize high-value equipment considered investments.
  • October (end of season in construction): Prioritize clearing stocks of seasonal or perishable materials.

Example: "Is it the agricultural season? Apply a boost (promotion) to spare parts for combine harvesters."

Technical compatibility rules (domain-specific):

In technical B2B, compatibility is binary: it works or it doesn't. Expert systems are used, defined on details from the specification sheet.

Example: Check the Socket attribute of the processor in the cart. Eliminate (filter out) any motherboard from the recommendation list that does not match according to the attribute.

See how to build a BOM (Bill of Materials) with generative AI and graphs

Technically, guardrails are classified as hard (filters and eliminations), soft (promotions and demotions in list order), and process (necessary for control and audit. E.g.: "request permission for excessively large discount" / "Log the application of the rule").

AVOIDING GIGO
2.5.2

The data contract

The "Garbage In, Garbage Out" principle states that without correct fresh data, AI recommendations will also yield wrong results. Additionally, any change in the fundamental source of company truth (e.g., ERP update, tax rate changes, or modification of a crucial category) can break integrations.

The solution is defining a Data Contract between the team managing the source of truth (ERP, CRM, e-commerce) and the team managing the AI integration.

1. Data preparation: from chaos to clarity

Imagine explaining to someone for the first time what you have in the company, without abbreviations, without procedural shortcuts that appeared over time, and without rushing. When you've finished the explanation, you're ready for AI.

These procedures maximize the operational clarity of the company and minimize the accumulated technical debt from the past.

Step What does it mean?
Deduplication

unifying similar data

There are still ERPs where the same physical product exists under multiple codes (e.g., supplier X's old code and supplier Y's new code). If the sales history is split between two codes, AI will poorly recommend two products instead of recommending one more strongly.

Solution: All variants are deduplicated to a single unique Master SKU (canonical ID), and the merged data is sent to the model as if it were a single product.

Normalization

cleaning attributes

Standardizing units of measurement and values. This is achieved by replacing semantically identical values with a common key in a dictionary.

Solution: "1/2 inch", "0.5 in", "1/2'' ", and "12.7 mm" (also "1.27 cm" or "0.127 m") must be normalized: transformed into a single standard value (e.g., length_mm: 12.7). Colors "green", "verd", "green", and "vert" become Color_id: 23.

Denormalization

speed for semantic search

Databases behind ERPs, if correctly normalized, will contain separate tables linked by IDs. The color green became Color_id: 23. But AI needs fast reading and semantic understanding; it actually understands "green" like a human speaker.

Solution: For AI reading, data is denormalized. Each object becomes flat with many text attributes: category name, brand name, and every specification. The goal is to be as close to natural language as possible (sometimes in multiple variants).

See the OPTI Software methodology in Ch. 5.3.2

2. Data schema: the structure

For the integration to "understand" the data source, three levels are defined. The Entities that will synchronize, how their data fields must look, and what the consequences for the integration are when the contract is violated.

Entity Verification (examples) Consequences (examples)

Product

Price is float type (100.12), not text ("100.12 USD"), not empty.

Last synchronized data remains unchanged.

Product

Product_id is not empty and is unique.

Alert via email/Slack, especially when data is missing.

Customer

Tax ID/EIN can be preceded by an ISO 3166-1 alpha-2 code (e.g., GB).

A cloud service can be called to confirm the code's validity.

...

...

...

3. Data semantics: the meaning

The AI application developers must understand what the data in the source systems means to keep the behavior of the entire system identical, especially toward the final customer.

Pay attention to everything related to the following:

Pay attention to Verification (examples) Consequences (examples)

Catalog

This long "old description" field is qualitative; what is it used for?

Use only validated data.

Prices

With tax or without tax?

Display only secure prices.

Prices

Are Purchase Orders with -1 quantity returns or discounts?

Do not treat returns as a signal for the model.

Stocks

Physical or available (-reserved)?

Ignore out-of-stock products.

Workflows

Are there associations: prices per customer per department?

Modify AI query logic based on associations.

...

...

...

The meaning of each field matters for the Build version, to avoid training a model on irrelevant correlations. It also matters in the Managed version, as with any SaaS integration.

ERP-CRM SaaS integration example

A company could not fill in more than one email address per B2B customer in the ERP, so in practice, it used the "description" field to hold the customer representatives' addresses. Upon integration with a CRM (HubSpot / Pipedrive / Zoho) where representatives were distinct entities, the script had to map the "description" text field from the ERP to multiple entities in the CRM and maintain synchronization.

4. Data SLA: latency and race conditions

Conditions are defined such as "Stock changes must reach the AI within a maximum of 5 minutes," "When the ERP is not working, the latest data is used, but no more discounts are given" to ensure system consistency and predictability.

Race conditions

Synchronizing changes between systems in a timely manner. If a customer buys the last product at 14:00, and the system recommends it at 14:05 to another customer, the data contract has been violated.

Solution: Immediate (just-in-time) checks in the middleware or frontend:

  • AI selects the product based on data (e.g., 10-15 minutes old).
  • The system requests a confirmation in the ERP or in a fast cache layer.
  • If no response is received, the fallback mechanism kicks in.

Case Study: Building a micropayment platform for Playwing

5. Checklist: Data required for an AI implementation in sales

Data type Check

Catalog

SKU, categories, attributes and compatibility rules, brand, status, list price.

Inventory

Stock and management, stock reservations, turnover, batches and stock age.

B2B Prices

Price lists, discounts, validity terms.

Customers

Segments, restrictions, benefits.

Sales and events

Minimum order / product, Sales channels, offers, orders, supplier orders, lines for each, feedback, clicks, and additions to cart (e-commerce only).

Sources of truth

ERP, CRM, e-commerce, files, company procedures.

The data contract establishes the schema, semantics, data preparation, and SLA for the company data affected by the AI implementation.

In brief:

  • The recommendation system is not a single algorithm, but an ensemble of models and business rules for every moment of the sales process.
  • Careful programming or configuration and testing processes are essential.
  • Implementation begins with understanding the commercial strategy and company data.
See the OPTI Software data methodology in Ch. 5.3.2

See code and configuration examples for guardrails and data ingestion in Ch. 4, for Build and Managed.

TECHNICAL CHALLENGES
2.6

Fine-tuning

Here are two technical fine-tuning challenges encountered in real AI implementation for sales.

Choosing the right model for the business function

The most popular models work differently and must be adapted to the specific moment in the customer journey:

  Model Recommendation

1

Frequently Bought Together

Ideal in e-commerce for the cart page. Based on historical cart analysis. Helps discover complementary products for cross-selling.

2

Similar Items / Others You May Like

Ideal in e-commerce for the product page (based on similarity to the current product). Takes the customer into account (in the Others You May Like variant), estimating what other product can be bought. Helps discover alternatives for upselling.

3

Recommended for You

Ideal in e-commerce for homepages and listings (e.g., newsletter, category). Based on customer history.

4

Buy it Again

Indicates the product most likely to be restocked based on previous purchases.

For predicting restocking needs in B2B, time-series modeling (custom model) is required.

See the Smart Replenishment deliverable in Ch. 3.3.5

In the Build (custom) approach, these models are defined and trained separately, with the reuse of some common components.

In the Managed (Cloud Native) approach, you start by configuring predefined models by Google for the popular cases above. You get faster delivery and the ability to choose the maximized business goal, without being able to modify the base model.

Bundling and dynamic packages

In B2B, grouping products increases order value (AOV). Additionally, bundling reduces logistics costs.

  • If the customer buys the whole system in a single order, the distributor sends a single pallet, a single invoice, and performs a single shipment.
  • Instead of 3 orders of 300 USD each with 3 shipments, you get a 900 USD package in a single delivery, with a discount but a better total margin.

To implement packages, we need data engineering or a hybrid approach.

1. Smart purchase discount (standard)

Why? A smart discount is offered for buying together (e-commerce or offline). In distribution, value lies in complete solutions, not disparate products.

How?

  • The recommendation system suggests multiple products usually bought together and similar to the main product.
  • In the Managed variant you can use Collections: the application pre-classifies the acceptable packages and then bundle IDs are assigned to each product therein. The service will aggregate the relevance of the products sharing a bundle, without 100% guarantee.
  • Rules then filter the combinations which form a compatible functional system (e.g., Boiler + thermostat + Exhaust kit), based on the technical sheets.
  • A discount is added and the result is the Dynamic Bundling deliverable from Ch. 3, increasing AOV without human effort.

2. Bundles directly in the catalog

Why? Bundles with their own primary ID are automatically created to increase stock rotation and profitability.

How?

  • The recommendation system identifies high-appeal products. Slow-moving products are also identified, often among those recommended by AI.
  • A virtual bundle is created in the application logic with stock calculated as the lowest ratio of stock / pieces used in the bundle and with verification of the minimum accepted margin per bundle.
  • An automation flow is defined to introduce them into the catalog, search, product page, and send them to affiliates (e.g., marketplaces), increasing the number of products and diversity for the customer.
  • Then, virtual bundles can be sent as normal (primary) products to AI.

The first variant involves modifying the shopping cart and the ordering module. The second variant involves deep integration with automated commercial flows.

In addition to these challenges, there are others related to scalability, latency, security, and monitoring, depending on the complexity of the company's workflows. But AI technology for B2B sales exists, as shown in this chapter.

The bottom line:

In 2026, the best sales agent is not AI, but humans assisted by AI. We have analyzed the technological engines for AI sales: vector search, re-ranking, guardrails, and the data contract. Companies that clean their data and define their commercial rules will be the ones that benefit from AI in sales, both in the Build (custom) and Managed (Cloud Native) versions, at the company's choice.

Which concrete applications can be used by sales agents?

See ten individual deliverables in Ch. 3

Not sure what architecture fits your company? OPTI Software offers a free technical audit.

Continue Exploring

Chapter 1
Why AI?
The problem: "The ERP is not a sales engine". `Brownfield` context and the retirement cliff crisis.
Read the Business Case
Chapter 3
What can be built?
Deliverables built for B2B sales.
Agent copilots
Smart bundles
Substitutes
Re-order
See all Deliverables
Chapter 4
Cookbook (Code)
Project implementation steps. Python and SQL snippets, configurations for Google Vertex AI Search for commerce.
See the Code
Chapter 5
When and with what resources?
Team structure, required resources, budget, and Google Cloud assurances. Plus: our methodology.
See the Cost Structure
AI News
Future: Agentic AI
UCP launch in Jan 2026, new AI technologies maturing, and how companies can adapt.
See AI Updates
Resources
Resources & Glossary
Glossary (AI, business, software) + bibliography, whitepapers, and useful links from the guide.
See Resources
Gallery
Choose an AI topic
Explore role-based resources (CEO, Business, etc.) in a thematic gallery
Choose Role & Topic

Quick Questions

What is the two-step architecture (retrieval and ranking)?

It is an approach where the system first identifies a small set of candidate products (retrieval), then finely orders them using AI scores and business rules (ranking). This is the foundation of most modern, scalable recommendation systems.

Why is the two-tower architecture commonly used for retrieval?

Because it separates customer representation from product representation, enabling fast similarity search at scale. It is efficient for initial candidate selection, even if final ranking uses more complex models.

What role do guardrails play in the architecture?

Guardrails are the rules that turn an AI score into a valid commercial decision: minimum margin, stock availability, contracts, and permissions. Without them, recommendations can become risky.

What does a data contract mean in this context?

An explicit agreement on the meaning, format, and source of every data field used. It is the foundation that makes the system auditable, explainable, and sustainable.

When does a hybrid Build + Managed architecture make sense?

When you want to benefit from pre-trained models for speed, while retaining control over sensitive data, commercial logic, and company-specific rules. Choose hybrid AI construction (pre-trained + custom models) when you want features not included in available pre-trained models.

What is the TLDR (conclusion)?

This chapter turns a complex problem into a logical blueprint: candidate retrieval, ranking, and rule enforcement so you don’t make incorrect sales (violating stock, contract price, margin, or permissions)

What technologies and methodologies are involved?

Technologies: Vertex AI Search, Vertex AI Search for commerce, Vertex AI Recommendations, Retail API, BigQuery, BigQuery ML, Feature Store, Cloud Storage, Pub/Sub, Dataflow, Cloud Run, Cloud IAM, Cloud KMS
Methodologies: two-stage recsys, learning-to-rank, candidate generation, post-processing, hard rules vs soft boosts, just-in-time validation, data quality checks, offline evaluation (Recall/NDCG), segmentation (account-level), privacy by design

Sign up for the complete PDF manual

The reference manual will also be available in a complete PDF version. You will receive the PDF via email 48 hours before the official launch (aprox. 19th of March 2026). OPTI Software sends exclusive Tech & Biz news once a month.

Interesat?

Interested?

Schedule a meeting

Get a Free Audit

News and Guides

More News