Integrations·7 min read

Use a Bothive Agent in Mintlify Docs

Build a docs assistant in Bothive, ground it with your knowledge base, and expose it inside Mintlify through a widget, hosted chat, or API proxy.

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

PieceRole
MintlifyRenders the docs and assistant entry point
Bothive KnowledgeStores docs, FAQ, product notes, and support policy
Bothive AgentSearches knowledge and answers questions
Widget or API proxyConnects 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:

  1. Hide or skip Mintlify's native assistant button.
  2. Add your own Ask AI navbar button with Mintlify custom JavaScript.
  3. Open a custom side panel or modal on click.
  4. Send the question to a backend API proxy.
  5. The backend calls your Bothive docs bot.
  6. Render the bot answer inside the panel.

Do not call Bothive with a private API key directly from browser JavaScript.

js
const 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);
js
async 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:

ts
export 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.

  1. Create an agent in Bothive named Hivemind Docs.
  2. Upload your docs, FAQ, launch notes, and product context to a knowledge base.
  3. Attach the knowledge base to the agent.
  4. Deploy the agent to the Web Widget channel.
  5. 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.

  1. Build your assistant UI in Mintlify-compatible MDX/custom components.
  2. Send questions to your own backend route.
  3. Your backend calls Bothive with a server-side API key.
  4. Return the Bothive response to the docs UI.
ts
export 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.

  1. Deploy the agent to the hosted Web channel.
  2. Copy the hosted chat URL.
  3. Add a Mintlify card, navbar link, or callout that opens the assistant.

Recommended instructions

text
You 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.
Quick tip

Use the test pane to iterate quickly. Every change you make is live — no need to save first.

Important

API keys are shown only once. Store them securely and never commit them to version control.

Best practice

Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.

Pro tip

Chain multiple specialized bots in a workflow for better results than one general-purpose bot.

Use a Bothive Agent in Mintlify Docs