mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
57 lines
3.1 KiB
Plaintext
57 lines
3.1 KiB
Plaintext
---
|
|
title: "llms.txt"
|
|
description: "Optimize your docs for LLMs to read and index."
|
|
keywords: ["llms.txt", "LLM indexing", "AEO", "GEO", "content discovery"]
|
|
---
|
|
|
|
import { PreviewButton } from "/snippets/previewbutton.jsx"
|
|
|
|
The [llms.txt file](https://llmstxt.org) is an industry standard that helps LLMs index content more efficiently, similar to how a sitemap helps search engines. AI tools can use this file to understand your documentation structure and find content relevant to user queries.
|
|
|
|
Mintlify automatically hosts an `llms.txt` file at the root of your project that lists all available pages in your documentation. This file is always up to date and requires zero maintenance. You can optionally add a custom `llms.txt` file to the root of your project.
|
|
|
|
<Note>
|
|
If your site requires authentication to access your documentation, your `llms.txt` and `llms-full.txt` files are not available to LLMs and AI tools. LLMs and AI tools can only index publicly available content.
|
|
</Note>
|
|
|
|
View your `llms.txt` by appending `/llms.txt` to your documentation site's URL.
|
|
|
|
<PreviewButton href="https://mintlify.com/docs/llms.txt">Open the llms.txt for this site.</PreviewButton>
|
|
|
|
## llms.txt structure
|
|
|
|
An `llms.txt` file is a plain Markdown file that contains:
|
|
|
|
- **Site title** as an H1 heading.
|
|
- **Structured content sections** with links and a description of each page in your documentation.
|
|
|
|
Pages are listed alphabetically in the order they appear in your repository, starting from the root directory.
|
|
|
|
Each page's description comes from the `description` field in its frontmatter. Pages without a `description` field appear in the `llms.txt` file without a description.
|
|
|
|
```mdx Example llms.txt
|
|
# Site title
|
|
|
|
## Docs
|
|
|
|
- [API](https://example.com/docs/api): Endpoint list and usage
|
|
- [Install](https://example.com/docs/install): Setup steps
|
|
- [Getting started](https://example.com/docs/start): Intro guide
|
|
```
|
|
|
|
This structured approach allows LLMs to efficiently process your documentation at a high level and locate relevant content for user queries, improving the accuracy and speed of AI-assisted documentation searches.
|
|
|
|
## llms-full.txt
|
|
|
|
The `llms-full.txt` file combines your entire documentation site into a single file as context for AI tools and is indexed by LLM traffic.
|
|
|
|
Mintlify automatically hosts an `llms-full.txt` file at the root of your project. View your `llms-full.txt` by appending `/llms-full.txt` to your documentation site's URL.
|
|
|
|
<PreviewButton href="https://mintlify.com/docs/llms-full.txt">Open the llms-full.txt for this site.</PreviewButton>
|
|
|
|
## Custom files
|
|
|
|
To add a custom `llms.txt` or `llms-full.txt` file, create an `llms.txt` or `llms-full.txt` file at the root of your project. Adding a custom file will override the automatically generated file of the same name. If you delete a custom file, the default file will be used again.
|
|
|
|
Your custom `llms.txt` or `llms-full.txt` file must have a site title as an H1 heading. Other content is optional. See [Format](https://llmstxt.org/#format) in the `llms.txt` specification for more information on optional sections and best practices.
|