Your next docs reader is an AI agent

More of your readers ask an assistant instead of opening your docs. Here's what that assistant needs from your site, and how to check what it sees.

Sahil Gadimbayli

Founder & CTO

AI and agents4 min read

A developer integrating your API today might never open your docs. They ask Claude or ChatGPT, or their editor's agent, and it fetches your pages for them. If what it fetches is a cookie banner, a navigation tree and half a JavaScript app, it answers from memory instead. Then it invents an endpoint, and your product takes the blame.

So your docs have a second audience now. It reads every word, never scrolls, and has no patience for layout.

What an agent wants

An agent wants the same thing a careful human reader wants, minus the design:

  • the page's text, without the site around it;
  • links that still work once the text has left your site;
  • a list of every page, so it can find the right one;
  • a way to search, when the list is long.

None of this needs AI on your side. It's plain files and one small endpoint.

Serve every page as Markdown

Give every page a Markdown version at a predictable address. We use the page's URL plus .md, and the same page also answers a request with Accept: text/markdown. The HTML page points to its Markdown twin with a <link rel="alternate">, so a crawler that lands on the HTML can find it.

Two details matter more than they look.

Make the links absolute. A link like [webhooks](../webhooks) works on your site and breaks the moment an agent pastes the text into its context. Rewrite every link and image to a full URL when you serve the Markdown.

Serve what's published, not what's saved. If you have drafts or a manual publish step, the Markdown has to come from the same published copy as the HTML. Otherwise an agent quotes a page your team hasn't released yet.

Add llms.txt

llms.txt is a proposed convention: a Markdown file at the root of a site that lists its pages with a line about each. Think of it as a sitemap written for a language model instead of a search engine.

Ours is generated from the site's navigation, so it never drifts from what readers see:

# Northwind Pay

- [Quickstart](https://docs.northwind.example/quickstart.md): Take your first test payment
- [Webhooks](https://docs.northwind.example/webhooks.md): Get notified when a payment settles

Next to it, llms-full.txt puts every page in one file, for agents that would rather read the whole thing once.

Run an MCP server

The Model Context Protocol lets an agent call tools on a server it's connected to. For docs, three tools cover almost everything:

ToolDoes
search_docsfull-text search, returning the best pages
list_pagesevery page with its title and description
get_pageone page as Markdown

Keep it read-only and keep sessions out of it. Ours takes no cookies, never knows who is asking and never calls a model. Search is the database's full-text search. Your docs are public, so the server can be too, and that makes it simple to reason about.

Write for a reader who arrives mid-page

The files are the easy part. The writing is where most docs fail agents, and it's the same writing that fails humans who land from a search result.

  • Name things in headings. "Configuration" tells an agent nothing. "Set the webhook signing secret" tells it exactly when to use the section.
  • Don't lean on position. "As mentioned above" means nothing to a model that received one section. Repeat the fact or link to it.
  • Put the answer in text. A screenshot of a settings screen is invisible to most agents. Write the setting's name and value.
  • Label code blocks with their language, and include the imports. An agent pastes code exactly as written, gaps included.
  • Say which version a page covers. An agent mixing two major versions produces code that compiles for neither.

Check what it sees

You can test all of this in five minutes:

curl -H "Accept: text/markdown" https://docs.example.com/quickstart
curl https://docs.example.com/llms.txt

Read the output as if you'd never seen your product. Is the whole page there? Do the links open? Then paste your quickstart's URL into an assistant and ask it a question the page answers. If it gets it wrong, the page is usually the problem, and fixing it helps your human readers too.

We built all of this into Typemark because this audience only grows from here. Markdown pages, llms.txt, llms-full.txt and the MCP server are on for every public site, and a menu beside each page title lets readers copy it, open it in an assistant or connect their editor.

Engineering4 min read

We never run your page's code

MDX lets a docs page run JavaScript. On a platform that compiles thousands of strangers' pages, we decided the safest sandbox is the one you never need.

Sahil Gadimbayli

Writing docs4 min read

Code samples that work when pasted

Readers skip your prose and copy your code. Eight rules for samples that run the first time, and a way to stop them breaking between releases.

Sahil Gadimbayli