> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/getting-started/ai-documentation.md).

# Build with AI

Building GitBook docs with AI works in different environments — locally in your repo, inside of CI workflows, or directly through an AI agent. Every published site includes AI-friendly outputs by default, and interactive AI features depending on your plan.

## Choose your AI workflow

If you want AI coding assistants or agents to help you write and manage your content, GitBook provides options depending on where you work:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><strong>Build locally with AI</strong></td><td>Work in your repo with AI coding assistants that follow your GitBook rules.</td><td><a href="/files/25UVG74Dk9bwdCvijaaT">/files/25UVG74Dk9bwdCvijaaT</a></td><td><a href="/pages/7kwhl5QIBiI80sIQe3Ap">/pages/7kwhl5QIBiI80sIQe3Ap</a></td><td><a href="/files/lcykisMGzLoLHk78JY5O">/files/lcykisMGzLoLHk78JY5O</a></td></tr><tr><td><strong>Build with MCP</strong></td><td>Connect an AI agent to GitBook’s API to create, edit, and manage docs for you.</td><td><a href="/files/pXcTkYY0cOOSv6STQuAk">/files/pXcTkYY0cOOSv6STQuAk</a></td><td><a href="/pages/NiMm2ls8TMSz6Si8wY61">/pages/NiMm2ls8TMSz6Si8wY61</a></td><td><a href="/files/EwhFlFVdwwlp883E54Jz">/files/EwhFlFVdwwlp883E54Jz</a></td></tr><tr><td><strong>Build with GitBook Agent</strong></td><td>Work with GitBook’s AI to make changes directly in the editor.</td><td><a href="/files/sVJL56v4PrSfH4lx2vNR">/files/sVJL56v4PrSfH4lx2vNR</a></td><td><a href="/pages/QEdtUjQ47A0aK7o8HIzN">/pages/QEdtUjQ47A0aK7o8HIzN</a></td><td><a href="/files/DIZKH6SadxbgWF8B1SOq">/files/DIZKH6SadxbgWF8B1SOq</a></td></tr></tbody></table>

## Connect your published docs to AI tools

Once you publish, your docs are ready for AI tools like Claude, Codex, Cursor, Copilot, and GitBook Asisstant to read.

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-gitbook-assistant">:gitbook-assistant:</i></h4></td><td><strong>GitBook Assistant</strong></td><td>Help readers get fast, contextual answers from your docs — on your site or embedded in your product.</td><td><a href="/pages/m6LOhkgWYpmL4u1LYydz">/pages/m6LOhkgWYpmL4u1LYydz</a></td></tr><tr><td><h4><i class="fa-mcp">:mcp:</i></h4></td><td><strong>MCP for published docs</strong></td><td>Let external AI tools connect directly to your published docs through your site’s MCP server.</td><td><a href="/pages/biYvWYyOTbkQs94S5MI1">/pages/biYvWYyOTbkQs94S5MI1</a></td></tr><tr><td><h4><i class="fa-sparkles">:sparkles:</i></h4></td><td><strong>LLM-ready docs</strong></td><td>Learn how GitBook makes your published docs easier for AI tools to discover, read, and use.</td><td><a href="/pages/BPVA2SImqxaDTjQZPl7Y">/pages/BPVA2SImqxaDTjQZPl7Y</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/getting-started/ai-documentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
