The Honest Truth About "Training" an LLM on Your Catalog
You do not need to train an LLM on your Shopify products. You need to ground one in your catalog so it answers questions using your real inventory, prices, and policies instead of hallucinating a product that does not exist. Those are two completely different engineering problems, and most merchants confuse them.
The practice of building product-aware chatbots and search assistants has exploded since the launch of OpenAI's apps platform and Shopify's agentic commerce tooling. If you want the bigger picture on where this is heading, our primer on what agentic commerce actually means for merchants pairs well with this guide. The good news: the pattern has gotten shockingly affordable. A 2,000-SKU store can run a fully grounded product assistant for under $40 per month in API costs in 2026.
This walkthrough shows exactly how to do it. We will cover when to use Retrieval-Augmented Generation (RAG) versus fine-tuning, how to export your Shopify catalog, which embedding models and vector databases to pick, a minimal Python example, chatbot integrations, privacy and compliance, real dollar costs, and the Shopify App Store options that do this for you if you would rather skip the code entirely.
RAG vs Fine-Tuning: The Comparison Merchants Actually Need
The question "how do I train GPT on my products?" almost always has the same answer: you do not want training, you want retrieval. Fine-tuning bakes knowledge into the model's weights. RAG looks up fresh information at query time and passes it to the model as context. For a Shopify catalog that changes daily, baking is exactly the wrong move.
The IBM research team maintains a clear technical comparison of RAG vs fine-tuning that matches what we have seen in production: RAG wins for factual knowledge that changes, fine-tuning wins for teaching a model a new skill or tone. Here is how the tradeoffs break down for a product catalog.
| Dimension | RAG | Fine-Tuning |
|---|---|---|
| Best for | Answering questions from your catalog, policies, FAQs | Teaching a specific voice, format, or reasoning pattern |
| Data freshness | Live — new products appear instantly | Stale — requires retraining on every catalog change |
| Setup cost | $0-$200 one-time | $500-$5,000+ per training run |
| Monthly cost (2k SKUs) | $15-$60 | $0 inference + retraining costs |
| Hallucination risk | Low (grounded in retrieved text) | High (model invents plausible-looking products) |
| Time to ship | 1-3 days | 2-6 weeks |
| Engineer required | Junior-friendly | Senior + ML experience |
| Good merchant fit | 95% of stores | Very large catalogs with specialized vocabulary |
Rule of thumb: if your product data is in your Shopify admin, use RAG. Only consider fine-tuning if you are training the model to write in a specific brand voice, translate specialized jargon, or reason about a highly technical domain like automotive parts compatibility. Even then, the pattern is usually fine-tune for tone + RAG for facts, never fine-tune alone.
Exporting Your Shopify Product Catalog

