Markdown for AI agents: serving readable versions of your pages
Serving Markdown hands AI agents your page's content without the navigation, scripts and layout markup. Offer it at a parallel URL (page + .md) and through content negotiation (Accept: text/markdown, with Vary: Accept), keep browsers on HTML, and make sure caches never serve Markdown to a browser.
Two ways to serve Markdown
Watch your cache
Making the Markdown good
If your HTML is semantic, a clean Markdown version is almost free. If it isn't, the Markdown will show you exactly where the structure is missing.
What to do next
Frequently asked questions
How do I serve Markdown to AI agents?
Publish a Markdown version of each page at the same URL with .md appended, and optionally answer requests whose Accept header prefers text/markdown with Markdown on the normal URL. Announce the Markdown version with a link tag and list it in your llms.txt.
What is content negotiation with Accept: text/markdown?
It's plain, standard HTTP: the client lists the formats it prefers in the Accept header, and the server returns the best match. An agent that sends Accept: text/markdown gets Markdown, and a browser asking for text/html gets the usual page.
Do I need Vary: Accept?
Yes, on every response from a URL that can return more than one format. CDNs handle Vary inconsistently, so also bypass the cache for Markdown requests or mark negotiated Markdown as private.
Will Markdown versions create duplicate content in search engines?
Not if you mark them noindex (with an X-Robots-Tag header) and point to the HTML page as canonical with a Link header.
Do AI agents actually request Markdown?
Some agents and developer tools ask for it or try .md URLs, while many still fetch plain HTML. So Markdown versions come on top of well-structured HTML, which still has to do its job.