← Writing
System Design· 11 min read

AI-Enabled E-Commerce Solutions on OCI

A comprehensive guide to building a production-grade AI e-commerce platform on Oracle Cloud. The architecture's heart is a shared data spine — a product graph and customer 360 kept fresh by change-data-capture — that every AI capability reads from. From discovery (search, recommendations) through conversion (shopping assistant, personalization) to operations (demand forecasting, dynamic pricing, fraud), every capability plugs into the same spine, with the evaluation, logging, and cost model that separate a demo from a production system.

"AI e-commerce" is the phrase that makes architects wary, because the version most teams build is a chatbot bolted onto a catalog. That is not an architecture; it is a feature, and it inherits every limitation of the catalog it sits on. The production version is a different problem. It is a system in which several AI capabilities — search, recommendation, a shopping assistant, demand forecasting, dynamic pricing, fraud detection — all read the same source of truth about products and customers, and the hard part is keeping that truth fresh, consistent, and low-latency while a dozen things consume it.

This guide builds that system. Its spine is a shared data layer; its limbs are the AI capabilities that hang off the spine along the customer journey and across the operations floor. The order of presentation is deliberate: the data spine first, because every capability after it is only as good as the data it reads.

Step 0 — Reframe the problem: the model is not the hard part

Before a single box on the whiteboard, restate what "AI e-commerce" actually requires, because the default framing ("add GenAI") leads to the wrong system.

The model is rarely the bottleneck. The bottleneck is that a recommendation model needs real-time inventory and price; a search index needs product attributes the instant they change; a shopping assistant must not quote a price that was correct an hour ago. The shared, fresh, consistent data layer — call it the spine — is what makes all of that possible. The AI capabilities are leaves. Build the spine first, and the leaves become mostly integration work.

The most common failure of an "AI e-commerce" project is not a bad model. It is a stale price returned by an assistant that read a six-hour-old copy of the catalog. That is a data-spine failure dressed up as an AI failure.

Step 1 — The data spine: the heart of the system

The spine has three parts: the authoritative stores, the freshness mechanism, and the derived read-optimised layers that each capability consumes.

Authoritative stores. The product catalog, orders/inventory, and a customer 360 — the system of record — live in Autonomous Database (Oracle Database 23ai). These are where writes happen and where truth lives.

The freshness mechanism. OCI GoldenGate does log-based change data capture (CDC): every insert, update, or delete in an authoritative store is streamed out in near real time. This is what defeats the "stale price" failure — downstream layers see changes within sub-seconds, not on an hourly batch.

Derived layers. The same changes fan out, in parallel, to read-optimised stores that each capability prefers:

  • OCI Streaming (Kafka-compatible) for real-time events (view, cart, purchase).
  • OCI Search with OpenSearch for the search index and product vectors.
  • A feature store in OCI Data Science for the engineered features a recommendation or forecasting model needs.
  • Autonomous Data Warehouse for the analytics and reporting store.

The spine's invariant: the authoritative stores own truth; everything else is a cache derived from them via GoldenGate, and every derived layer knows how to refresh itself. Build this, and the capabilities below become bounded, independent consumers rather than a tangled web of point-to-point integrations.

Step 2 — The AI capabilities, along the journey and across the floor

With the spine in place, the AI capabilities are leaves that plug into it. The cleanest mental model is two groups: customer-facing capabilities along the journey (discovery → conversion), and operations capabilities that run the business behind the scenes. One architectural distinction runs through all of them, and it is the single most common mistake in this kind of article — so state it up front:

OCI Generative AI is for LLM features; OCI Data Science Model Deployment is for custom predictive ML. A shopping assistant, product-description generation, and embeddings belong on Generative AI. A recommendation engine, a demand-forecasting model, and a dynamic-pricing model are custom ML and belong on Data Science Model Deployment. Conflating them is how teams put an XGBoost model on a GenAI cluster and wonder why it does not fit.

Customer journey — discovery

