Journal
How to Optimize Shopify llms.txt and agents.md for AI Search and Shopping Agents
A practical Shopify merchant guide to improving `llms.txt` and `agents.md` for AI search, LLM answers, product discovery, and shopping agents without treating the files as ranking hacks.
Key takeaways
What to remember
- Treat this as the practical optimization pillar for Shopify AI-search files.
- Keep the auto-generation/context article as the supporting page.
- Add merchant-specific product, collection, policy, and buying-guide links.
- Do not make claims in `llms.txt` that the storefront cannot support.
- Verify root-level serving, canonical URLs, structured data, and policy consistency after publishing.
How to Optimize Shopify /agents.md, /llms.txt, and /llms-full.txt for AI Search
Shopify now automatically generates /agents.md, /llms.txt, and /llms-full.txt for every store. As of May 28, 2026, /agents.md is the primary AI-discovery file; /llms.txt and /llms-full.txt default to mirroring it.
These files aren’t ranking hacks. They are structured notes that guide AI crawlers and shopping agents about your store’s products, important pages, and available endpoints.
What Shopify Provides by Default
Every Shopify storefront serves these three agent-facing files:
| File | Role |
|---|---|
/agents.md |
Main AI-discovery file |
/llms.txt |
Legacy format, mirrors /agents.md |
/llms-full.txt |
Extended version, mirrors /agents.md |
Shopify also offers two MCP-style endpoints for programmatic agent access:
https://{shop}.myshopify.com/api/mcp— Storefront MCP tools (general store functions)https://{shop}.myshopify.com/api/ucp/mcp— UCP catalog tools (search_catalog,lookup_catalog,get_product)
How to Customize
Shopify provides three Liquid theme templates under Online Store > Themes > Edit code:
| Template | Controls |
|---|---|
templates/agents.md.liquid |
/agents.md (and fallback for others) |
templates/llms.txt.liquid |
/llms.txt only |
templates/llms-full.txt.liquid |
/llms-full.txt only |
Fallback chain: specific template → agents.md.liquid → Shopify-generated default.
In practice, maintain agents.md.liquid as your primary file. Create separate llms.txt.liquid or llms-full.txt.liquid only if needed (heavy AI traffic, large catalog, B2B routing, regional assortments).
Important: Uploading files to Shopify Files or a CDN won’t work. They must be served from your store root (https://yourstore.com/llms.txt).
Content for These Files
/agents.md — Agent Instructions
Keep this under a few hundred lines and explain how agents should interact with your store:
- Store Identity: Briefly describe what you sell, your target audience, and shipping areas.
- MCP/Endpoints: List your Storefront Catalog MCP URL and any available JSON-LD feeds.
- Policy Surface: Provide links to return policies, shipping cutoffs, account pages, and support contact.
- Behavior Rules: Specify what agents should verify before making recommendations (inventory, price, compatibility, medical claims).
/llms.txt — Routing Layer
Think of /llms.txt as a structured sitemap for AI. In the first 100 words, clearly answer:
- What is your store’s focus?
- What products/categories does it offer (with price ranges and geographies if applicable)?
- Which endpoints are accessible?
- What policies should agents confirm before making claims?
Link to canonical product pages, collections, FAQs, policies, and buying guides; don’t duplicate content.
Core Principles
- Routing, Not Source of Truth: Point to canonical pages; avoid unverifiable claims.
- Entity Question Upfront: State brand, location, category, and target audience early on.
- Natural Query Language: Use phrases shoppers actually search for, avoiding keyword stuffing.
- Policy Safety: Instruct agents to cite live policy pages, not make promises.
- Markdown Preferred: Easier for models to parse than extensive HTML.
- Real Prompt Testing: Test with prompts like “What does [brand] sell?” or “Can I return to [brand]?”.
Realistic Expectations
As of mid-2026:
- Major AI crawlers (ChatGPT, Perplexity, Gemini) are not yet significantly accessing these files.
- They are most crucial for Shopify’s internal agentic systems (UCP, MCP, Storefront Catalog).
- Google states site owners don’t need
llms.txtfor generative AI search.
View this as good hygiene for Shopify’s agentic infrastructure, not a direct conversion tool. The same principles that benefit human shoppers—clear product data, accurate policies, fast pages, structured data—make your store agent-readable.
Common Mistakes
- Treating
/llms.txtas a keyword dump instead of structured guidance. - Serving files from a CDN instead of the store root.
- Making claims your storefront can’t verify.
- Over-customizing without first auditing Shopify’s defaults.
Workflow
- Review existing
/agents.md,/llms.txt, and agentic discovery sitemap. - Identify shopper questions agents should answer.
- Prioritize strengthening storefront content (product details, policies, FAQs, schema).
- Create
templates/agents.md.liquidas your primary file. - Verify root-level serving and correct
Content-Typeheaders. - Test with real AI prompts and analyze outputs.
- Revisit and update monthly or after significant catalog/policy changes.
Related: Shopify agents.md and llms.txt: what gets auto-generated, and how to override llms.txt
Frequently asked questions
Is llms.txt a ranking hack?
No. Treat it as machine-readable merchandising and routing guidance. It should point AI systems toward truthful storefront evidence, not make unsupported ranking claims.
What should Shopify merchants optimize first?
Start with canonical collection, product, policy, FAQ, buying-guide, sitemap, and agent-discovery links. Keep the file short enough to be useful.
How does this guide relate to the Shopify auto-generation article?
The auto-generation article explains what Shopify may already expose and what override risks exist. This guide is the practical checklist for improving the merchant-authored layer.