Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ redirects:
destination: /learn/ask-fern/features/citations
- source: /learn/ask-fern/custom-prompting
destination: /learn/ask-fern/configuration/custom-prompts
- source: /learn/ask-fern/configuration/locations-and-datasources
destination: /learn/ask-fern/configuration/setup

# General Ask Fern patterns
- source: /learn/ai-search/getting-started/:slug*
Expand Down
5 changes: 3 additions & 2 deletions fern/products/ask-fern/ask-fern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ navigation:
href: https://buildwithfern.com/showcase#ask-fern-customers
- section: Configuration
contents:
- page: Setup
path: ./pages/configuration/locations-and-datasources.mdx
slug: setup
- page: Custom prompts
path: ./pages/configuration/custom-prompting.mdx
- page: Locations and datasources
path: ./pages/configuration/locations-and-datasources.mdx
- page: Guidance
path: ./pages/features/guidance.mdx
- page: Documents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,83 +1,19 @@
---
title: Locations and datasources
title: Setup
subtitle: Configure where Ask Fern is available and what content it can access.
---

Ask Fern can be configured to appear in multiple locations and pull content from various datasources. This allows you to provide AI-powered assistance wherever your users need it and ensure access to relevant information.
## Basic setup

## Locations

The `location` field in your `ai-search` configuration determines where Ask Fern will be available to your users. You can specify one or more locations:
Enable Ask Fern by adding the `ai-search` configuration to your `docs.yml` file:

```yaml docs.yml
ai-search:
location:
- docs
- slack
- discord
```

### Available locations

<ParamField path="docs" type="string">
Enables Ask Fern on your documentation site. Users will see the AI search interface directly in your docs.
</ParamField>

<ParamField path="slack" type="string">
Enables Ask Fern in Slack. Learn more about the [Slack app integration](/ask-fern/features/slack-app).
</ParamField>

<ParamField path="discord" type="string">
Enables Ask Fern in Discord. This allows your community to get AI-powered answers in your Discord server.
</ParamField>

## Datasources (coming soon)

The `datasources` field allows you to specify additional content sources that Ask Fern should index and search. This is useful when you want to include content from external websites or documentation that isn't part of your main docs.

```yaml docs.yml
ai-search:
datasources:
- url: https://example.com/additional-docs
title: Additional Documentation
- url: https://blog.example.com
title: Company Blog
```

### Website datasources

<ParamField path="url" type="string" required>
The URL of the website to index. Ask Fern will crawl and index the content from this URL.
</ParamField>

<ParamField path="title" type="string">
An optional display name for this datasource. This helps users understand where the information is coming from when Ask Fern cites content from this source.
</ParamField>

## Preview environments

Setting `location: [docs]` enables Ask Fern on preview deployments generated with `fern generate --docs --preview`, allowing you to test the AI search functionality before publishing to production.

<Note>
Preview environments don't interfere with your production Ask Fern deployment.
</Note>

## Best practices

<AccordionGroup>
<Accordion title="Start with docs location">
Begin by enabling Ask Fern on your documentation site (`location: [docs]`) to test and refine the experience before expanding to other channels like Slack or Discord.
</Accordion>

<Accordion title="Use descriptive titles for datasources">
Always provide a `title` for your datasources. This helps users understand the source of information when Ask Fern provides citations.
</Accordion>

<Accordion title="Keep datasources relevant">
Only include datasources that contain information relevant to your users' questions. Too many datasources can dilute the quality of search results.
</Accordion>
## Configuration

<Accordion title="Test with previews">
Use preview deployments to test your Ask Fern configuration, including locations and datasources, before deploying to production.
</Accordion>
</AccordionGroup>
<Markdown src="/snippets/ask-fern-config.mdx" />
34 changes: 25 additions & 9 deletions fern/products/ask-fern/pages/getting-started/what-is-ask-fern.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ description: Let your customers find answers in your documentation instantly.

Ask Fern is Fern's AI Search feature that indexes your documentation and provides an interface for your end users to ask questions and get answers. It appears as a side panel on your documentation site so users can ask questions without leaving the page.

You can turn Ask Fern on or off via the [Fern Dashboard](https://dashboard.buildwithfern.com/).

<Frame>
<video
style={{ aspectRatio: '16 / 9', width: '100%' }}
Expand All @@ -24,9 +22,27 @@ Ask Fern helps you:
- **Accelerate user onboarding** – Help users integrate your product faster by surfacing relevant code samples and guides.
- **Identify documentation gaps** – Understand where your docs need improvement through user search patterns and feedback.

## Get started

## Quickstart

Enable Ask Fern in your [`docs.yml` file](/learn/ask-fern/configuration/setup):

```yaml docs.yml
ai-search:
location:
- docs
- slack # or discord
```

<CardGroup cols={2}>
<Card
title="Setup"
icon="regular lightbulb"
href="/learn/ask-fern/configuration/setup"
>
Configure locations and additional data sources.
</Card>

<Card
title="How it works"
icon="regular lightbulb"
Expand All @@ -35,6 +51,12 @@ Ask Fern helps you:
Learn about Ask Fern's interface, behavior, and technical architecture.
</Card>

</CardGroup>

## Features

<CardGroup cols={2}>

<Card
title="Custom prompting"
icon="regular book-open"
Expand All @@ -43,12 +65,6 @@ Ask Fern helps you:
Write custom prompts to improve accuracy and tailor responses for your users.
</Card>

</CardGroup>

## Features

<CardGroup cols={2}>

<Card
title="Analytics"
icon="regular fa-chart-simple"
Expand Down
6 changes: 6 additions & 0 deletions fern/products/docs/pages/customization/what-is-docs-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,12 @@ analytics:
Your PostHog project API key. Defaults to the api-host of "https://us.i.posthog.com".
</ParamField>

## Ask Fern configuration

Specify [Ask Fern](/learn/ask-fern/getting-started/what-is-ask-fern) to control where it appears and what content it can access.

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

## Dynamic snippets configuration

By default, SDK snippets are static code examples that are displayed in your API Reference. Alternatively, you can use dynamic SDK snippets that allow users to modify parameters and see code examples update in real time.
Expand Down
33 changes: 33 additions & 0 deletions fern/snippets/ask-fern-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
```yaml docs.yml
ai-search:
location:
- docs
- slack
- discord
datasources:
- url: https://example.com/additional-docs
title: Additional documentation
- url: https://blog.example.com
title: Company blog
```

<ParamField path="ai-search.location" type="list of strings" required={false} toc={true}>
Specifies where Ask Fern will be available. Options:
- `docs` enables Ask Fern on your documentation site
- `slack` enables Ask Fern in Slack
- `discord` enables Ask Fern in Discord

Most users should enable Ask Fern for both `docs` and either `slack` or `discord`.
</ParamField>

<ParamField path="ai-search.datasources" type="list of objects" required={false} toc={true}>
Additional content sources that Ask Fern should index and search.
</ParamField>

<ParamField path="datasources.url" type="string" required={true}>
The URL of the website to index. Ask Fern will crawl and index the content from this URL.
</ParamField>

<ParamField path="datasources.title" type="string">
An optional display name for this datasource. This helps users understand where the information is coming from when Ask Fern cites content from this source.
</ParamField>
Loading