diff --git a/fern/products/docs/docs.yml b/fern/products/docs/docs.yml index 469566b9b..0c26d5880 100644 --- a/fern/products/docs/docs.yml +++ b/fern/products/docs/docs.yml @@ -192,6 +192,9 @@ navigation: - page: Slack app path: ./pages/ask-fern/slack-app.mdx slug: slack-app + - page: Discord bot + path: ./pages/ask-fern/discord-bot.mdx + slug: discord-bot - api: API reference api-name: fai paginated: true diff --git a/fern/products/docs/pages/ai/overview.mdx b/fern/products/docs/pages/ai/overview.mdx index 0c4447d6c..49e7d24cc 100644 --- a/fern/products/docs/pages/ai/overview.mdx +++ b/fern/products/docs/pages/ai/overview.mdx @@ -6,11 +6,12 @@ Your documentation site comes with automatic optimizations for AI tools, plus fe ## Find answers -Users can chat with Ask Fern to get instant answers from your documentation. It's available as an embedded chat widget, via the [API](/learn/docs/ai-features/ask-fern/api-reference/overview) for custom integrations, and as a [Slack app](/learn/docs/ai-features/ask-fern/slack-app) for your community workspace. Ask Fern understands context and provides citations so users can verify information and explore further. +Users can chat with Ask Fern to get instant answers from your documentation. It's available as an embedded chat widget, via the [API](/learn/docs/ai-features/ask-fern/api-reference/overview) for custom integrations, and as a [Slack app](/learn/docs/ai-features/ask-fern/slack-app) or [Discord bot](/learn/docs/ai-features/ask-fern/discord-bot) for your community workspace. Ask Fern understands context and provides citations so users can verify information and explore further. - + + diff --git a/fern/products/docs/pages/ask-fern/assets/allow-discord-permissions.png b/fern/products/docs/pages/ask-fern/assets/allow-discord-permissions.png new file mode 100644 index 000000000..58e0537d5 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/allow-discord-permissions.png differ diff --git a/fern/products/docs/pages/ask-fern/assets/allow-discord.png b/fern/products/docs/pages/ask-fern/assets/allow-discord.png new file mode 100644 index 000000000..91afc7089 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/allow-discord.png differ diff --git a/fern/products/docs/pages/ask-fern/assets/config-saved-discord.png b/fern/products/docs/pages/ask-fern/assets/config-saved-discord.png new file mode 100644 index 000000000..bc109e8f3 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/config-saved-discord.png differ diff --git a/fern/products/docs/pages/ask-fern/assets/enable-ask-fern-dashboard.png b/fern/products/docs/pages/ask-fern/assets/enable-ask-fern-dashboard.png new file mode 100644 index 000000000..32c7e93c1 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/enable-ask-fern-dashboard.png differ diff --git a/fern/products/docs/pages/ask-fern/assets/members-list-discord.png b/fern/products/docs/pages/ask-fern/assets/members-list-discord.png new file mode 100644 index 000000000..a3e683937 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/members-list-discord.png differ diff --git a/fern/products/docs/pages/ask-fern/assets/set-config-discord.png b/fern/products/docs/pages/ask-fern/assets/set-config-discord.png new file mode 100644 index 000000000..5909e9ff3 Binary files /dev/null and b/fern/products/docs/pages/ask-fern/assets/set-config-discord.png differ diff --git a/fern/products/docs/pages/ask-fern/discord-bot.mdx b/fern/products/docs/pages/ask-fern/discord-bot.mdx new file mode 100644 index 000000000..cba88d3ca --- /dev/null +++ b/fern/products/docs/pages/ask-fern/discord-bot.mdx @@ -0,0 +1,129 @@ +--- +title: Ask Fern Discord bot +description: Enable your customers to get instant answers to product questions directly in Discord using Ask Fern's AI-powered documentation bot. +--- + + + Ask Fern is also available for Slack. See the [Slack app documentation](/learn/docs/ai-features/ask-fern/slack-app) for setup instructions. + + +The Ask Fern Discord bot allows customers to ask questions about your products directly in Discord channels and receive AI-generated answers from your documentation database. + +Fern stores all questions and answers from Discord interactions for [analytics purposes](/learn/docs/ai-features/ask-fern/features#analytics). + +## Setup + +Install the Ask Fern bot in your Discord server and configure it for your channels. + + + To install Ask Fern in your Discord server, you must have **Manage Server** permissions. This is set in **Server Settings > People > Roles**. + + + + + +Before installing the Discord bot, you need to enable Ask AI for your documentation site. + +Go to your [Fern Dashboard](https://dashboard.buildwithfern.com) and enable Ask AI in the "Settings" tab of your domain. For more advanced configuration instructions, see the [Ask Fern setup guide](https://buildwithfern.com/learn/docs/ai-features/ask-fern/setup). + + Enable Ask Fern in your dashboard + + + + +Use the [API Explorer](/learn/docs/ai-features/ask-fern/api-reference/discord/create-discord-integration) to get a unique Discord installation link for your organization. + +You will need: +- Your [Fern token](/learn/cli-api-reference/cli-reference/commands#fern-token) +- Your domain without protocol or path (e.g., `website.com`, not `https://website.com/docs`) + +You can alternatively use this cURL request: +```bash +curl -X POST "https://fai.buildwithfern.com/discord/install?domain=" \ + -H "Authorization: Bearer " +``` + +Follow the URL returned in the `integration_url` response field. + + + +You'll be redirected to Discord to authorize the Ask Fern bot. Select the server where you want to add Ask Fern and click **Authorize**. + + Allow Ask Fern for Discord server + + + + +Once the bot is added to your server, use the `/configure` slash command in each channel where you want the bot to respond. Without this configuration, the bot won't respond to messages in that channel. + + Configure bot by channel in Discord + + + + +## Configuration + +Customize the bot's behavior to match your workflow needs. + +### Bot settings per channel + +Use the `/configure` slash command in any channel to adjust the settings. This opens an interactive menu where you can configure: + +| Setting | Description | +|---------|-------------| +| **Response mode** | Controls whether the bot responds only when directly mentioned with `@Ask Fern` (`mentions_only`) or automatically responds to questions while ignoring casual chat (`auto`). | +| **Help role** | Optionally select a role or user to tag when users click the "Ask for help" button on bot responses. | + +After selecting your preferences, click **Save Configuration** to apply the changes. + + Config set success message in Discord + +### Customize the bot name + +You can rename the bot to match your brand (example: "YourCompanyName Support"): + + + To rename your Bot, you must have **Change Nickname** permissions. This is set in Server **Settings > People > Roles** + + + + Go to the Members List section at the top of the Discord server + + Discord members list + + + + Right click the AskFern bot and select "Change Nickname" + + + Enter your preferred bot name and click "Save" + + +Now, users will see your custom bot name instead of the default "Ask Fern" name. + +## Architecture + +When a user asks Ask Fern a question in Discord, the bot receives the message and triggers Fern's servers to search your documentation database and retrieve relevant context. Using that context, Ask Fern generates a response and replies in a thread. + + +```mermaid +sequenceDiagram + autonumber + participant U as User (Discord) + participant D as Discord Bot + participant F as Fern Servers + participant V as Documentation Database + participant A as Ask Fern + + U->>D: Ask question to @Ask Fern + D->>F: Forward message to Fern servers + F->>F: Convert query to vector + F->>V: Search for relevant chunks + V->>F: Return matching documents + F->>A: Send query + context + A->>A: Generate response + A->>D: Return answer + D->>U: Reply in Discord thread + F->>F: Store question and answer for analytics +``` + diff --git a/fern/products/docs/pages/ask-fern/slack-app.mdx b/fern/products/docs/pages/ask-fern/slack-app.mdx index fdf007b9f..27b80bf5f 100644 --- a/fern/products/docs/pages/ask-fern/slack-app.mdx +++ b/fern/products/docs/pages/ask-fern/slack-app.mdx @@ -4,7 +4,7 @@ description: Enable your customers to get instant answers to product questions d --- - Ask Fern is also available for Discord. Contact support@buildwithfern.com for more information. + Ask Fern is also available for Discord. See the [Discord bot documentation](/learn/docs/ai-features/ask-fern/discord-bot) for setup instructions. The Ask Fern Slack app allows customers to ask questions about your products directly in Slack channels and receive AI-generated answers from your documentation database. diff --git a/fern/snippets/ask-fern-config.mdx b/fern/snippets/ask-fern-config.mdx index 7c1b73b16..fd84d08d3 100644 --- a/fern/snippets/ask-fern-config.mdx +++ b/fern/snippets/ask-fern-config.mdx @@ -2,7 +2,6 @@ ai-search: location: - docs - - slack - discord datasources: - url: https://example.com/additional-docs @@ -22,8 +21,8 @@ ai-search: - `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`. See the [Slack app documentation](/learn/docs/ai-features/ask-fern/slack-app) for Slack setup instructions. For Discord setup, reach out to support@buildwithfern.com. - + Most users should enable Ask Fern for both `docs` and either `slack` ([setup instructions](/learn/docs/ai-features/ask-fern/slack-app)) or `discord` ([setup instructions](/learn/docs/ai-features/ask-fern/discord-bot)). + Coming soon