Generation
Turn on Litestore's AI features with your own provider key and review everything they draft before it goes live.
Litestore can use AI to draft text and suggestions for you in the admin. This page explains which features exist, how to turn them on and how Litestore makes sure nothing goes live without your approval.
Litestore supports three AI providers: Google Gemini, Anthropic Claude and OpenAI. It connects to all three through one shared layer, the AI SDK.
You pick one provider and add your own key. A small set of admin features then start working:
- Meta title and description
- Tag suggestions
- Category suggestions
- Attribute discovery
- Email and social drafts
- Product import from a URL
- A task assistant
Each of them fills something in for you to review. None of them changes your storefront on its own.
That's the main rule on this page. Most of what follows explains how Litestore enforces it in the code, not just promises it.
Choosing a provider
Only one provider is active at a time. Each has a default model and its own key:
Google (default) gemini-2.0-flash GOOGLE_GENERATIVE_AI_API_KEY
Anthropic claude-sonnet-4-20250514 ANTHROPIC_API_KEY
OpenAI gpt-4o OPENAI_API_KEYChoose a provider with AI_PROVIDER and add the matching key.
If you want a different model from the same provider, set its name in AI_MODEL.
Google is the default. If you only set GOOGLE_GENERATIVE_AI_API_KEY, you don't need to configure anything else.
Failover
If your provider is rate-limited or returns a server error, Litestore retries the request with the next provider in this chain:
Google → Anthropic → OpenAI → GoogleLitestore only moves to a provider whose key you've also set. Failover doesn't give you a second provider for free.
There's one intentional exception. If a key is rejected or revoked, Litestore never falls back. A broken key shows up as a failure instead of being hidden by a quiet switch to another provider. Otherwise, you might find out months later that a key you thought you were using had been dead all along, and that you'd been billed somewhere else.
To turn the chain off completely, set AI_FALLBACK_ENABLED to false.
Where the buttons are
You'll find a generate button in four places in the admin:
- SEO meta title and description on the product, collection, category and page forms
- Category suggestions on the product's category card
- Variant attribute discovery in the specifications editor
- Email subject and body in the template and compose forms
Features without a button
Two features work through the API, but no button in the admin uses them:
- Tag suggestion
- Social post drafting
Settings → AI shows tag generation as used by the external API. You can only reach both of these through the API.
This is worth saying clearly. A feature that exists and a feature with a button are two different things, and people often mix them up when they plan work around a feature list.
Product import from a URL
Once you've configured a provider, you can paste a product URL. Litestore pulls the product's content into a draft.
Without a provider, the import dialog disables that option instead of letting it fail when you try it.
Nothing publishes itself
The SEO generator writes its result into the form you're editing. It does nothing else.
You read it, fix anything that's wrong and save. There's no way for it to publish on its own, neither as a setting nor hidden in the code.
The assistant suggests, you approve
The task assistant can read your store's data directly, but it can't change anything.
When the assistant wants to make a change, its tool returns a proposal and an approval token signed by the server. The change only runs after you click Approve.
you ask
↓
assistant reads store data directly
↓
change-making tool returns a proposal + signed token
↓
you click Approve
↓
the change runsMoney, refunds and stock have an extra safeguard. The code only allows proposals for them. A tool that tried to act on those directly would fail to build. This isn't a check that runs while the store is live, which a later change could weaken by accident. Code that lets the assistant move money directly won't compile at all.
Settings → AI records every proposal and whether it was approved, dismissed or expired.
The autonomy ceiling
Settings → AI has an autonomy ceiling for the whole store. By default it's set to read-only.
Next to it, you can switch off individual capabilities.
If a capability is above the ceiling or switched off, Litestore never shows it to the model. The model isn't offered it and then refused. It doesn't know the capability exists, so nobody can talk it into using it.
Input screening
Before a prompt reaches a provider, Litestore checks it for injection patterns.
If Litestore blocks a message, it refuses it instead of passing it on.
AI features stay hidden until you add a provider key
Settings → AI shows "AI Not Configured" and tells you which key to add. Until then, the admin hides the Ask AI action on dashboard tasks, the inbox draft and assistant, the URL product import, and the capability and activity panels. The generation endpoints return 501.
What's included and what isn't
| Capability | Included in the repository | Required activation |
|---|---|---|
| SEO meta title and description | Yes, on product, collection, category and page forms | A provider key |
| Category suggestions | Yes, on the product's category card | A provider key |
| Variant attribute discovery | Yes, in the specifications editor | A provider key |
| Email subject and body drafts | Yes, in the template and compose forms | A provider key |
| Tag suggestions | Endpoint only. No admin button calls it. Settings → AI lists tag generation as used by the external API | A provider key; called via the API |
| Social post drafts | Endpoint only. It works, but no admin button calls it | A provider key; called via the API |
| Product import from a URL | Yes. Paste a product URL and Litestore pulls its content into a draft. Without a key, the dialog disables the option | A provider key |
| Task assistant with approval-gated actions | Yes. It reads store data directly, but every tool that changes something returns a proposal and a server-signed approval token that you approve. Money, refunds and stock only allow proposals | A provider key, plus raising the autonomy ceiling above read-only |
| Product description generation | No, not included | — |
| Image alt text generation | No, not included | — |
| Bulk generation across a collection | No. Each generator works on one record | — |
Getting started
- Add a provider key to your environment. Set
AI_PROVIDERif you're not using Google. - Test the connection. Open Settings → AI and use the test button. The panel shows the active provider, the model and the fallback.
- Decide what the assistant may do. Leave the ceiling at read-only, or raise it and switch off the capabilities you don't want. Remember that Litestore never offers anything above the ceiling to the model.
- Generate, review and save. Use the buttons on the SEO card, the category card, the specifications editor and the email composer.
Before you turn any of this on, don't ask whether the AI can do the job. Ask this instead:
What would I need to check before publishing this without reading it? And if I'd always check it anyway, does reading and approving cost me anything?