Skip to content

Commit b240154

Browse files
committed
feat(docs): Add Guidance and Documents guides to Ask Fern docs.
1 parent eecb1ed commit b240154

File tree

6 files changed

+112
-19
lines changed

6 files changed

+112
-19
lines changed

fern/apis/fai/definition/document.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ service:
88
base-path: /document
99
endpoints:
1010
createDocument:
11-
docs: Index a document for a given domain
11+
docs: |
12+
Index a document for a given domain. Documents can be used to provide additional context to Ask Fern and improve its accuracy.
1213
path: /{domain}/create
1314
method: POST
1415
audiences:
@@ -111,6 +112,26 @@ service:
111112
- commons.BadRequestError
112113
- commons.InternalError
113114

115+
getDocuments:
116+
docs: Retrieve all paginated documents for a given domain
117+
path: /{domain}
118+
method: GET
119+
audiences:
120+
- customers
121+
path-parameters:
122+
domain:
123+
type: string
124+
docs: The domain to retrieve documents for
125+
request:
126+
name: GetDocumentsRequest
127+
query-parameters:
128+
page: optional<integer>
129+
limit: optional<integer>
130+
response: DocumentList
131+
errors:
132+
- commons.BadRequestError
133+
- commons.InternalError
134+
114135
types:
115136
DocumentIdResponse:
116137
properties:
@@ -129,3 +150,8 @@ types:
129150
authed: optional<boolean>
130151
created_at: datetime
131152
updated_at: datetime
153+
154+
DocumentList:
155+
properties:
156+
documents: list<Document>
157+
pagination: commons.Pagination

fern/apis/fai/definition/guidance.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ service:
88
base-path: /guidance
99
endpoints:
1010
createGuidance:
11-
docs: Index a guidance document for a given domain
11+
docs: |
12+
Create a guidance for a given domain. Guidance can be used to provide additional context to Ask Fern and improve its accuracy.
1213
path: /{domain}/create
1314
method: POST
1415
audiences:

fern/products/ask-fern/ask-fern.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ navigation:
77
href: https://buildwithfern.com/showcase#ask-fern-customers
88
- section: Configuration
99
contents:
10-
- page: Custom prompting
10+
- page: Custom prompts
1111
path: ./pages/configuration/custom-prompting.mdx
12+
- page: Guidance
13+
path: ./pages/features/guidance.mdx
14+
- page: Documents
15+
path: ./pages/features/documents.mdx
1216
- section: Features
1317
contents:
1418
- page: Citations
1519
path: ./pages/features/citations.mdx
16-
- page: Custom Guidance
17-
path: ./pages/features/guidance.mdx
18-
- page: Custom Documents
19-
path: ./pages/features/documents.mdx
2020
- page: Insights
2121
path: ./pages/features/insights.mdx
2222
- page: Evaluation
2323
path: ./pages/features/evals.mdx
2424
- api: API reference
2525
api-name: fai
26-
icon: fa-regular fa-pro
2726
paginated: true
2827
audiences:
2928
- customers
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
---
22
title: Documents
3-
subtitle: Add arbitrary documents to Ask Fern.
3+
subtitle: Add custom data sources to Ask Fern.
44
---
55

6-
You can add arbitrary documents to Ask Fern. This is useful for adding additional content that may improve Ask Fern's accuracy
7-
(such as help desk tickets, internal company FAQs, etc.).
6+
You can index custom documents to Ask Fern beyond your documentation. This is useful for adding additional content that may improve Ask Fern's ability
7+
to support developers, such as help desk tickets, internal company FAQs, etc.
88