AI search. Semantic product search over the catalog — "summer dress for a beach wedding" matches by meaning, not keyword. The product vectors live in OpenSearch (or, at smaller scale, Autonomous DB 23ai's native AI Vector Search, which offers both HNSW and IVN indexes — and a hybrid full-text + semantic index since 23.6). The embedding comes from OCI Generative AI's managed embedding service. This is the same building block as a standalone image-search system, so if you have already built that, discovery search reuses it.

Recommendations. "Customers also bought," "similar items," personalized ranking. These are custom ML — collaborative filtering, two-tower models, rankers — hosted on OCI Data Science Model Deployment as real-time, auto-scaled endpoints, reading real-time features from the spine's feature store and stream.

Customer journey — conversion

Shopping assistant (RAG over the catalog). A conversational agent that answers product questions, compares items, and recommends — grounded in the live catalog so it never hallucinates a product that does not exist or a price that has changed. This is a RAG application: OCI Generative AI for the LLM and embedding, retrieving from the product vectors in the spine.

The assistant's grounding step reads the live catalog rows for any concrete fact (price, availability, specs) — vectors get you the candidate, the authoritative store confirms it. This is the spine's payoff: the assistant is never more stale than GoldenGate's sub-second lag.

Personalization. Ranking, sequencing, and offers tailored to the individual, driven by the recommendation models and the customer 360 in the spine.

Operations — running the business

These are batch or near-real-time, and they read the spine's analytics and feature layers.

Demand forecasting. Time-series models (trained in Data Science, run as batch on OCI Data Flow serverless Spark, or as scheduled notebook jobs) project demand per SKU and region from the orders history — feeding replenishment and the pricing model below.

Dynamic pricing. A custom pricing model (Data Science Model Deployment) reads the forecast, current inventory, and competitor signals, and outputs a price. Inventory and price write back through the authoritative store, and GoldenGate propagates them — so the shopping assistant and search index see the new price automatically, with no extra plumbing.

Fraud detection. Real-time scoring of transactions against a custom model (Data Science) and rules engine, consuming the live event stream from OCI Streaming to catch anomalies at the moment of checkout.

Generative content at scale. Product descriptions, ad copy, lifestyle imagery — generated by OCI Generative AI, often as a batch pipeline (Data Flow) that writes the new copy back to the catalog, where the spine fans it out.

Step 3 — How it all fits together

With the capabilities defined, the whole system looks like this — the spine at the center, customer-facing capabilities on top, operations capabilities below, and the cross-cutting concerns wrapping everything.

The discipline this diagram enforces: nothing reads the catalog directly except the spine; every capability reads the spine. That single rule is what keeps the system maintainable as capabilities multiply. Add a new AI feature tomorrow and it plugs into the same derived layers — you do not reopen the authoritative stores or build a new pipeline.

Step 4 — The cross-cutting concerns that make it production

Three concerns wrap the whole system. They are the same three that travel across every system in this series — stated here in the e-commerce register.

Evaluation, per capability. Search has a golden query→relevant-products set; the recommendation model has held-out purchase data; the assistant has a set of known-good grounded answers. Run each as a regression gate before any deploy, and track recall/precision/groundedness over time. The single most common deterioration in an e-commerce AI system is silent: a recommendation model whose performance decays as the catalog turns over. The eval harness is how you see it before customers do.

Logging and observability. The native OCI stack — Logging, Logging Analytics, Monitoring, APM, VCN Flow Logs — with one discipline on top: log every capability's decision with enough context to debug and to bill. For an assistant interaction that means the query, the retrieved products, the grounded answer, and the model + index versions. That record is your debugging trail, your usage meter, and — mined over time — your next batch of evaluation cases.

Cost and usage. Track usage by aggregating the decision logs; track cost with OCI Cost Analysis and Budgets, tagging every resource (env, capability, tier). Order-of-magnitude monthly cost, highly variable by scale and discounting — verify in the OCI Pricing Calculator:

Cost driverTypical range
Autonomous DB + Data Warehouse (the spine's stores)~$1k–5k
GoldenGate (CDC)~$0.5k–2k
OpenSearch cluster (search + vectors)~$1k–4k
Data Science Model Deployment (recs, pricing, fraud)~$1k–6k
OCI Generative AI (assistant, embeddings, content)usage-based; grows with traffic
Data Flow (forecasting, content batch)pay-per-use
Rough monthly total (mid-scale)~$5k–20k+

The dominant cost lever is usually Generative AI usage (tokens) and the always-on Data Science endpoints. The cost discipline that pays off most: cache aggressively at the capability boundary (hot search results, hot recommendations) so the models are called only when the cache misses.

Step 5 — Scaling the spine: when to grow up

The system is built for mid-scale. Two triggers tell you to grow:

  • When the spine's derived layers cannot keep up. OpenSearch shards under load, the feature store's refresh lag grows, or Autonomous DB's vector index build time climbs. The remedy is not a new architecture — it is sharding the derived layers and, eventually, splitting the spine across regions connected by a DRG, with GoldenGate replicating between them.
  • When a capability outgrows its tier. A recommendation model that needs GPUs moves from a Data Science CPU endpoint to a GPU one; a search workload that outgrows Autonomous DB's vectors moves wholesale to OpenSearch. The spine absorbs these changes because the capabilities are leaves, not the trunk.

Notice what does not change when you scale: the spine's invariant. Authoritative stores own truth; derived layers cache and refresh; capabilities read the spine. You shard the layers and add regions, but the contract holds. That is the point of building the spine first — it is the part of the architecture that survives growth.

Building it

The temptation in an "AI e-commerce" project is to start with the most exciting leaf — the shopping assistant, the recommendation model — and treat data as a later concern. Resist it. Build the data spine first: the authoritative stores, the GoldenGate freshness, and one or two derived layers. Prove that a price change in the catalog appears in the search index within seconds. Then hang capabilities off it, in journey order: search and recommendations, then the assistant, then the operations models. Each one is a bounded project that plugs into an already-fresh spine.

The system you end up with is not "a chatbot on a catalog." It is an architecture in which AI capabilities are cheap to add precisely because the hard problem — a shared, fresh, consistent view of products and customers — was solved once, at the center, before any leaf was built.