Every RAG system starts with a clean data export. Shopify gives you three ways to get your catalog out, and the right choice depends on how often you plan to resync.
Option 1: CSV Export (One-Time or Weekly)
For prototypes and small stores, the built-in export is fine. Go to Products > All products, tick the boxes, and click Export. You will get a CSV with titles, descriptions, variants, prices, tags, and vendors. The official Shopify CSV product guide documents every column.
Downsides: it is manual, it does not include metafields by default, and you have to re-export every time a product changes.
Option 2: Admin API (Production)
For anything you plan to run as a live service, use the Admin API with a private app. The GraphQL endpoint lets you paginate through products and pull exactly the fields you need — titles, body HTML, variant SKUs, inventory levels, metafields, and tags. Shopify's Admin API product documentation covers the query shape.
A minimal query looks like this:
query Products($cursor: String) {
products(first: 50, after: $cursor) {
pageInfo { hasNextPage endCursor }
edges {
node {
id title handle descriptionHtml productType tags vendor
variants(first: 20) { edges { node { sku price } } }
metafields(first: 10) { edges { node { key value } } }
}
}
}
}Option 3: Webhooks (Real-Time Sync)
For truly live systems, subscribe to products/create, products/update, and products/delete webhooks. Every change fires a request to your endpoint, which re-embeds the single product and updates the vector database. This is how apps like the ones we discuss in our best AI chatbot for Shopify customer service comparison stay current.
For a starter project, export to CSV. For a real product, use the Admin API on a nightly cron plus webhooks for same-day changes.
Embedding Models Compared
An embedding model turns a product description into a vector of numbers — roughly 1,024 to 3,072 floats — that captures semantic meaning. When a customer asks "warm waterproof jacket for dog walking," you embed the question and find the closest product vectors. The quality of this matching is almost entirely determined by which embedding model you pick.
| Model | Dimensions | Price per 1M tokens | Best for |
|---|---|---|---|
| OpenAI `text-embedding-3-small` | 1,536 | $0.02 | Default pick — fast, cheap, great quality |
| OpenAI `text-embedding-3-large` | 3,072 | $0.13 | Nuanced catalogs (fashion, cosmetics) |
| Voyage `voyage-3-large` | 1,024 | $0.18 | Highest benchmark scores in 2026 |
| Cohere `embed-v4.0` | 1,536 | $0.12 | Multilingual stores (100+ languages) |
| `bge-large-en-v1.5` (open source) | 1,024 | $0 (self-hosted) | Privacy-first or high-volume stores |
For most Shopify stores, OpenAI `text-embedding-3-small` is the right default. Embedding a 2,000-SKU catalog with 200-word descriptions costs about $0.20 total at current prices. You will spend more on coffee during the build.
One important detail: do not just embed the product title. Concatenate title + description + product type + tags + key variant info into a single "chunk" per product. Longer context produces better matches. If you have long-form product pages (buying guides, fit notes, care instructions), split them into 500-token chunks and embed each chunk separately with a link back to the product.
Vector Database Options for Shopify Merchants

Once you have embeddings, you need somewhere to store them and run similarity searches. The three practical options in 2026, in rough order of simplicity:
pgvector (Postgres Extension)
If you already run a Postgres database — and you probably do if you use Neon, Supabase, or Railway — just add the pgvector extension and you have a vector store. No new service, no new bill. The official pgvector README on GitHub shows the setup in about 10 lines. For catalogs under 100k items, performance is excellent.
Pinecone (Managed, Easy)
Pinecone is the path of least resistance if you do not want to manage infrastructure. Their serverless pricing starts at $0 for small catalogs and scales pay-per-use. A 5,000-product catalog with moderate traffic runs roughly $20-$40/month. The SDK is clean and documentation is excellent for first-time RAG builders.
Chroma (Open Source, Self-Hosted)
Chroma is the hacker-friendly option. It runs in-process during development and as a containerized service in production. Free, fast, and great for prototyping, but you own the uptime. Best if you already have a DevOps muscle or are running a single-node internal tool.
Decision Framework
- Under 10k SKUs, already on Postgres: use pgvector
- Under 50k SKUs, no infrastructure opinions: use Pinecone serverless
- You love self-hosting: use Chroma or a pgvector container
- Enterprise or regulated industries: use Pinecone Pods or Qdrant Cloud with VPC peering
Every option here supports the standard cosine similarity query you need. The difference is operational, not functional.
A Minimal RAG Example (Python, ~40 Lines)
Here is the simplest end-to-end RAG pipeline you can build for a Shopify store. It embeds products once, stores them in pgvector, and answers customer questions grounded in the real catalog.
import os, psycopg, openai, json
from openai import OpenAI
client = OpenAI()
db = psycopg.connect(os.environ["DATABASE_URL"])
# --- 1. One-time ingest ---
def ingest(products):
with db.cursor() as cur:
for p in products:
text = f"{p['title']}. {p['body_html']}. Tags: {', '.join(p['tags'])}"
emb = client.embeddings.create(
model="text-embedding-3-small", input=text
).data[0].embedding
cur.execute(
"INSERT INTO products (handle, title, url, embedding) "
"VALUES (%s, %s, %s, %s)",
(p["handle"], p["title"], p["url"], emb),
)
db.commit()
# --- 2. Query at runtime ---
def answer(question):
q_emb = client.embeddings.create(
model="text-embedding-3-small", input=question
).data[0].embedding
with db.cursor() as cur:
cur.execute(
"SELECT title, url FROM products "
"ORDER BY embedding <=> %s::vector LIMIT 5",
(q_emb,),
)
matches = cur.fetchall()
context = "\n".join(f"- {t} ({u})" for t, u in matches)
prompt = (
f"Answer using only these products:\n{context}\n\n"
f"Customer: {question}"
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}],
)
return resp.choices[0].message.contentThat is the entire pattern. Everything else — webhooks, reranking, multi-turn chat, analytics — is an upgrade on this core loop. OpenAI's retrieval cookbook on GitHub has production-grade variants with chunking, hybrid search, and metadata filters.
Three upgrades worth adding before you go live:
- Metadata filters — pass
in_stock = true,vendor = "Nike", orprice < 100alongside the vector query so results respect live inventory and shopper filters. - Hybrid search — combine vector similarity with keyword (BM25) search. Products with rare brand names or SKU codes often match better with keywords than embeddings.
- Reranking — a reranker model like Cohere Rerank or Voyage Rerank takes the top 20 vector results and reorders them by deeper relevance. It typically lifts answer quality more than swapping to a better embedding model.
Integrating Your RAG System Into a Shopify Chatbot

