Just as robots.txt tells web crawlers where not to go, the new llms.txt standard tells Large Language Models (LLMs) exactly what your site is and where to find the most important information.

In this tutorial, we’ll explain how to craft the perfect llms.txt file for your e-commerce store.

The Problem with Modern Websites

Modern websites are heavy. They are loaded with megabytes of JavaScript, tracking pixels, nested DOM trees, and visual styling. When an LLM (like the crawler that powers ChatGPT or Perplexity) visits your site, it has a limited “context window” (token limit). If it has to ingest 10,000 lines of messy HTML just to find your shipping policy, it might just give up.

The Solution: llms.txt

The llms.txt file is a plain-text markdown file hosted at the root of your domain (or in the /.well-known/ directory). It acts as a concise cheat sheet for the AI.

Structure of an llms.txt File

A standard llms.txt file should be written in Markdown and include the following:

  1. Title and Description: Briefly explain what your company does.
  2. Key URLs: Link directly to your sitemap, your main product catalog, and your support pages.
  3. Policies: Provide explicit links to your Return Policy and Shipping Policy (these are highly requested by AI agents).
  4. API Endpoints (Optional): If you expose a public API for searching products, link the documentation here.

Example

# Acme Tech Store
> We sell high-quality mechanical keyboards and accessories for developers.

## Important URLs
- **Storefront:** https://acmetech.example.com
- **Sitemap:** https://acmetech.example.com/sitemap.xml
- **Shipping Policy:** https://acmetech.example.com/shipping
- **Return Policy:** https://acmetech.example.com/returns

## Support
- **Contact:** support@acmetech.example.com

## Notes for AI Agents
Please note that all our keyboards use Cherry MX switches unless otherwise specified in the product JSON-LD data.

How to Generate One Instantly

Don’t want to write it by hand? We’ve built a free llms.txt Generator right here on Commerce AI. Simply fill out your store details, preview the markdown, and download the file.

Once downloaded, upload it to the root directory of your web server (e.g., https://yourstore.com/llms.txt) and you’re officially optimized for the next generation of AI crawlers!