GitBook docs

Add an AI chatbot to GitBook

You cannot install a third-party chat script on a GitBook-hosted site. GitBook's own customization guide says custom HTML, CSS, and JavaScript cannot be inserted there. What you can do is use the public Markdown GitBook already publishes as a knowledge source, then put Heeya on the website you control.

GitBook documents llms.txt and per-page .md exports. Heeya discovers those Markdown URLs, scrapes the text, and answers from it on your product or marketing pages. That is the path this page covers, not a GitBook marketplace app.

Build your GitBook assistant

For the wider SaaS support product, see AI customer support for SaaS. Current plans are on Heeya pricing.

What GitBook offers, and what it does not

Three official GitBook options get mixed together in search results. They are not interchangeable.

Option Where the chat lives What it uses
GitBook AI Assistant Inside the published docs (sidebar or search), or GitBook's own Docs Embed in your app GitBook's assistant, plus connections you configure in GitBook
Custom script on the GitBook site Not available Site customization lists custom code as something you cannot add. Analytics such as Google Analytics go through a GitBook integration, not a pasted tag.
Heeya on your site, GitBook as source Your product, marketing, or app HTML pages Public llms.txt and .md pages, then Heeya's embed script

If readers should ask questions without leaving the docs UI, GitBook Assistant is the in-docs product. If they should ask on your app or marketing site, using the same public docs as source, Heeya is the widget path below.

Import public GitBook pages

GitBook publishes an index at /llms.txt on the docs site root, and a Markdown version of each page when you append .md to the page URL. Heeya's website importer reads that index, then fetches Markdown as Markdown. It does not call the GitBook API and does not use GitBook MCP.

  1. 1. Confirm the docs are public

    Open the published site in a private window. If GitBook authenticated access or a share link is required, stop. Heeya fetches with no GitBook session.

  2. 2. Copy the llms.txt URL

    Use the docs root plus /llms.txt. On a space hosted at a path, that is the path-scoped file, for example:

    https://docs.example.com/llms.txt
    https://your-org.gitbook.io/your-docs/llms.txt

    The file should list absolute .md URLs. That is the format GitBook documents and the format Heeya parses.

  3. 3. Paste it in Files, Web

    Create an agent, open Files, then Web. The field prefixes https://. Paste the host and path, such as docs.example.com/llms.txt. Search URLs, then select the guides that answer real support questions. Discovery is capped per job (300 pages by default).

  4. 4. Scrape Markdown, not the HTML sitemap

    GitBook sites also publish a sitemap of HTML URLs. If you paste only the site hostname, Heeya prefers that sitemap. HTML pages we requested without executing JavaScript returned the title, previous/next links, and a "also available as Markdown" line: about two hundred characters of chrome, not the article. Paste llms.txt so the selected URLs end in .md.

The scraper keeps Markdown headings and prose, and strips generator scaffolding (llms.txt banner quotes, Liquid-style directives, inline HTML tags). Screenshots referenced as GitBook /files/... paths are not stored as images in the knowledge base. Linked PDFs in the docs are not fetched. For how to structure those pages once they are in the agent, use knowledge base engineering for AI chatbots. The file format itself is covered in the llms.txt guide.

Update after you publish docs

Heeya does not watch GitBook, Git Sync, or change requests. When a page changes, the indexed copy stays until you replace it.

  • Open the same agent's Files, Web tab.
  • Load the indexed website URLs.
  • Run an update, review the new text, and choose which pages to replace.

Old versions stay active until that indexing job finishes. There is no webhook from GitBook and no nightly recrawl.

Install the widget where you can load a script

After the pages are indexed, test in the dashboard chat. Then open Connect and copy the snippet. It is one script tag, not an npm package and not a GitBook integration:

<script async src="https://heeya.fr/agent/YOUR_AGENT_ID/embed.js" data-agent-name="Support"></script>

On your product or marketing site

Place the tag on any HTML page that may load a third-party script, typically before the closing body tag. If the page sets a Content Security Policy, allow https://heeya.fr in script-src and in connect-src. Agent name, colors, and logo are configured on the agent, not as GitBook theme tokens.

From GitBook, without custom JS

GitBook pages can include an external link. Point that link at the hosted assistant, https://heeya.fr/agent/YOUR_AGENT_ID/assistant. Readers leave the docs site for a full-page chat. That is a link, not an embed inside GitBook's layout.

Account setup, system guidance, and the first embed walkthrough live in the Heeya first-agent tutorial. This page only adds the GitBook-specific source and install constraints.

Fit, and not a fit

This path fits when

  • The GitBook space is public and llms.txt lists .md URLs.
  • You want the chat on a site you host, using those pages as the knowledge base.
  • Someone on the team will refresh sources after docs releases.
  • A contact form in the chat is enough when the retrieved docs do not contain the answer.

Use something else when

  • You need the bubble inside GitBook's published chrome. GitBook does not allow that script, and Heeya has no GitBook integration.
  • The space is private, adaptive, or behind authenticated access.
  • You need GitBook to push updates into Heeya on every merge. That sync does not exist.
  • You need the agent to open tickets, call your API, or take actions in the product. Heeya searches the knowledge base and, if enabled, shows a form.

FAQ about a GitBook AI chatbot

Can I paste a chatbot script into GitBook?

No. GitBook's site customization docs state that you cannot insert custom HTML, CSS, or JavaScript into a GitBook-hosted site. Heeya's widget is a script tag for HTML pages you control, such as your product or marketing site. On GitBook itself, you can add an external link to Heeya's hosted assistant URL.

Does GitBook already have an AI chatbot?

Yes. GitBook ships an AI Assistant on published docs. It answers from the site and from sources you connect inside GitBook. That is GitBook's product. Heeya is a separate website widget trained on the public Markdown pages GitBook publishes, used when you want the chat on your own site.

How do I import GitBook pages into Heeya?

In the agent Files Web tab, paste the public llms.txt URL for the docs site, not the homepage. GitBook lists Markdown page URLs there. Select the pages to scrape. Do not start from the HTML sitemap if you want the article body: GitBook HTML pages we fetched without JavaScript contained navigation chrome, not the guide text.

Does Heeya sync GitBook automatically when docs change?

No. There is no GitBook connector, webhook, or scheduled recrawl. After you publish docs changes, open the Web tab, load the indexed URLs, and run an update so Heeya re-fetches the same Markdown pages.

Can Heeya ingest a private GitBook space?

No. Discovery and scrape use public HTTPS fetches with no GitBook login, share-link cookie, or authenticated-access token. If the llms.txt or .md URLs require sign-in, Heeya will not receive the page body.

Will the agent invent answers that are not in the GitBook pages?

Retrieval-augmented generation injects retrieved passages into the prompt and instructs the model to say when the information is missing. That reduces unsupported answers. It does not remove the risk. Test the questions your users ask, and refresh sources after you change the docs.

Build an assistant on the GitBook pages you already publish

Create an agent, paste the public llms.txt URL, test answers, then add the script to the site you host.

Build your GitBook assistant