Skip to content
Open
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
34 changes: 33 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,35 @@ 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. No setup is required.

Review agent feedback in the **Agent Feedback** section of the **Feedback** tab in the [Fern Dashboard](https://dashboard.buildwithfern.com/). You can filter by date range and export results to CSV. This surfaces where your documentation falls short for the AI tools your users rely on, so you can find and fix gaps you would otherwise miss.

<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.

```bash Example request
curl -X POST https://fai.buildwithfern.com/agent-feedback/docs.example.com \
-H "Content-Type: application/json" \
-d '{
"page_url": "https://docs.example.com/getting-started",
"message": "Authentication section was clear and complete.",
"agent_name": "Claude",
"sentiment": "positive"
}'
```

</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 report back on your documentation after using it, flagging errors, missing information, or confusing instructions. This surfaces where your docs fall short for the AI tools your users rely on, so you can find and fix gaps you would otherwise never see.

The feedback endpoint is included automatically in the [default page directive](/learn/docs/ai-features/agent-directives) and in `llms.txt` and `llms-full.txt`, so agents discover it with no setup on your part. Review what agents reported in the **Agent Feedback** section of the **Feedback** tab in the [Fern Dashboard](https://dashboard.buildwithfern.com/).

<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/agent-directives#agent-feedback">Read the docs</Button>
8 changes: 6 additions & 2 deletions 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 and how to review all collected feedback in the Dashboard.

## On-page feedback

Expand All @@ -30,7 +30,11 @@ In [self-hosted](/learn/docs/self-hosted/overview) deployments, feedback events

### Viewing feedback in the Dashboard

You can view all on-page [feedback responses](/learn/dashboard/getting-started/overview) in the **Feedback** tab of the [Fern Dashboard](https://dashboard.buildwithfern.com/). The table shows feedback per page, including whether the page was helpful and the reason (if provided), plus channel, location, and date. You can filter by date range and export results to CSV.
The **Feedback** tab of the [Fern Dashboard](https://dashboard.buildwithfern.com/) collects responses from both human visitors and AI agents in separate sections. You can filter either section by date range and export results to CSV.

The **On-Page Feedback** section shows [feedback responses](/learn/dashboard/getting-started/overview) per page, including whether the page was helpful and the reason (if provided), plus channel, location, and date.

The **Agent Feedback** section shows feedback submitted by AI agents through the [agent feedback endpoint](/learn/docs/ai-features/agent-directives#agent-feedback).

## Edit this page

Expand Down
Loading