Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 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
23 changes: 22 additions & 1 deletion fern/products/docs/pages/ai/llms-txt/directives.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Configure the default directive prepended to every page served to A
Every page served to AI agents is automatically prepended with a default directive that tells agents how to navigate your documentation programmatically:

```text title="Default page directive" wordWrap
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.example.com/llms.txt. For full documentation content, see https://docs.example.com/llms-full.txt.
For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.example.com/llms.txt. For full documentation content, see https://docs.example.com/llms-full.txt. For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.example.com/_mcp/server. To submit feedback about these docs, POST to https://fai.buildwithfern.com/agent-feedback/docs.example.com with JSON body: { "page_url": "string", "message": "string", "agent_name": "string", "sentiment": "positive" | "negative" }.
```

The URLs in the directive are generated from your site's domain and basepath. 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`, and human-facing documentation is unaffected.
Expand All @@ -26,3 +26,24 @@ To disable the directive entirely, set `page-directive` to an empty string:
agents:
page-directive: ""
```

## Agent feedback

The directive invites agents to submit feedback after consuming your documentation. Agents report **positive** sentiment when a page helped complete a task, or **negative** sentiment for errors, missing information, or confusing instructions. This is automatic, and no setup is required.

You don't need to call the feedback endpoint yourself. The following reference describes what agents send.

<Accordion title="Feedback endpoint reference">

Agents POST JSON to `https://fai.buildwithfern.com/agent-feedback/{domain}`, where `{domain}` is your documentation site's domain (e.g., `docs.example.com`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page_url` | `string` | Conditional | The documentation page URL the feedback is about. |
| `message` | `string` | Conditional | Free-text feedback from the agent. |
| `agent_name` | `string` | No | Agent name or identifier. |
| `sentiment` | `"positive"` \| `"negative"` | No | Feedback sentiment. |

At least one of `page_url` or `message` must be present. `message` and `page_url` are truncated to 2,000 characters and `agent_name` to 100, and requests are rate-limited to 10 per minute and 100 per day per IP address.

</Accordion>
5 changes: 4 additions & 1 deletion fern/products/docs/pages/ai/llms-txt/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The two files differ:

## Learn more

<CardGroup cols={3}>
<CardGroup cols={2}>
<Anchor id="custom-files">
<Card title="Customize LLM output" icon="sliders" href="/learn/docs/ai-features/customize-llm-output">
Exclude pages, filter content with tags, or serve your own custom files.
Expand All @@ -82,5 +82,8 @@ The two files differ:
<Card title="Analytics and integration" icon="chart-line" href="/learn/docs/ai-features/llms-txt-analytics">
Track LLM traffic and surface `llms.txt` endpoints to readers.
</Card>
<Card title="Agent feedback" icon="message-lines" href="/learn/docs/ai-features/agent-directives#agent-feedback">
Collect structured feedback from AI agents about documentation quality.
</Card>
</CardGroup>

1 change: 1 addition & 0 deletions fern/products/docs/pages/ai/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ Your site is automatically optimized for AI tools and search engines. Fern hosts
<Card title="`llms.txt`" icon="file-text" href="/learn/docs/ai-features/llms-txt" />
<Card title="Agent directives" icon="compass" href="/learn/docs/ai-features/agent-directives" />
<Card title="API catalog discovery" icon="radar" href="/learn/docs/ai-features/api-catalog" />
<Card title="Agent feedback" icon="message-lines" href="/learn/docs/ai-features/agent-directives#agent-feedback" />
</CardGroup>
11 changes: 11 additions & 0 deletions fern/products/docs/pages/changelog/2026-06-05.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
tags: ["ai-features"]
---

## Agent feedback

AI agents can now submit structured feedback about your documentation. Fern automatically includes a feedback endpoint in the [default page directive](/learn/docs/ai-features/agent-directives) and in `llms.txt` and `llms-full.txt`, so agents discover it without any setup.

Agents report whether documentation was helpful (positive sentiment) or encountered issues like missing information or confusing instructions (negative sentiment). Feedback is collected per-domain with rate limiting.

<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/agent-directives#agent-feedback">Read the docs</Button>
2 changes: 1 addition & 1 deletion fern/products/docs/pages/customization/user-feedback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Collect on-page feedback and enable edit suggestions from users in
---


Fern offers a variety of ways to track feedback and suggested improvements from users.
Fern collects feedback from human visitors through on-page widgets and edit suggestions, and from AI agents through a dedicated [feedback endpoint](/learn/docs/ai-features/agent-directives#agent-feedback). This page covers the human-facing options.

## On-page feedback

Expand Down
Loading