> 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/optimizing-for-ai.md).

# Optimizing for AI

GitBook automatically publishes AI-friendly outputs for your site.

### Make your site easy for AI tools to consume

Every published GitBook site includes AI-friendly outputs:

* Add `.md` to a page URL to get the page as Markdown.
* Use `llms.txt` to give an agent a site-wide index.
* Use `llms-full.txt` to give an agent a full snapshot of the published docs.
* Use `/~gitbook/mcp` to let MCP-compatible tools read your docs directly.

These are generated automatically and make your docs easier for LLMs, IDEs, coding agents, and search systems to understand.

### Optimize for better AI answers

GitBook handles the delivery layer, but your writing still matters.

Clear headings, short sections, concrete examples, and current information help both humans and AI systems. If you want to improve how tools like ChatGPT, Claude, and Cursor interpret your docs, start with [LLM-ready docs](/docs/ai-and-search/llm-ready-docs.md).

### Keep translated docs aligned

If you publish docs in multiple languages, translation quality also affects AI answers.

[Translations](/docs/gitbook-agent/translations.md) let you localize your docs with GitBook Agent. When you update the source content, GitBook can keep translated versions aligned with those changes.

### Writing guidelines that help AI

Focus on these basics:

* Use clear heading hierarchy.
* Keep sections short and specific.
* Include concrete examples and exact values.
* Remove stale content quickly.

These practices improve retrieval, reduce ambiguity, and make answers more accurate.

### Measure how agents use your docs

Use [Site analytics](/docs/docs-site/insights.md) to track traffic from LLMs and MCP clients, and see how agents access your content.


---

# 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/optimizing-for-ai.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.