A working pipeline is not a customer experience. You need a place for shoppers to actually ask questions. Four options, roughly in order of effort:
1. Shopify Inbox + Custom Webhook
Shopify Inbox is the native chat widget. You can proxy messages to your RAG endpoint through a Shopify Flow action or a lightweight middleware. Minimal UI work, but Inbox is chat-only and not ideal for product recommendations with images.
2. Custom Chat Widget (Theme App Extension)
Build a theme app extension that renders a chat bubble on product pages, pulls the current product context into the prompt, and calls your backend. This gives you full control over UX — product cards, add-to-cart buttons, and carousel responses. If you are comfortable with Liquid and modern front-end work, our guide to Shopify developer communities points to where to get help when you get stuck.
3. Headless Chat (Hydrogen / Next.js)
If you run a headless storefront, embedding the chat in your React app is trivial. Use the Vercel AI SDK, stream responses token-by-token, and pass product metadata in context. This is the pattern used by most modern Shopify Plus chatbots in 2026.
4. Discord or Slack Bot
An underrated pattern: a bot that answers product questions in your community Discord. We walked through a similar architecture in our piece on Discord bots for Shopify store automation. Great for B2B stores and creator brands with active communities.
Regardless of interface, keep a conversation log in your database. Customer questions that your chatbot could not answer are the single best source of content ideas, new FAQs, and missing metafields.
Privacy, PII, and Compliance
A product-aware chatbot is low-risk. A chatbot that also knows about orders, customers, or support tickets is not. Before you plumb any customer data into your RAG system, understand what you are sending to the LLM provider.
- Product data is safe. Titles, descriptions, prices, and public tags are already on your storefront.
- Customer PII is not. Names, emails, addresses, and order histories should never be embedded into a third-party vector store without a Data Processing Agreement (DPA).
- Train on your data? Check the toggle. OpenAI, Anthropic, and Google all offer API tiers where your data is not used for training. Make sure it is enabled. The Anthropic data usage policy is a good reference for what enterprise terms look like.
- GDPR matters. If any EU customer interacts with the bot, you need a lawful basis for processing, a privacy notice, and the ability to delete chat logs on request.
- Disclose AI use. The EU AI Act requires transparent disclosure when users are interacting with an AI system. A simple "You are chatting with an AI assistant" line in the widget is enough for most cases.
For a defensible setup: embed only public catalog data in your vector DB, keep customer-specific context (order status, shipping address) in a tool-calling loop that the LLM requests on demand, and log conversations in your own database, not the LLM provider's.
Real-World Cost Breakdown
The single biggest lie in AI content is the cost estimate. Here is what we have actually seen in production across multiple Shopify builds in Q1 2026.
Small store (500 SKUs, 500 chats/month)
- Embeddings (one-time + weekly resync): $0.08/month
- Chat completions (gpt-4o-mini, ~2k tokens/chat): $0.90/month
- Pinecone Serverless: $0.00 (under free tier)
- Total: under $1/month
Mid store (5,000 SKUs, 5,000 chats/month)
- Embeddings: $0.80/month
- Chat completions: $9/month
- Pinecone Serverless: $20/month
- Total: ~$30/month
Large store (50,000 SKUs, 50,000 chats/month)
- Embeddings + nightly resync: $12/month
- Chat completions (GPT-4o): $180/month
- Pinecone Pods or Qdrant Cloud: $80/month
- Reranker (Cohere): $40/month
- Total: ~$310/month
Compare that to a senior content moderator salary or a fine-tuning engagement that starts at $5,000 one-time. For merchants weighing whether to build or buy, our AI tools for solo Shopify store owners roundup helps frame the make-vs-buy decision at different stages. If the budget pressure is real, our article on how to reduce Shopify app subscription costs applies the same lens to existing app stack spend.
Shopify App Store Options That Do This For You

