Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fern/products/docs/pages/ai/llms-txt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ To authenticate your requests, include your API key in the header.
</Accordion>
</AccordionGroup>

## Per-page directives

Use the [`agents` key in `docs.yml`](/learn/docs/configuration/site-level-settings#agents-configuration) to prepend a short instruction to AI agents when they fetch the Markdown version of a page, so they can discover and navigate your full docs. The directive is injected after the frontmatter metadata section but before the page body, so agents see it first even if they truncate the rest of the page. It applies to individual page Markdown (`.md`/`.mdx` URLs) and to each page section within `llms-full.txt`. Human-facing documentation is unaffected.

```yaml docs.yml
agents:
page-directive: "For a complete page index, fetch https://docs.example.com/llms.txt"
```

## Analytics and monitoring

The [Fern Dashboard](https://dashboard.buildwithfern.com/) provides comprehensive analytics for `llms.txt` usage including:
Expand Down
13 changes: 12 additions & 1 deletion fern/products/docs/pages/changelog/2026-04-02.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
---
tags: ["api-reference", "configuration", "docs.yml"]
tags: ["ai", "configuration", "api-reference", "docs.yml"]
---

## Per-page directives in llms.txt

You can add a directive that's automatically prepended to every page when it's served to AI agents — both individual Markdown page URLs and each page section within `llms-full.txt`. The directive is only visible to agents requesting Markdown; human-facing documentation is unaffected.

```yaml docs.yml
agents:
page-directive: "For a complete page index, fetch https://docs.example.com/llms.txt"
```

<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/llms-txt#per-page-directives">Read the docs</Button>

## Library docs generator

Generate MDX documentation pages from your Python or C++ library source code and include them in your Fern Docs site. Configure your libraries in `docs.yml`, run `fern docs md generate`, and the generated pages appear as navigation sections alongside your other documentation.
Expand Down
13 changes: 13 additions & 0 deletions fern/products/docs/pages/customization/site-level-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,19 @@ Specify [Ask Fern](/learn/ask-fern/getting-started/what-is-ask-fern) to control

<Markdown src="/snippets/ask-fern-config.mdx" />

## Agents configuration

Configure directives that are prepended to every page when it's [served to AI agents](/learn/docs/ai-features/llms-txt#per-page-directives).

```yaml docs.yml
agents:
page-directive: "For a complete page index, fetch https://docs.example.com/llms.txt"
```

<ParamField path="agents.page-directive" type="string" required={false} toc={true}>
Text prepended to each page's Markdown output when served to AI agents. The directive is injected after the frontmatter metadata section but before the page body. Human-facing documentation is unaffected.
</ParamField>

## AI examples configuration

Configure [AI-generated examples](/learn/docs/ai-features/ai-examples) for your API Reference pages.
Expand Down
2 changes: 2 additions & 0 deletions fern/products/docs/pages/developer-tools/view-markdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Displaying the page's Markdown helps with troubleshooting layout problems and ma
</Frame>

Fern also bundles your entire site's Markdown into [`llms.txt` and `llms-full.txt`](/learn/docs/ai-features/llms-txt) files for AI consumption. These files use the same underlying Markdown you see when viewing a single page and respect the same `<llms-only>` and `<llms-ignore>` content controls.

You can configure a [per-page directive](/learn/docs/ai-features/llms-txt#per-page-directives) that is automatically prepended to every page's Markdown output when served to AI agents. This is useful for pointing agents to your `llms.txt` index so they can discover the rest of your docs. The directive is only visible to agents — human-facing documentation is unaffected.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'that's' instead of 'that is'.

Loading