99
Fern offers an internal CMS (content management system) via the `documents` API that allows you to add, update,
1010
and delete documents as needed.
11+
12+
## Usage
13+
14+
Here's an example of a document that can be uploaded via the `documents` API:
15+
16+
```json
17+
{
18+
"document": "Ferns are plants native to the tropical and subtropical regions of the world. They are characterized by their fronds, which are large, leaf-like structures that are often found in the understory of forests.",
19+
"title": "What are ferns?",
20+
"url": "https://en.wikipedia.org/wiki/Fern"
21+
}
22+
```
23+
24+
This document will be indexed and made available to Ask Fern as context when users ask questions about ferns.
25+
Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
---
22
title: Custom Guidance
3-
subtitle: Fine-tune your AI search responses.
3+
subtitle: Fine-tune your Ask Fern responses.
44
---
55

6-
You can add custom guidance (FAQs) to "override" Ask Fern's responses to specific user queries.
7-
This is useful for content that you may not wish to display publically, such as billing information,
8-
legal terms, and other sensitive content.
6+
## Overview
7+
8+
You can add custom guidance to "override" Ask Fern's responses to specific user queries. This is useful for content that you
9+
may not want to display explicitly in your documentation, such as billing information, legal terms, and other sensitive content.
10+
11+
Guidance documents consist of a list of `context` texts and a `document` text. The `context` texts will be indexed
12+
to match against user queries. The `document` text will used as a prescribed response to the user query.
13+
14+
## API
915

1016
Fern offers an internal CMS (content management system) via the `guidance` API that allows you to add,
11-
update, and delete FAQs as needed.
17+
update, and delete guidance as needed. You will need to provide your `domain` to specify which deployment of Ask Fern
18+
the updates will be applied to.
19+
20+
## Usage
21+
22+
Below is an example of a guidance document that can be uploaded via the `guidance` API:
23+
24+
```json
25+
{
26+
"context": [
27+
"Who's our favorite engineer at Fern?",
28+
"Who's the best dog!"
29+
],
30+
"document": "Jack!"
31+
}
32+
```
33+
34+
During the retrieval step, when users ask questions that fuzzy-match against any of the `context` texts, the `document` text will be returned
35+
in the tool response and provided to the Agent as context in the form:
36+
37+
```
38+
<GUIDANCE>
39+
In response to the following query:
40+
Who's our favorite engineer at Fern?
41+
42+
You will return an answer based on the following guidance:
43+
Jack!
44+
</GUIDANCE>
45+
```
46+
47+
Ask Fern prioritizes guidance response over other document responses, allowing you to override the default RAG responses.

fern/products/ask-fern/pages/getting-started/what-is-ask-fern.mdx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Ask Fern is Fern's AI Search feature that indexes your documentation and provide
2929
icon="regular book-open"
3030
href="/learn/ai-search/custom-prompting"
3131
>
32-
Tailor Ask Fern results to your users' needs.
32+
Tailor Ask Fern behavior to your users' needs.
3333
</Card>
3434

3535
<Card
@@ -40,20 +40,36 @@ Ask Fern is Fern's AI Search feature that indexes your documentation and provide
4040
Point users to the exact source of the answer.
4141
</Card>
4242

43+
<Card
44+
title="Guidance"
45+
icon="regular fa-question-circle"
46+
href="/learn/ask-fern/features/guidance"
47+
>
48+
Add custom FAQs to Ask Fern.
49+
</Card>
50+
51+
<Card
52+
title="Documents"
53+
icon="regular file-alt"
54+
href="/learn/ask-fern/features/documents"
55+
>
56+
Add custom documents to Ask Fern.
57+
</Card>
58+
4359
<Card
4460
title="Integration with Algolia"
4561
icon="regular plug"
4662
href="/learn/docs/building-and-customizing-your-docs/search"
4763
>
48-
Offer flexibility to have users "Ask AI" or search your docs directly with Algolia.
64+
Users can "Ask AI" or search your docs directly with Algolia.
4965
</Card>
5066

5167
<Card
5268
title="All-in-one platform"
5369
icon="regular fa-layer-group"
5470
href="/learn/docs/getting-started/overview"
5571
>
56-
Create seamless UX by offering a one-stop-shop for all docs questions.
72+
Create seamless UX by offering a one-stop-shop for all API questions.
5773
</Card>
5874

5975
</CardGroup>

0 commit comments

Comments
 (0)