Not every merchant wants to write Python. If you want the same product-grounded chatbot without the build, these App Store options use RAG under the hood and plug into your catalog automatically.
- Shopify Inbox** — the free native app now includes AI suggested replies that pull from your product catalog. Good starting point for small stores.
- Tidio** — "Lyro" AI agent handles product questions and order lookups. Starts around $29/month.
- Gorgias** — the enterprise support platform with a strong AI layer that answers from your catalog + help center + order data.
- Rep AI Chatbot** — purpose-built product recommender and concierge with guided shopping flows.
- Manifest AI** — GPT-powered product discovery with natural language filters.
- Octocom** — AI customer support with multilingual catalog grounding.
Buy-vs-build logic is straightforward. If your use case is "answer product questions and suggest SKUs," buy. If you have unusual requirements — proprietary fit logic, B2B pricing rules, custom ERP integrations — build. Anything in between, start with an app, keep your exported catalog and embeddings as a backup, and graduate to custom when the app's limits start to hurt. The wider apps and integrations category on our blog has deeper reviews of each.
Common Mistakes (And How to Avoid Them)
| Mistake | Why It Happens | Fix |
|---|---|---|
| Fine-tuning instead of RAG | "Train on my data" sounds like training | Default to RAG. Only fine-tune for tone, never for facts. |
| Embedding only product titles | Simple loop, feels clean | Concatenate title + description + tags + type; embed more context |
| Never resyncing embeddings | No one thinks about it until a customer asks for a discontinued product | Nightly cron + webhook updates on products/update |
| Letting the model answer without context | Forgot to pass retrieved chunks into the prompt | Always include a "use ONLY these products" instruction and the retrieved list |
| Ignoring inventory filters | Bot recommends sold-out products | Attach in_stock: true as a metadata filter on the vector query |
| Sending PII to third-party LLMs | Convenience during prototyping | Keep customer data in your own DB; use tool-calling to fetch on demand |
| Skipping evaluation | Hard to measure "is the bot good?" | Build a 50-question eval set from real customer tickets and score weekly |
| One giant prompt | Easier than chunking | Chunk long content at 300-500 tokens with overlap; retrieve top 3-5 |
The evaluation point deserves emphasis. Pick 50 real customer questions from your support inbox. Run them through your chatbot weekly. Score pass/fail. This single habit will do more for chatbot quality than any model upgrade. Our broader guide to Shopify analytics and measurement covers the same discipline for the rest of your stack.
Putting It All Together

You do not need to train an LLM on your Shopify products. You need to wire one up to read your catalog on demand. For 95% of merchants, a weekend of work — or a $29/month app — gets you a product-aware chatbot that measurably beats site search on conversion and cuts support ticket volume by 20-40%.
Your 2026 roadmap, in order of priority:
- Export your catalog via CSV or Admin API.
- Embed with `text-embedding-3-small` — default choice for quality and cost.
- Pick pgvector or Pinecone — your existing stack decides which.
- Ship the minimal RAG loop from the code example above.
- Add reranking and metadata filters once you have 100+ real queries.
- Evaluate weekly with a 50-question eval set from real tickets.
- Layer on fine-tuning only if your brand voice is very specific and even then, keep RAG for the facts.
This is one of the highest-leverage AI projects a Shopify merchant can ship right now. Lower ticket volume, higher conversion, better product discovery — all without rewriting your stack. For more playbooks like this, browse our full AI and emerging tech coverage or join the conversation in the Talk Shop community where merchants are sharing what is working in real stores.
Your turn: what is the one question your customers ask that your current site search cannot answer? That is the first question your new RAG chatbot should nail.

About Talk Shop
The Talk Shop team — insights from our community of Shopify developers, merchants, and experts.
