---
title: "llms.txt Generation"
description: "Configure llms.txt and llms-full.txt output for AI discovery."
canonical_url: "https://nuxtseo.com/docs/ai-ready/guides/llms-txt"
last_updated: "2026-09-25T17:47:53.535Z"
---

Nuxt AI Ready publishes `/llms.txt` as a page index and `/llms-full.txt` as a full-content export.
Prerendering writes static files. On a server, the runtime handlers use stored pages and sitemap data.
The [llms.txt proposal](https://llmstxt.org/) defines the index format, but does not define the full-content export.

## `/llms.txt`

Use this file to give agents a site overview and links to relevant pages.

Live example: [nuxtseo.com/llms.txt](https://nuxtseo.com/llms.txt)

```txt
# <Site Title>

> <Site Description>

Canonical Origin: https://example.com

**Notes:**

<Notes>

## <Section Title>

- [Link Title](/link): Description
  ...

## Pages

- [Page Title](/page-link): Meta Description
  ...
```

### Configuration

Add custom sections:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  aiReady: {
    llmsTxt: {
      markdownLinks: true,
      sections: [
        {
          title: 'API Reference',
          links: [
            { title: 'REST API', href: '/docs/api', description: 'API documentation' }
          ]
        }
      ],
      notes: 'Built with Nuxt AI Ready'
    }
  }
})
```

Full config: [Configuration](/docs/ai-ready/api/config)

Link descriptions appear after each link on the same line.
Section descriptions and `notes` appear before the first H2.
Sections marked `optional` share one `## Optional` list. Their descriptions become part of each link note.

Page links use canonical URLs by default.
Set `markdownLinks: true` to link to available static Markdown files or eligible runtime Markdown routes.
File-like, internal, ignored, or skipped routes keep their canonical URLs.

### Hook

Modify sections before generation:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'ai-ready:llms-txt': (payload) => {
      payload.sections.push({
        title: 'Custom APIs',
        links: [{ title: 'Search', href: '/api/search', description: 'Search endpoint' }]
      })
      payload.notes.push('Custom note')
    }
  }
})
```

Hook details: [Nuxt Hooks](/docs/ai-ready/api/nuxt-hooks#ai-readyllms-txt)

## `/llms-full.txt`

During prerendering, the module appends each processed page to this export.
At runtime, the server streams pages from the database. An empty database produces a setup notice.

`llms-full.txt` is not part of the llms.txt proposal. Nuxt AI Ready uses a thematic break and a compact metadata list to identify each source page, then preserves that page's original Markdown headings and fenced content:

```md [llms-full.txt]
# Example Site

> Example description.

Canonical Origin: https://example.com

---

- **Page:** Installation
- **Source:** https://example.com/installation
- **Description:** Install the package.

# Installation

## Requirements
```

Each page keeps its own headings. The export can therefore contain several H1 headings.

Use the Nuxt `ai-ready:page:markdown` hook to append information during prerendering:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'ai-ready:page:markdown': (ctx) => {
      ctx.markdown += `\n\nSource route: ${ctx.route}`
    }
  }
})
```

## Page Discovery

Prerendering collects rendered pages first. A sitemap crawl can add routes that were not prerendered.

### Phase 1: Prerender Crawl

During `nuxi generate`, the module intercepts each prerendered page:

1. The module queues a Markdown route for each eligible rendered page.
2. The middleware reads content source or converts rendered HTML.
3. The Nuxt `ai-ready:page:markdown` hook runs.
4. Page data enters [SQLite](https://sqlite.org) and content is appended to `llms-full.txt`.

Prerendered pages have full metadata (title, description, headings).

### Phase 2: Sitemap Crawl

After prerendering completes, the module crawls `/sitemap.xml` for any pages not already processed:

- Uses `sitemap:prerender:done` when the sitemap is prerendered.
- Otherwise, fetches the sitemap during `prerender:done`.
- Requests Markdown for eligible sitemap routes not already processed.
- Stores those pages in SQLite without adding them to the static `llms-full.txt`.

This catches SSR-only pages that weren't prerendered.

### Runtime Fallback

The runtime handler combines stored page metadata with URLs from the sitemap.
Stored pages provide titles and descriptions. Sitemap-only entries provide routes until indexing adds their metadata.
If the database is unavailable, `llms.txt` falls back to sitemap URLs and logs the failure.

Configure [runtime indexing](/docs/ai-ready/guides/runtime-indexing) to populate stored content on a server.
Page visits alone do not populate the index.

## Customizing Page Processing

### Filter or Modify Pages

Use the Nuxt hook to omit a page's content from the static full export:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'ai-ready:page:markdown': (ctx) => {
      if (ctx.route.startsWith('/drafts/'))
        ctx.markdown = ''
    },
  },
})
```

An empty body skips the page in the static `llms-full.txt` export.
Its stored page record remains. This hook does not make a page private or remove its URL from `llms.txt`.

Context properties:

- `route`: Page path (e.g., `/about`)
- `markdown`: Converted content (mutable)
- `title`: Extracted `<title>`{lang="html"}
- `description`: Extracted meta description
- `headings`: Extracted heading records, such as `{ h2: 'Installation' }`

### Modify Markdown Conversion

These Nitro conversion hooks run for runtime HTML-to-Markdown requests.
They do not run for content-source responses or manual indexing conversion.

Use the `ai-ready:mdreamConfig` Nitro hook to customize HTML → markdown:

```ts [server/plugins/mdream.ts]
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('ai-ready:mdreamConfig', (config) => {
    config.filter = {
      ...config.filter,
      exclude: [...(config.filter?.exclude || []), '.sidebar', '.footer'],
    }
  })
})
```

### Post-Process Markdown at Runtime

Use the `ai-ready:page:markdown` Nitro hook for runtime `.md` requests:

```ts [server/plugins/markdown.ts]
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('ai-ready:page:markdown', (ctx) => {
    ctx.markdown += `\n\n---\nSource: ${ctx.route}`
  })
})
```

## Sitemap Requirements

Nuxt AI Ready installs `@nuxtjs/sitemap` as a module dependency.
Keep your sitemap current so discovery can find routes that are not already stored.

Use the sitemap `exclude` option to remove URLs from sitemap discovery:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  sitemap: {
    exclude: ['/admin/**', '/api/**', '/drafts/**'],
  },
})
```

Excluding a URL from the sitemap does not delete a page already stored by prerendering or manual indexing.
Do not put private content in the public page index. Use application access controls for private routes.

## Dev Mode

In development, `llms.txt` can list sitemap URLs and any stored page metadata.
If no stored pages exist, it includes a hint about generating page titles.
Runtime `.md` routes work in development, so you can inspect conversion before building.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
