Docs / Websites

llms.txt for AI assistants

llms.txt is a Markdown file at the root of a site that tells a language model what the site is about and which pages matter. Search assistants and chat tools read it instead of crawling every page; Lighthouse also checks that it exists and starts with a heading.

In Studio you do not write this file. It is derived: you fill in a few settings, and the site builds the file on each request from those settings and the page tree. A page that is published appears in it, and one that is taken down disappears, with nothing to keep in step.

The llms.txt tab

Open the story’s settings and choose llms.txt. Every field is optional; an empty field uses the default shown in the form.

SettingDefaultWhat it does
Publish an llms.txtonOff: the address answers 404.
Summarythe story’s descriptionThe one-line description under the site name. Translatable.
DetailsnoneA few paragraphs of context: who the site is for, what the organisation does. Blank lines separate paragraphs. Translatable.
Sectionsthe menu’s top-level pagesThe pages to list as sections, each with its sub-pages, in this order.
Latest articles5How many of the newest articles to list. 0 turns the section off.
Heading of that section”Latest news”Translatable, so a German site can say “Neueste Meldungen”.
Article typesstandard:ArticlePageWhich page templates count as articles. List your own if the site uses a different one.
Extra linksnoneLinks to things outside the page tree, such as a shop: title, address, description, the section to list it under, and whether it belongs under Optional.
ExclusionsnonePaths to leave out: /shop is one page, /members/** is the page and everything below it, /teams/* is one level.

What is left out automatically

You never have to exclude these by hand:

  • pages with Exclude from search engines switched on,
  • pages hidden from the navigation, such as the year and month folders that file news articles,
  • the reserved header, footer, home and policies pages, and plain folders,
  • in a translated version, pages hidden in that language.

A page you pick explicitly under Sections is listed even when it is hidden from the menu, but Exclude from search engines and the exclusions still win.

Each link carries the page’s meta description, or its description, summary or teaser if there is none. The file is as good as those descriptions are, so write them for people first.

What it looks like

# River Hawks

> Ice hockey club in the Rhine valley — first team, youth teams and a public skating rink.

## Teams

- [Teams](https://hawks.example/teams): All teams of the club, from U9 to the first team
- [Youth](https://hawks.example/teams/youth): Training times and how to join

## Latest news

- [Derby win in front of a full house](https://hawks.example/news/2026/10/derby): 4:2 against the Lions

## Links

- [Fan shop](https://shop.hawks.example/): Jerseys and scarves

## Optional

- [Imprint](https://hawks.example/imprint)

For developers: serving the file

The helper lives in @maravilla/studio-content/llms-txt (version 0.22.0 and later). It takes the site’s own SQL call, so it reads the same branch as the site’s pages:

import { loadLlmsTxt, LLMS_TXT_CONTENT_TYPE } from '@maravilla/studio-content/llms-txt';

const text = await loadLlmsTxt(query, {
  story: '/hawks',        // the story root
  workspace: 'stories',   // default
  origin: 'https://hawks.example', // makes every link absolute
  locale,                 // optional: the language to serve
});
if (text === null) return new Response('Not found', { status: 404 });
return new Response(text, { headers: { 'content-type': LLMS_TXT_CONTENT_TYPE } });

Add it as a route at /llms.txt: a server route in SvelteKit (src/routes/llms.txt/+server.ts), a resource route in React Router, src/pages/llms.txt.ts in Astro.

  • origin must be a fixed value from the site’s configuration, not the request’s Host header. A host taken from the request lets a visitor put an address of their choosing into a file that is then cached for everyone.
  • Read the live branch. The branch is whatever your SQL call reads. Point it at the branch visitors see (publish when the site serves published content), and the file lists exactly what is published.
  • Page fields. The helper reads published_at to order the latest articles, and no_index and meta_description for the exclusions and descriptions. A site whose templates use other field names builds the file with the two pure functions instead: buildLlmsTxt applies the settings and the exclusions to the pages you pass in, and renderLlmsTxt turns the result into Markdown with escaping, absolute links and a guaranteed heading.
  • Languages. Outside the story’s default language every read is limited to that language and links get the language prefix. A site that routes languages another way passes its own link builder.

Caching

The file changes whenever a listed page does, so cache it like the pages. With the Cache tab on and What to purge set to Everything, every publish refreshes /llms.txt along with the rest of the site, so a long s-maxage is safe; see Caching and purge. With Only when selected pages are published, the file is only as fresh as its lifetime: give it a short one. The file is the same for every visitor, so it must never carry private or vary on visitor facts.

Checking it

curl -si https://www.example.com/llms.txt | head -20

You should see a 200, a text content type and a first line starting with # . To confirm the switches work: turn Publish an llms.txt off and publish the story, and the address answers 404; mark a page Exclude from search engines and publish, and it disappears from the file.

If new settings do not show up, check that the story was published: a site that reads the publish branch only sees what has been published from Studio, and the settings live on the story itself.

Pilot documentation. Studio is in a partner pilot. Screens and YAML shown here are current as of the version noted on each page; tell your Maravilla contact when something does not match what you see.