Shopify Squad / Selling through AI chats
Shopify llms.txt and agents.md: how to edit them
What every Shopify store already serves at /agents.md and /llms.txt, and how to change it with a Liquid template.
Your Shopify store already has an llms.txt file. Every store serves three files for AI agents, /agents.md, /llms.txt and /llms-full.txt, and by default all three return the same content. You don’t need an app to create them. To change what they say, you add a Liquid template to your theme.
Before you do, look at what’s there. Keep the managed default unless you need custom agent instructions: once you add a template, you maintain the file yourself.
See what your store serves now
Open these three addresses in a browser, using your store’s primary domain:
https://yourstore.com/agents.mdhttps://yourstore.com/llms.txthttps://yourstore.com/llms-full.txt
The default lists your store name, store URL, sitemap link, store policies, UCP discovery and MCP endpoints, read-only browsing URLs for products, collections and search, and guidance for personal shopping agents.
Shopify calls /agents.md the canonical agent discovery URL. /llms.txt and /llms-full.txt exist for older AI crawlers that look for those specific file names.
Choose which template to add
| You want to change | Add this template | URLs it changes |
|---|---|---|
| All three files at once | agents.md.liquid | /agents.md, /llms.txt, /llms-full.txt |
Only /llms.txt | llms.txt.liquid | /llms.txt |
Only /llms-full.txt | llms-full.txt.liquid | /llms-full.txt |
A URL-specific template wins for its own URL. For /llms.txt, Shopify checks llms.txt.liquid first, then agents.md.liquid, then its own default. So if you only want a shorter /llms.txt and leave /agents.md alone, add llms.txt.liquid and nothing else.
Create the template
- In your Shopify admin, go to Online Store.
- Next to the theme you’re editing, click the horizontal menu icon and select Edit code.
- Click Add a new template and select agents.md, llms.txt or llms-full.txt, depending on the URL you want to change.
- Click Create template.
- Make your edits, then click Save.
The file lands in the theme’s templates folder. These must be Liquid templates, not JSON. After saving, reload the URL in your browser to check the output.
Write the content
The template accepts Markdown and Liquid, but it renders in a restricted context. Only two objects are available: request and agents. Global objects such as shop, collections and pages render blank, so you can’t loop over your products or pull in page content.
Useful agents properties:
agents.store_nameandagents.store_urlagents.sitemap_urlagents.ucp_discovery_urlandagents.mcp_endpoint_urlagents.ucp_versionsagents.currency
A short llms.txt.liquid could look like this:
# {{ agents.store_name }}
> One or two sentences on what you sell and who it's for.
> The full agent instructions are at {{ agents.store_url }}/agents.md.
- UCP discovery: {{ agents.ucp_discovery_url }}
- MCP endpoint: {{ agents.mcp_endpoint_url }}
- Sitemap: {{ agents.sitemap_url }}
Rules:
- Use the
agentsobject for UCP and MCP URLs. Don’t type them in by hand, so they stay correct when your store’s setup changes. - Leave out private data. Don’t output contact email addresses or phone numbers.
- Write one version. The files are served only at your bare primary domain, with no locale or Shopify Markets prefix, and have no localized counterpart.
- Keep it up to date yourself. Shopify’s default stays aligned with its agent features. Your template doesn’t.
Because Shopify falls back to its default when no template exists, removing your template brings the managed file back.
What these files don’t do
- They don’t put your products in AI chats. ChatGPT, Copilot and other AI channels get your products through Catalog. If yours aren’t showing, start with Shopify Catalog ineligible.
- They don’t block or allow crawlers. That’s
robots.txt, which has its own template. See Shopify robots.txt and AI crawlers. - They don’t switch off AI selling. Turning channels off happens under Sales channels > Agentic; the steps are in Shopify agentic storefronts opt out.
If you’re editing these files because you want to sell through AI chats, the setup itself is covered in how to sell on ChatGPT with Shopify.