CategoryAI
PublishedFEBRUARY 17, 2026

Lessons From Building an AI Shopping Agent Across 15 Models

Lessons From Building an AI Shopping Agent Across 15 Models

Lessons from building Totebot, our AI shopping agent: one layer over 15 models, choosing a model per job, streaming, store context and checking every change.

Totebot is the AI shopping agent platform we built for e-commerce. Merchants use it to put an assistant on their store that knows their products, answers questions, recommends items and adds them to the cart, on the website and in chat apps like WhatsApp and Telegram.

Under the hood, it runs on 15 models from OpenAI, Anthropic and Google, all behind one abstraction layer. This post is about what building it taught us: why that layer exists, how we think about choosing models, and where the real work in an AI agent turned out to be.

You can see the full project in our Totebot case study.

Why One Abstraction Layer Over Many AI Providers

The first decision we made was not to depend on a single AI provider. It shaped the whole platform.

Providers change under you. Prices change, quality shifts between versions and services have bad days. If your product is wired to one provider, every one of those changes is your problem, and you can do nothing about it.

The best model keeps changing. The models we support today range from GPT-4o and Claude Sonnet 3.5 to GPT-5 and Gemini 2.5 Pro. A year from now that list will look different again. With one layer in between, adding a new model is a contained piece of work, not a rewrite.

The layer is where provider differences go to disappear. Each provider has its own API, its own way of streaming and its own way of failing. The rest of the product should not know or care which one is answering. Conversations, cart actions and analytics all talk to the layer, never to a provider directly.

It makes testing honest. Because every model sits behind the same interface, merchants can A/B test models on real traffic and compare them on equal terms. That is far more useful than any benchmark, because it measures their customers and their catalog.

The layers of Totebot: chat channels on top, then streaming, the shopping agent, one AI layer over 15 models from three providers, live store context, and Postgres with vector search and Redis at the bottom

Choosing the Right Model for Each Job

Supporting 15 models is not about having options for their own sake. It is about matching the model to the job.

Cost, speed and quality pull in different directions. The list includes small, fast models like GPT-5 Nano, GPT-4.1 Mini and Gemini 2.0 Flash, and larger ones like GPT-5, Claude Sonnet 4 and Gemini 2.5 Pro. A shopper asking whether a product comes in blue does not need the biggest model. A shopper describing a problem and asking which of forty parts fits needs a model that reasons well.

Merchants have different priorities. A store with a huge catalog and complex products cares most about answer quality. A store with high traffic and simple products cares about cost per conversation. Both are right, and the platform lets each choose by cost, quality or use case.

Decide with data, not with headlines. A new model launch is a reason to test, not a reason to switch. We would rather run a new model against real conversations and see how it does than move every merchant because of a launch post.

Streaming Makes the Conversation Feel Alive

A shopping assistant that makes you wait several seconds for a full answer feels broken, even when the answer is good. People expect chat to feel like chat.

Stream every answer. Totebot streams responses with Server-Sent Events as the model generates them. The shopper sees the answer start almost immediately, and the conversation keeps its flow.

Long answers need shape. A wall of text is hard to read on a phone. Smart buffering splits longer answers into readable chunks, which matters even more in messaging apps, where a reply arrives as a series of messages rather than a live stream.

One conversation, many channels. The same assistant runs on the web, WhatsApp, Messenger, Telegram and TikTok. Each channel has its own rules for how messages arrive, so the streaming layer has to adapt the same answer to each one. The platform handles thousands of conversations at once, with background jobs in BullMQ and Redis and real-time updates over Socket.IO.

E-Commerce Context Matters More Than the Model

This was the biggest lesson. A great model with no knowledge of the store is a polite chatbot. An average model with live store context is a salesperson.

The catalog has to be searchable by meaning. Shoppers rarely use product names. They describe what they need. We store products in PostgreSQL with vector search, so the agent finds items by what they are for, not just by matching words.

Stock and price have to be live. Recommending something that is out of stock, or quoting yesterday's price, is worse than recommending nothing. Totebot uses Shopify webhooks to receive order, inventory and product changes as they happen, so the agent works from the same data the store does.

The cart is part of the conversation. The agent can add and update items in the cart while the shopper is talking to it, and the cart stays in sync with the store in real time. The shortest path from question to purchase runs through the chat.

It has to feel like the store, not an overlay. We built it with Shopify Theme App Extensions, so it works with any theme without code changes. Merchants also fill a knowledge base with their own information, so answers stay accurate and on brand.

What Breaks in Production

A demo agent works on the questions you thought of. A production agent meets every question you did not.

Stale data breaks trust fastest. If the agent's picture of the store drifts from the real store, shoppers notice. That is why live updates from the store are not a feature we added later. They are part of the foundation.

Providers fail. Any single provider will at some point be slow or unavailable. With one layer over three providers, a provider problem becomes a configuration decision instead of an outage.

Answers that are right but unhelpful. Many weak conversations are not wrong. They are too long, too vague or miss what the shopper was really asking. You only find these by reading real conversations.

Load arrives all at once. Stores get traffic in bursts, from campaigns, ads and launches. Work that does not need to happen inside the conversation goes to background jobs, so the chat stays fast when traffic spikes.

How We Evaluate Changes

Every change to a model, a prompt or a merchant's knowledge base can change how the agent behaves. So we look at what actually happened in conversations, not at what we expected to happen.

The Totebot improvement loop: real conversations, sentiment and analytics, knowledge base fixes, and A/B tests of models, then back to real conversations

Every conversation is logged. Merchants can read customer questions, the agent's replies and the products it suggested. This is where most real improvements start.

Sentiment flags the bad ones. Each message is classified as positive, neutral or negative, with a confidence score. Negative conversations are the fastest way to find where the agent is failing.

Analytics show the business effect. Conversion rates and funnel drop-offs show whether a change helped shoppers buy, not just whether the answers sounded good.

Models are compared on real traffic. A/B testing models lets a merchant see which one does better for their customers before switching everyone over.

The common thread is that the agent is never finished. It improves through a loop of real conversations, fixes and tests, the same way any good product does. This is also why most AI projects fail for reasons that have nothing to do with the model.

The Model Is the Easy Part

Choosing a model takes an afternoon. Building the layer around it, the live store context, the streaming across channels and the loop that keeps it improving is what takes the work.

That is the part that makes an AI agent useful in a real business, and it is the part we enjoy building. If you are planning one, start with the context and the checks, and pick the model last. Our AI solutions page shows how we approach it.

Share this post:
Launch Your AI Project

We collaborate with future and technology focused brands and companies.