Key takeaways
- Four changes cut an AI stylist’s live median response from 30.1 s to 15.5 s.
- A fashion-tuned embedding beat CLIP at visual search, 63.3% against 38.3% top-five hit rate on 60 cases.
- Classify refusals before retries. A refused try-on went from about 110 to 115 s to about 20 s.
- A job that re-classified finished work spent about $1,100 on 419,057 vision calls without raising an error.
- Settle payments scope, Core Web Vitals, product markup, accessibility and consent before adding AI features.
On a fashion commerce platform we build and run, what mattered most for AI in ecommerce was testing features on real shopper inputs and handling the ways model calls go slow, fail or run up a bill. Four changes cut the AI stylist’s median response on live traffic from 30.1 s to 15.5 s. A fashion-tuned image embedding put the right product in the top five for 63.3% of 60 real test cases, where CLIP managed 38.3%.
A refused virtual try-on used to take about 110 to 115 s to fail, and now fails in about 20 s. A background job spent about $1,100 on 419,057 vision calls it didn’t need, and raised no errors. Underneath, the storefront serves cached HTML in about 70 ms.
This post pulls the five field notes into one account of AI ecommerce development, linking each deep dive. It also covers the commerce foundation every store has to settle early, what AI shopping agents ask of a store, and a kickoff checklist.
Five field notes, their numbers and how each was measured
All figures are from this platform.
| Area | Number | How it was measured | Not shown |
|---|---|---|---|
| AI stylist | Median 30.1 s to 15.5 s, p90 40.3 s to 20.6 s | Real turns before tuning, against four days of live traffic | Each change’s share, time to first token, cost |
| Visual search | Top-five hit rate of 63.3% for FashionSigLIP, 38.3% for CLIP | The same 60 real cases for each model | Other catalogues, latency and cost per search |
| AI images | Refused try-on from about 110 to 115 s to about 20 s | Approximate wall-clock times of single requests | Percentiles under load |
| LLM spend | 419,057 needless vision calls, about $1,100 | Exact call count, rounded spend | Cost per call beyond the average |
| Site speed | Cached HTML in about 70 ms, mobile lab LCP from 14.1 s to 3.8 s | Mobile PageSpeed Insights before and after, and cache hits | Run-to-run spread, data from real visitors |
The store foundation to settle before the AI features
Any ecommerce app development project has to settle five things early, whatever AI comes later.
| Area | Settle early | Rule or threshold |
|---|---|---|
| Payments | Card entry in the provider’s hosted fields or page | SAQ A eligibility, revised from 31 March 2025 |
| Speed | A performance budget checked on every release | At p75, LCP 2.5 s or less, INP 200 ms or less, CLS 0.1 or less |
| Product data | Product and Offer markup on every product page | Merchant listings need a name, image, currency and a price above zero |
| Accessibility | WCAG AA in components and tests | EAA applies to EU e-commerce services from 28 June 2025 |
| Consent | A reject option beside accept, and tags that wait for an answer | EDPB cookie banner taskforce, January 2023 |
Our standard build includes a global CDN with an enforced performance budget, technical SEO, WCAG AA accessibility and a consent banner.
Payments. Keep card numbers off your servers, so that PCI DSS scope stays small. SAQ A is the self-assessment questionnaire for merchants that have outsourced all account data functions to PCI DSS validated and compliant third parties.1 That means the provider’s fields in an iframe, or a redirect to its payment page. The revised SAQ A, in force since 31 March 2025, dropped the payment page script requirements 6.4.3 and 11.6.1. It added a criterion that the merchant confirm its site is not susceptible to script attacks that could affect its e-commerce systems.1 FAQ 1588 says it applies to pages that embed the provider’s form and not to redirects. A merchant can meet it with techniques like those in 6.4.3 and 11.6.1, or with the provider’s confirmation that its solution protects the payment page. Your acquirer or the card brands confirm which questionnaire applies.2
Speed. Agree a performance budget before the first feature ships, and fail any release that breaks it. At the 75th percentile of page loads, split by mobile and desktop, a good page has LCP within 2.5 s, INP of 200 ms or less and CLS of 0.1 or less.3 INP replaced First Input Delay as a Core Web Vital on 12 March 2024.4 In a study Google commissioned from Deloitte, a 0.1 s gain in mobile site speed went with 8.4% more retail conversions and 9.2% higher average order value.5
Product data. Google treats product pages where people can buy as merchant listings. Each needs a Product with a name and an image, and an Offer with a price above zero and a currency.6 Shopping agents read the same data, so generate the markup and the feeds from one product source.
Accessibility. The European Accessibility Act has applied to e-commerce services in the EU since 28 June 2025.7 The EU’s Your Europe portal lists online shops among the services covered, and exempts service businesses with fewer than 10 employees and under €2 million in turnover.8 Check the national law in each country you sell to.
Consent. In the EU, cookies that need consent can’t be set until the visitor gives it through a positive action. A vast majority of authorities in the EDPB’s cookie banner taskforce considered it an infringement when the layer with the accept button offers no way to reject. The report also says pre-ticked boxes don’t give valid consent, and that withdrawing consent must be as easy as giving it.9
Halving the AI stylist’s response time
The stylist streams its answers to shoppers and can act for them, for example by placing an order. Each reply runs a chain of model calls that classify the request, compose the answer, validate it and critique it, over hybrid keyword and vector retrieval. The calls run in sequence, so their times add up, and every generated token costs time.
We switched reasoning off for the compose step, and added hedged requests, which send a duplicate call when the first runs long. We moved the calls from Azure OpenAI to OpenAI’s API after seeing a slow tail on Azure. We also let retrieval return once it had enough results. Over four days of live traffic, the median fell from 30.1 s to 15.5 s, and the p90 from 40.3 s to 20.6 s. Alongside the latency work, the regression suite went from 18 of 47 passing to 47 of 47.
Hedging stopped paying once the tail shrank. In a later sample it fired 142 times, and only 4 of those duplicates came back first. A duplicate carries the same work as the original, so it only wins when the original was held up on the serving side, which the other changes had reduced. The algebra is in How we halved an AI stylist’s latency, and when hedging stops paying.
Visual search for ecommerce starts with the embedding
A shopper uploads an outfit photo, or a frame from a video, and gets back products that match. The pipeline finds the person, describes the garments in one Gemini call, boxes each garment with GroundingDINO through a hosted detection API and cuts it out with SAM 2. Each cutout is embedded and searched in a managed vector database, and a capped re-rank orders the candidates. A whole-frame vector would blend garments, person and background.
| Model | Top-1 hit rate | Top-5 hit rate |
|---|---|---|
| Marqo-FashionSigLIP | 41.7% | 63.3% |
| CLIP | 23.3% | 38.3% |
| DINOv2 | 11.7% | 23.3% |
FashionSigLIP led, and the platform uses it. With 60 cases, each hit rate’s 95% interval spans up to about 12 points either side. At that precision the test separates FashionSigLIP from CLIP, and can’t separate CLIP from DINOv2. DINOv2 keeps one job, spotting exact duplicates of catalogue images. The method is in Comparing FashionSigLIP, CLIP and DINOv2 for visual product search.
AI product images that fail quietly
Try-on renders a garment onto a photo of a person with Gemini image generation. In the first version, the parser dropped the reason for a safety refusal, so the retry loop treated it like a timeout and spent five retries. The shopper saw an error after about 110 to 115 s, and the failure was cached with no expiry. A refusal is now final on the first attempt, so a refused try-on fails in about 20 s, and a cached failure lapses after 30 minutes.
Background-removal cutouts also lost their alpha channel when saved, and one image came out 92.7% black. Compositing onto a chosen background before any step can drop alpha prevents it. For second-hand items photographed by their sellers, the platform regenerates a studio-style shot with Gemini. Early outputs sometimes rotated the item or recoloured its metal hardware, and lowering the temperature to 0.2 fixed both.
Retry rules and alpha traps are in How AI image pipelines fail quietly, and how to catch it. Generated images shown to shoppers can also carry marking duties, covered in our post on AI content marking rules.
Spend guardrails for LLM batch jobs
A background job sent items that already had a classification back to a vision model. Its lookback window came from a variable named for two days that held 730. The job made 419,057 calls it didn’t need, for about $1,100, roughly $0.0026 each. No call failed, so the only signal was the bill.
Rate limits cap throughput, and the field note shows budget alerts lagging behind spending, so provider controls catch a job like this late. The guardrails it recommends act sooner.
- Select only items that the current model and prompt version haven’t processed yet.
- Estimate a run’s cost before the first paid call, and stop above a threshold unless a person approves.
- Put the unit in every duration’s name, and give the lookback an upper bound.
- Write a ledger row for every paid call, and enforce a daily budget per job in code.
The code is in How a backfill bug ran up a $1,100 LLM vision bill.
Ecommerce site speed from caching HTML by device
The storefront is a Next.js app that renders each page on the server, with different HTML for phones and desktops. Before the change, every request waited for a full render. We now cache that HTML at Cloudflare’s edge, with the device type in the cache key, so phones and desktops get separate copies. Cache hits return the HTML in about 70 ms. On mobile, the PageSpeed score went from 65 to 87, and LCP in the lab came down from 14.1 s to 3.8 s, still above the 2.5 s that counts as good.
Anything that differs per visitor, such as account, cart and checkout pages, has to bypass the cache, through rules ordered after the caching rule. Each deploy needs a purge. The rules, purging per device type and a stale-while-revalidate trap are in Caching server-rendered Next.js HTML at the edge, by device type.
What agentic commerce asks of a store
AI shopping agents search, compare and buy for a person, reaching a store through protocols that connect them to its catalogue, checkout and payment provider. Three are worth tracking.
| Protocol | Backed by | Status as of 12 October 2026 | What it covers |
|---|---|---|---|
| Agentic Commerce Protocol | OpenAI and Stripe | “Currently in beta”, per its repository | Checkout and delegated payment, plus cart, feed, orders, authentication and MCP since 2026-04-1710 |
| Agent Payments Protocol (AP2) | Google, which announced its donation to the FIDO Alliance in April 2026 | Specification and reference code on GitHub, v0.2.0 since 28 April 2026, no beta label | Signed mandates that record what the shopper asked for and the cart they approved11 |
| Universal Commerce Protocol (UCP) | Google, with retailers and platforms, since January 2026 | “Already enables direct checkout for hundreds of thousands of brands and retailers” (16 September 2026)12 | Discovery through checkout and order management. Works with AP2, over A2A, MCP or APIs13 |
Agents work from product data, so feeds need complete prices, availability and images. Google’s UCP integration requires an active Merchant Center account with eligible products.13 Checkout should be callable as an API, with your systems pricing each order and accepting or declining it. Check which protocols your payment provider supports. Under Google’s checkout the retailer stays the seller of record.14 Our comparison of MCP, A2A and function calling covers the agent-side layers.
A kickoff checklist for AI in ecommerce
9io has kicked off products in healthcare, ecommerce, edtech and fintech. For an AI commerce product, we’d settle these first.
- Confirm your PCI DSS questionnaire with your acquirer, and keep card entry in the provider’s hosted fields or page.
- Set a performance budget against Core Web Vitals at p75, and keep personal pages out of any HTML cache.
- Generate product markup and feeds from one product source.
- Build to WCAG AA from the first component, and ship a consent banner with reject beside accept.
- Time each step of a chained AI feature, log its tokens, and tune reasoning effort per step against a regression suite.
- Build a test set from real shopper inputs before choosing a model, and report intervals next to hit rates.
- Sort model responses into success, refusal, empty or transient before any retry, and expire cached failures.
- Give every job that calls a paid model a cost estimate, a ledger and a daily budget.
- Keep product data, checkout and payments ready for agent protocols, and recheck their status each quarter.
-
PCI Security Standards Council, “Important Updates Announced for Merchants Validating to Self-Assessment Questionnaire A”, 30 January 2025, https://blog.pcisecuritystandards.org/important-updates-announced-for-merchants-validating-to-self-assessment-questionnaire-a ↩↩
-
PCI Security Standards Council, FAQ 1588 on SAQ A eligibility for scripts, February 2025, https://www.pcisecuritystandards.org/faqs/1588/ ↩
-
web.dev, “Web Vitals”, https://web.dev/articles/vitals ↩
-
web.dev, “Interaction to Next Paint is officially a Core Web Vital”, 12 March 2024, https://web.dev/blog/inp-cwv-launch ↩
-
Deloitte Ireland, “Milliseconds make millions”, commissioned by Google, 2020, https://www.deloitte.com/ie/en/services/consulting/research/milliseconds-make-millions.html ↩
-
Google Search Central, “Merchant listing (Product, Offer) structured data”, https://developers.google.com/search/docs/appearance/structured-data/merchant-listing ↩
-
AccessibleEU, “A new era for inclusion begins: The EAA enters into force”, 27 June 2025, https://accessible-eu-centre.ec.europa.eu/content-corner/news/new-era-inclusion-begins-eaa-enters-force-2025-06-27_en ↩
-
Your Europe, “Accessibility requirements for services and products”, https://europa.eu/youreurope/business/selling-in-eu/selling-goods-services/accessibility/index_en.htm ↩
-
European Data Protection Board, “Report of the work undertaken by the Cookie Banner Taskforce”, adopted 17 January 2023, https://www.edpb.europa.eu/system/files/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf ↩
-
Agentic Commerce Protocol repository, https://github.com/agentic-commerce-protocol/agentic-commerce-protocol ↩
-
Google Cloud, “Powering AI commerce with the new Agent Payments Protocol (AP2)”, 17 September 2025, https://cloud.google.com/blog/products/ai-machine-learning/announcing-agents-to-payments-ap2-protocol; Google, “We’re donating Agent Payments Protocol to the FIDO Alliance to support the future of secure, agentic payments”, 28 April 2026, https://blog.google/products-and-platforms/platforms/google-pay/agent-payments-protocol-fido-alliance/ ↩
-
Google, “Boost your holiday sales with these agentic commerce updates”, 16 September 2026, https://blog.google/products-and-platforms/products/shopping/google-shopping-updates-holiday-shopping/ ↩
-
Google Developers Blog, “Under the Hood: Universal Commerce Protocol (UCP)”, 11 January 2026, https://developers.googleblog.com/under-the-hood-universal-commerce-protocol-ucp/ ↩↩
-
Google, “New tech and tools for retailers to succeed in an agentic shopping era”, 11 January 2026, https://blog.google/products/ads-commerce/agentic-commerce-ai-tools-protocol-retailers-platforms/ ↩
Frequently asked questions
How is AI used in ecommerce?
On the fashion commerce platform we build and run, AI answers shoppers through a stylist, finds products from a shopper’s photo, renders virtual try-ons and product photos, and classifies items with a vision model. Each one needed engineering around the model for latency, testing, failures or spend.
What is agentic commerce?
Shopping in which an AI agent finds products and completes the purchase for a person, through a protocol that connects it to the store’s product data, checkout and payment provider. As of 12 October 2026, OpenAI and Stripe’s Agentic Commerce Protocol is in beta, and Google says its Universal Commerce Protocol already enables direct checkout for hundreds of thousands of brands and retailers.
How do you add visual search to an ecommerce site?
Cut each item out of the shopper’s photo, embed each cutout with an image model tuned for your domain, search a vector database and re-rank a capped list. Test models on real shopper photos first. On our 60 cases, FashionSigLIP’s top-five hit rate was 63.3% against 38.3% for CLIP.
What are good Core Web Vitals for an ecommerce site?
At the 75th percentile of page loads, LCP of 2.5 s or less, INP of 200 ms or less and CLS of 0.1 or less, measured separately for mobile and desktop. INP replaced First Input Delay on 12 March 2024.
Do I need PCI compliance if my payment provider hosts the card form?
Yes, but the scope can shrink to SAQ A when all account data functions are outsourced to a PCI DSS compliant provider through an iframe or a redirect. Since 31 March 2025, a merchant that embeds the provider’s form must also confirm its page is not susceptible to script attacks. Your acquirer confirms which questionnaire applies.
Does the European Accessibility Act apply to online shops?
Yes. It has applied to e-commerce services in the EU since 28 June 2025. The EU’s Your Europe portal lists online shops among the services covered and exempts service businesses with fewer than 10 employees and under €2 million in turnover.
Building something like this?
9io is a small team of senior engineers with a fractional CTO. We work by the hour, and plans start at $5,000. Send us a note about your product. The reply comes from the person who'd do the work.