What you get

Two agents.

A shopping agent, the one your customers talk to. It searches the catalog, compares options, fills a cart and answers questions about returns and policies.

A merchant agent, the one you use to run the shop. It reads your products, orders and stock, proposes changes, and only writes back the ones you approve.

Before you start

You need Python version 3.11 or newer, and Node version 22. Check both first. If they are out of date the error message you get will not tell you that, and you will waste twenty minutes.

The 3 commands

One. Get the code:

bash

git clone https://github.com/Shopify/claude-for-commerce-examples.git && cd claude-for-commerce-examples

Two. Install it and create your settings file:

bash

python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt && cp .env.example .env

Now open the .env file it just made and paste your Anthropic API key next to ANTHROPIC_API_KEY=.

Three. Start it:

bash

uvicorn storefront.api.main:app --port 8004

Then open a second terminal window and run:

bash

npm install && npm run dev -w storefront/web

Go to http://localhost:3005. That is your storefront.

Why you do not need a Shopify account

This is the bit almost nobody finds.

For the shopping side, you already have a real store. Shopify points the example at a live demo shop by default, so the agent is searching a genuine catalog and building a real cart the moment it starts. You do not have to change a thing.

Three things to try once it loads:

  1. I'm looking for a gift under $50, what do you recommend?

  2. Add the first one to my cart.

  3. What's your return policy?

The product grid and the cart update as you talk.

For the merchant side, add one setting and it needs no account either:

bash

SHOPIFY_LOCAL_STORE=1 uvicorn merchant.api.main:app --port 8005

That runs it against a pretend store living on your own machine. Everything still works properly. Changes still get proposed, the approval step still holds them, and approving one really does update the catalog. Nothing leaves your laptop.

It cannot show you real sales or visitor numbers, because there aren't any. For that you eventually want a real store. Not tonight.

The 4 things that break

1. The sign in button gives an error. That is normal.

There is a "Sign in with Shop" feature, and it will return an error code until you add credentials from Shopify. That is how it is supposed to behave. Everything else works exactly the same without it, just as a guest. Ignore it and keep going.

2. There are two settings files and the wrong one can win.

The merchant side reads its own settings file, merchant/.env, before the main one. If you put your Anthropic key in both and one of them is old or wrong, the merchant side breaks while the shopping side keeps working. If that happens to you, check merchant/.env first.

3. You need Git installed or the install fails confusingly.

The install pulls part of the code straight from Anthropic's page on GitHub, at one exact fixed version. If Git is not installed on your machine, the install stops with an error that does not mention Git at all. Install Git, then run step two again.

4. If you connect a real store, the access code expires in a day.

When you move off the pretend store, you will be tempted to paste in an access token. Those stop working exactly 24 hours later and cannot be renewed, so your agent dies overnight for no obvious reason. Use the app's client ID and client secret instead. Those never expire, and the example quietly renews itself.

One more that catches people: if your agent says it cannot look up orders, that is not a bug either. It means the permission for reading orders was not switched on.

The part worth stealing

The best idea in here has nothing to do with shopping.

When the merchant agent wants to change something, it does not change it. It writes the proposal down and waits for a person to approve it. Only then does anything actually happen. The store's credentials are never shown to the AI at all.

That is a clean answer to letting AI suggest changes to something real without letting it make them. Worth copying into whatever you are building, even if you never touch ecommerce.

What to do with it

Get the shopping agent running tonight. Then point it at your own products and watch which parts stop working. That is the fastest way to learn what these things actually need.

Black Friday is ten weeks out. Enough time to ship something real, and not much more than that.

If you want the next one of these before it hits your feed, The AI Leverage is where it lands first and where it gets sharper.

by bestapps.ai on instagram