llms.txt

Configure CamelMind to generate an AI-readable llms.txt file and control which documentation content AI models can access.

CamelMind can generate an llms.txt file that provides AI assistants with a machine-readable version of your published documentation.

The generated llms.txt preserves the structure and content of your documentation while providing AI tools with direct access to your documentation.


Enable llms.txt in camelmind.config.ts

Enable llms.txt by setting ai.llmsTxt.enabled: true in camelmind.config.ts.

typescript
const config: CamelMindConfig = {
  // ...
  ai: {
    llmsTxt: {
      enabled: true,
      directive: "For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.",
    },
  },
}

When enabled, CamelMind generates the /llms.txt endpoint and the /api/llms/<page-slug> endpoints.


Configure the llmsTxt settings

Use the llmsTxt configuration to enable llms.txt generation and add optional instructions for AI models.

FieldRequiredDescription
enabledYesSet to true to activate the /llms.txt and /api/llms endpoints.
directiveNoAdditional instructions prepended to the generated output to provide context for AI models.

For example:

typescript
llmsTxt: {
  enabled: true,
  directive: "For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.",
}

Access the generated llms.txt and API endpoints

When you enable llms.txt, CamelMind exposes two types of endpoints for accessing your documentation.

EndpointDescription
/llms.txtPlain-text version of your documentation for AI assistants and developers. If your site has multiple versions, each version has its own index at /{version}/llms.txt (for example, /v2/llms.txt), generated from that version's nav.yml.
/api/llms/<page-slug>JSON representation of the same documentation content for programmatic use.

For example, a page at /features/llms-txt is available through:

text
/api/llms/features/llms-txt
Tip

If you're building an AI assistant, point it to https://your-docs-site.com/llms.txt to give it direct access to your documentation.


Understand what content llms.txt includes

CamelMind generates llms.txt from your published documentation.

By default, the build includes:

  • Public pages
  • Preserved Markdown formatting
  • Intact code blocks, tables, and headings

The build excludes role-protected content so that llms.txt does not expose private documentation.


Exclude page content from llms.txt with LLMIgnore

Use the LLMIgnore MDX component to render content on the documentation page while excluding that content from the generated llms.txt.

mdx
<LLMIgnore>

Internal implementation details for human readers.

</LLMIgnore>

Content inside LLMIgnore remains visible to human readers but does not appear in llms.txt.

Use LLMIgnore for content such as:

  • Internal notes
  • Marketing copy
  • Content that is not useful for AI assistants

Add AI-only content with LLMOnly

Use the LLMOnly MDX component to include content in llms.txt while hiding that content from the rendered documentation page.

mdx
<LLMOnly>

The Alert component was deprecated in v0.2.0. Use Callout instead.

</LLMOnly>

Content inside LLMOnly is available to AI models through llms.txt but is not displayed to human readers on the documentation page.

Use LLMOnly for content such as:

  • Additional context
  • Alternate terminology
  • Migration notes
  • AI-specific guidance
  • Metadata that does not belong in the rendered documentation

Understand the generated llms.txt format

CamelMind generates llms.txt as a single Markdown document containing your documentation in reading order.

A simplified example looks like this:

text
# My Product Documentation

> You are reading the official documentation...

---

## Installation {/* toc:exclude */}

...

---

## Configuration {/* toc:exclude */}

...

You can separate pages with horizontal rules while retaining headings, code blocks, and tables in Markdown format.

When you generate the output, CamelMind converts interactive MDX components into plain text so language models can easily process the content.

September 10, 2026
Was this page helpful?