Use a Bothive Agent in Mintlify Docs
Yes, you can use an agent built on Bothive as the AI assistant inside Mintlify documentation.
Mintlify supports custom JavaScript/CSS for widgets, MDX with React components, and assistant/custom frontend patterns. Bothive provides the hosted agent runtime, knowledge base, memory, and traces.
The recommended setup
| Piece | Role |
|---|---|
| Mintlify | Renders the docs and assistant entry point |
| Bothive Knowledge | Stores docs, FAQ, product notes, and support policy |
| Bothive Agent | Searches knowledge and answers questions |
| Widget or API proxy | Connects Mintlify visitors to the agent safely |
Best fit - replace the Ask AI experience
If you want the navbar Ask AI button to open a familiar assistant panel while the actual answers come from your Bothive bot, build a custom assistant frontend.
The flow:
- Hide or skip Mintlify's native assistant button.
- Add your own
Ask AInavbar button with Mintlify custom JavaScript. - Open a custom side panel or modal on click.
- Send the question to a backend API proxy.
- The backend calls your Bothive docs bot.
- Render the bot answer inside the panel.
Do not call Bothive with a private API key directly from browser JavaScript.
jsconst button = document.createElement("button"); button.textContent = "Ask AI"; button.className = "bothive-docs-ai-button"; button.onclick = () => window.dispatchEvent(new Event("bothive-docs-ai-open")); document.querySelector("header nav")?.appendChild(button);
jsasync function askBothive(message) { const res = await fetch("https://yourdomain.com/api/docs-ai", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message, sessionId: localStorage.getItem("bothive_docs_session") || crypto.randomUUID(), pagePath: location.pathname }) }); return res.json(); }
Then your backend route calls Bothive with the server-side key:
tsexport async function POST(req: Request) { const { message, sessionId, pagePath } = await req.json(); const res = await fetch("https://api.bothive.cloud/v1/bots/YOUR_BOT_ID/chat", { method: "POST", headers: { "Authorization": `Bearer ${process.env.BOTHIVE_API_KEY}`, "Content-Type": "application/json", "X-Session-ID": sessionId || "docs-anonymous" }, body: JSON.stringify({ message, context: { pagePath, surface: "mintlify-docs" } }) }); return Response.json(await res.json()); }
Path A - embed the Bothive widget
Use this when your Mintlify project allows custom scripts.
- Create an agent in Bothive named
Hivemind Docs. - Upload your docs, FAQ, launch notes, and product context to a knowledge base.
- Attach the knowledge base to the agent.
- Deploy the agent to the Web Widget channel.
- Add the widget script through Mintlify custom JavaScript/snippets.
html<script> window.BothiveConfig = { botId: "bot_abc123", position: "bottom-right", primaryColor: "#09090b", greeting: "Ask me anything about these docs.", title: "Hivemind Docs" }; </script> <script src="https://cdn.bothive.cloud/widget.js" async></script>
Never expose a private API key in client-side docs code. Use a browser-safe widget token or public widget identifier.
Path B - use an API proxy
Use this when you want stronger control over identity, rate limits, analytics, or custom UI.
- Build your assistant UI in Mintlify-compatible MDX/custom components.
- Send questions to your own backend route.
- Your backend calls Bothive with a server-side API key.
- Return the Bothive response to the docs UI.
tsexport async function POST(req: Request) { const { message, sessionId, pagePath } = await req.json(); const res = await fetch("https://api.bothive.cloud/v1/bots/YOUR_BOT_ID/chat", { method: "POST", headers: { "Authorization": `Bearer ${process.env.BOTHIVE_API_KEY}`, "Content-Type": "application/json", "X-Session-ID": sessionId || "docs-anonymous" }, body: JSON.stringify({ message, context: { pagePath } }) }); return Response.json(await res.json()); }
Path C - link to hosted chat
Use this if custom JavaScript is not available.
- Deploy the agent to the hosted Web channel.
- Copy the hosted chat URL.
- Add a Mintlify card, navbar link, or callout that opens the assistant.
Recommended instructions
textYou are Hivemind Docs, the AI assistant for this documentation. Always search the attached knowledge base before answering. Answer from the docs first. Cite the page or section when possible. If the docs do not contain the answer, say you are not sure and suggest the closest next step. Do not invent pricing, roadmap, legal, security, provider support, or account-specific answers. If the user wants to build an agent, ask only questions that change the build and then propose a concrete plan.
What to upload
- Current docs pages and API reference
- FAQ and beginner guides
- Product positioning and limitations
- Pricing or billing notes, with dates
- Support and escalation rules
- Safe examples of HiveLang and widget setup
Production checklist
- Use a browser-safe widget token or a backend proxy.
- Pass stable session IDs for per-user memory.
- Keep private account data out of public docs knowledge bases.
- Test prompt injection attempts.
- Inspect Bothive traces after test conversations.
- Update the knowledge base whenever docs, pricing, or provider support changes.
Use the test pane to iterate quickly. Every change you make is live — no need to save first.
API keys are shown only once. Store them securely and never commit them to version control.
Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.
Chain multiple specialized bots in a workflow for better results than one general-purpose bot.