This is what an AI/RAG pipeline sees when it indexes this page — the same output served at https://camelmind-docs.vercel.app/api/llms/features/llms-txt.Back to doc

Rendered doc

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.

What the AI sees

1> For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.
2 
3CamelMind can generate an `llms.txt` file that provides AI assistants with a machine-readable version of your published documentation.
4 
5The generated `llms.txt` preserves the structure and content of your documentation while providing AI tools with direct access to your documentation.
6 
7---
8 
9## Enable llms.txt in camelmind.config.ts
10 
11Enable `llms.txt` by setting `ai.llmsTxt.enabled: true` in `camelmind.config.ts`.
12 
13```typescript
14const config: CamelMindConfig = {
15 // ...
16 ai: {
17 llmsTxt: {
18 enabled: true,
19 directive: "For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.",
20 },
21 },
22}
23```
24 
25When enabled, CamelMind generates the `/llms.txt` endpoint and the `/api/llms/<page-slug>` endpoints.
26 
27---
28 
29## Configure the llmsTxt settings
30 
31Use the `llmsTxt` configuration to enable `llms.txt` generation and add optional instructions for AI models.
32 
33| Field | Required | Description |
34| ----------- | -------- | ------------------------------------------------------------------------------------------- |
35| `enabled` | Yes | Set to `true` to activate the `/llms.txt` and `/api/llms` endpoints. |
36| `directive` | No | Additional instructions prepended to the generated output to provide context for AI models. |
37 
38For example:
39 
40```typescript
41llmsTxt: {
42 enabled: true,
43 directive: "For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.",
44}
45```
46 
47---
48 
49## Access the generated llms.txt and API endpoints
50 
51When you enable `llms.txt`, CamelMind exposes two types of endpoints for accessing your documentation.
52 
53| Endpoint | Description |
54| ----------------------- | --------------------------------------------------------------------------- |
55| `/llms.txt` | Plain-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`. |
56| `/api/llms/<page-slug>` | JSON representation of the same documentation content for programmatic use. |
57 
58For example, a page at `/features/llms-txt` is available through:
59 
60```text
61/api/llms/features/llms-txt
62```
63 
64<Callout type="tip">
65If you're building an AI assistant, point it to `https://your-docs-site.com/llms.txt` to give it direct access to your documentation.
66</Callout>
67 
68---
69 
70## Understand what content llms.txt includes
71 
72CamelMind generates `llms.txt` from your published documentation.
73 
74By default, the build includes:
75 
76* Public pages
77* Preserved Markdown formatting
78* Intact code blocks, tables, and headings
79 
80The build excludes role-protected content so that `llms.txt` does not expose private documentation.
81 
82---
83 
84## Exclude page content from llms.txt with LLMIgnore
85 
86Use the `LLMIgnore` MDX component to render content on the documentation page while excluding that content from the generated `llms.txt`.
87 
88```mdx
89 
90```
91 
92Content inside `LLMIgnore` remains visible to human readers but does not appear in `llms.txt`.
93 
94Use `LLMIgnore` for content such as:
95 
96* Internal notes
97* Marketing copy
98* Content that is not useful for AI assistants
99 
100---
101 
102## Add AI-only content with LLMOnly
103 
104Use the `LLMOnly` MDX component to include content in `llms.txt` while hiding that content from the rendered documentation page.
105 
106```mdx
107 
108The Alert component was deprecated in v0.2.0. Use Callout instead.
109 
110```
111 
112Content inside `LLMOnly` is available to AI models through `llms.txt` but is not displayed to human readers on the documentation page.
113 
114Use `LLMOnly` for content such as:
115 
116* Additional context
117* Alternate terminology
118* Migration notes
119* AI-specific guidance
120* Metadata that does not belong in the rendered documentation
121 
122---
123 
124## Understand the generated llms.txt format
125 
126CamelMind generates `llms.txt` as a single Markdown document containing your documentation in reading order.
127 
128A simplified example looks like this:
129 
130```text
131# My Product Documentation
132 
133> You are reading the official documentation...
134 
135---
136 
137## Installation {/* toc:exclude */}
138 
139...
140 
141---
142 
143## Configuration {/* toc:exclude */}
144 
145...
146```
147 
148You can separate pages with horizontal rules while retaining headings, code blocks, and tables in Markdown format.
149 
150When you generate the output, CamelMind converts interactive MDX components into plain text so language models can easily process the content.

Issues (0)

No AI-friendliness issues found.