Skip to content

Commit 09d28cb

Browse files
ethanpalmcdxker
andauthored
Agent docs (mintlify#1351)
* update Slack app naming * add agent page to nav * create agent page * add to common workflows * remove passive voice * add API workflow example * add Slack to header exceptions * revise intro * adjust header depth for ToC * clean up the prompts section * add into to workflows section * add broad examples * update example workflows * 💅 * add steps for connecting repos * clean up some TODOs * edit intro * feature: rough draft of discovery agent routes. Copy is prone to change just copy / pasted * feature: finalized rough draft of api spec. Cleaned up copy on the api reference page * alphabetize endpoint groups * writer -> agent * add links to endpoint pages * 💅 * add rate limit info * spacing * update availability * concision * update access requirements --------- Co-authored-by: cdxker <[email protected]> Co-authored-by: cdxker <[email protected]>
1 parent 58eee2e commit 09d28cb

File tree

8 files changed

+423
-5
lines changed

8 files changed

+423
-5
lines changed

.vale/styles/Google/Headings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ exceptions:
3030
- PDF
3131
- SAML
3232
- SDK
33+
- Slack
3334
- SSL
3435
- SSO
3536
- TLS

ai/agent.mdx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "Agent"
3+
description: "The agent helps you write and maintain documentation"
4+
icon: "pen-line"
5+
---
6+
7+
<Info>
8+
The agent is available on [Pro and Custom plans](https://mintlify.com/pricing?ref=agent) for anyone with access to your dashboard.
9+
</Info>
10+
11+
The agent creates pull requests with proposed changes to your documentation based on your prompts. When you send a request to the agent, it references your documentation, connected repositories, and Slack messages to create content that follows technical writing best practices and adheres to the Mintlify schema. Access the agent in your Slack workspace or embed it in custom applications with the API.
12+
13+
Use the agent to:
14+
15+
- Write new content based on your prompts, links to pull requests, or Slack threads
16+
- Revise outdated code examples and API references
17+
- Search and update existing content
18+
- Answer questions about your docs and technical writing topics
19+
20+
To get started, add the agent to your Slack workspace and mention it with `@mintlify` in a channel.
21+
22+
## Add the agent to your Slack workspace
23+
24+
<Note>
25+
If your Slack Workspace Owner requires admin approval to install apps, ask them to approve the mintlify app before you connect it.
26+
</Note>
27+
28+
1. Navigate to the [agent](https://dashboard.mintlify.com/products/agent) page of your dashboard.
29+
2. Select the **Connect** button.
30+
3. Follow the Slack prompts to add the `mintlify` app to your workspace.
31+
4. Follow the Slack prompts to link your Mintlify account to your Slack workspace.
32+
5. Test that the agent is working and responds when you:
33+
- Send a direct message to it.
34+
- Mention it with `@mintlify` in a channel.
35+
36+
## Connect repositories as context
37+
38+
The agent can only access repositories that you connect through the Mintlify GitHub App. Modify which repositories the agent can access in the [GitHub App settings](https://github.com/apps/mintlify/installations/new).
39+
40+
## Embed the agent via API
41+
42+
The agent endpoints can be used to [create jobs](/api-reference/agent/create-agent-job), [get a specific job](/api-reference/agent/get-agent-job), and [get all jobs](/api-reference/agent/get-all-jobs).
43+
44+
## Write effective prompts
45+
46+
Think of the agent as a helpful assistant that needs your guidance to complete tasks. Give it clear instructions and context. More focused tasks are easier to complete, so break down complex projects into smaller steps.
47+
48+
Make your prompts specific and outcome-focused. Generic prompts like `@mintlify Improve the onboarding page` apply general best practices, but may not improve content in the specific way that you were picturing.
49+
50+
Try prompts based on outcomes you want your users to achieve or problems that they encounter. For example: `@mintlify A lot of users have trouble installing the CLI. Review the onboarding page and update the docs so that users can easily install the CLI` or `@mintlify Developers keep getting 401 errors when following our authentication guide. Review the auth docs and add clearer examples showing how to properly format the API key`.
51+
52+
Use broad prompts for general content maintenance like fixing typos, updating redirects, or renaming a feature throughout your docs. For example: `@mintlify Find and fix all typos in the docs` or `@mintlify change all unordered lists to use * instead of -`.
53+
54+
## Agent workflows
55+
56+
The agent assists with many different documentation tasks. These workflows show some of the ways you can integrate the agent into your documentation process. Try an approach that fits how your team currently works and adapt it to your specific needs.
57+
58+
### Iterate on a prompt in a Slack thread
59+
Prompt the agent, then continue to mention it with `@mintlify` in the same thread to refine and iterate on the pull request that it creates. For example: `@mintlify Our quickstart page needs a new section on inviting collaborators`. Then `@mintlify The new section should be called "Inviting collaborators"`. Followed by any other iterations.
60+
61+
### Start with the agent, finish manually
62+
Prompt the agent to begin a project, then check out the branch it creates and finish the task in your local environment or the web editor. The agent can help you get started, then you can take over to complete the task. For example: `@mintlify Update the quickstart page to include information about inviting collaborators` and then checkout the branch to make any additional changes using your preferred method.
63+
64+
### Update docs when merging feature changes
65+
When you merge a feature pull request, share the PR link with the agent to update relevant docs. For example: `@mintlify This PR adds a new authentication method. Update the docs to include the new auth flow: [PR link]`.
66+
67+
### Generate release notes from commit history
68+
Prompt the agent with a specific pull request or a time period to generate release notes or changelog updates based on the commit history. For example: `@mintlify Generate release notes for this PR: [PR link]` or `@mintlify Generate release notes for the last month`.
69+
70+
### Generate code examples
71+
Prompt the agent to generate code examples for features throughout your docs or on specific pages. For example: `@mintlify Generate a code example to make the authentication method easier to understand`.
72+
73+
### Review existing content
74+
Prompt the agent to review existing content for technical accuracy, style, grammar, or other issues. For example: `@mintlify Review the API rate limiting section. We changed limits last month`.
75+
76+
### Respond to user feedback
77+
Prompt the agent with feedback from your users to make focused updates to your docs. For example: `@mintlify Users are getting confused by step 3 in the setup guide. What might be making it unclear?`.
78+
79+
### Automate with the API
80+
Integrate the agent into your existing automation tools to automatically update documentation when code changes occur, trigger content reviews, or sync documentation updates across multiple repositories.

ai/slack-app.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ icon: "slack"
88
The Slack app is available for [Pro and Custom plans](https://mintlify.com/pricing?ref=slack-app).
99
</Info>
1010

11-
The Slack app adds a bot named `@mintlify` to your Slack workspace that can search your documentation and answer users' questions. The bot responds to direct messages, @mentions, and to any questions in a channel specifically named `#ask-ai`.
11+
The Slack app adds a bot to your Slack workspace that can search your documentation and answer users' questions. The bot responds to direct messages, @mentions, and to any questions in a channel specifically named `#ask-ai`. The bot's name is `@yourprojectname-assistant`. So if your project name is Mintlify, the bot's name is `@mintlify-assistant`.
1212

1313
The Slack app can incur costs: either using your AI assistant credits or incurring overages.
1414

15-
## Setting up the Slack app
15+
## Set up the Slack app
1616

1717
<Note>
1818
If your Slack Workspace Owner requires admin approval to install apps, ask them to approve the Mintlify Slack app before you add it.
@@ -22,6 +22,6 @@ The Slack app can incur costs: either using your AI assistant credits or incurri
2222
2. Select **Connect** in the Slack Integration card.
2323
3. Follow the Slack prompts to add the app to your workspace.
2424
4. Test that the bot is working and responds when you:
25-
- Send a direct message to the Mintlify app.
26-
- Mention the bot with `@mintlify` in a channel.
25+
- Send a direct message to the bot.
26+
- Mention the bot in a channel.
2727
- Create an `#ask-ai` channel, add the bot, and ask a question.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
openapi: POST /agent/job/{domain}
3+
---
4+
5+
This endpoint creates an agent job based on provided messages and branch information. The job executes asynchronously and returns a streaming response with the execution details and results.
6+
7+
If a branch doesn't exist, the agent creates one. If files are edited successfully, a draft pull request is automatically created at the end of the job.
8+
9+
## Rate limits
10+
11+
The agent API has the following limits:
12+
13+
- 10,000 uses per key per month
14+
- 10,000 requests per Mintlify organization per hour
15+
- 10,000 requests per IP per day
16+
17+
## Suggested usage
18+
19+
For best results, use the [useChat hook from ai-sdk](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#usechat) to send requests and handle responses.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
openapi: GET /agent/{domain}/job/{id}
3+
---
4+
5+
## Usage
6+
7+
This endpoint retrieves the details and status of a specific agent job by its unique identifier. Use this to check the progress, status, and results of a previously created agent job.
8+
9+
## Job details
10+
11+
The response includes information such as:
12+
- Job execution status and completion state
13+
- Branch information and pull request details
14+
- Session metadata and timestamps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
openapi: GET /agent/{domain}/jobs
3+
---
4+
5+
## Usage
6+
7+
This endpoint retrieves all agent jobs for the specified domain, providing an overview of all agent activities and their current status. This is useful for monitoring and managing multiple concurrent or historical agent jobs.
8+
9+
## Response
10+
11+
Use this endpoint to get a comprehensive view of all previous agent sessions.

0 commit comments

Comments
 (0)