llms.txt, Markdown Mirrors and JSON-LD: Make Your Site Readable to AI Agents
How to write an llms.txt file to the llmstxt.org format, serve Markdown versions of your pages with Accept: text/markdown, and add Organization, SoftwareApplication and FAQPage JSON-LD, with working examples.
AI search crawlers, answer fetchers and coding agents read your site over HTTP, and what they want from each page is its text, not its layout. Three files make that read cheaper and more accurate: an llms.txt that maps your important pages, a Markdown version of each page served to any client that asks for one, and JSON-LD that states your company, product and prices as data. This guide shows how to write each one, with devtune.ai as a working example, and how to check them.
None of the three replaces readable HTML. An AI search crawler that indexes your page reads the HTML first, and many crawlers run no JavaScript, so the text a buyer needs has to be in the server response. Check that first with the AI crawler preview, which shows the text each crawler gets back. These files add to that page; they don't stand in for it.
llms.txt
llms.txt is a Markdown file at the root of your site that tells a language model what the site is and which pages to read. The format is defined at llmstxt.org:
- An H1 with the site or project name. It's the only required part and must come first.
- A blockquote with a one- or two-sentence summary.
- Optional paragraphs or lists with more context.
##sections, each a list of links in the form- [Name](https://url): optional note.- An optional section titled
## Optionalfor links a reader can skip when its context is short.
A starter for a software company:
# Acme
> Acme is a hosted job queue for Node.js and Python. It runs scheduled and
> event-driven jobs with retries, concurrency limits and per-job logs.
## Docs
- [Quickstart](https://acme.dev/docs/quickstart): Install the SDK and run a first job
- [API reference](https://acme.dev/docs/api): Every REST endpoint with request and response examples
- [Retries and backoff](https://acme.dev/docs/retries): How failed jobs are retried
## Product
- [Pricing](https://acme.dev/pricing.md): Plans, limits and what each includes
- [Changelog](https://acme.dev/changelog): Releases by date
## Optional
- [Blog](https://acme.dev/blog): Engineering posts and case studies
What makes one useful:
- Absolute URLs. A relative link such as
/docs/quickstarthas no host once the file is pasted into a prompt or cached elsewhere. - Notes on every link. The note after the colon is what a model reads to decide whether to fetch the page. "Every REST endpoint with request and response examples" picks the right page; "API docs" doesn't.
- The pages a buyer or agent needs. Pricing, the quickstart, the reference, integrations and comparisons. Leave out legal pages and anything thin.
- Links to Markdown where you have it. If
/pricing.mdexists, link it rather than/pricing. - Plain text. Serve it at
/llms.txtwith a 200 andContent-Type: text/plainortext/markdown, not an HTML page your router falls back to.
devtune.ai's file is at /llms.txt. It opens with what DevTune is, then says when to use it and how agents should connect before listing pages. Prose like that is allowed between the summary and the link sections, and it is often the part an agent quotes.
Some sites also publish /llms-full.txt, the full text of their docs in one file, for tools that load a whole documentation set at once. It's a convention outside the llmstxt.org format. Publish one only if you can regenerate it automatically on every docs change, because a stale full-text file is worse than none.
Markdown versions of your pages
A Markdown copy of a page drops the navigation, scripts and layout, so an agent reading it spends its budget on your content. Serve it two ways at once:
- A
.mdURL./pricing.mdnext to/pricing. Easy to link fromllms.txtand to fetch by hand. - Content negotiation on the normal URL. When a request sends
Accept: text/markdown, return the Markdown from/pricingitself. Agents that support it ask for Markdown without knowing your.mdconvention.
Try both on devtune.ai:
curl https://devtune.ai/pricing.md
curl -H 'Accept: text/markdown' https://devtune.ai/pricing
curl -I -H 'Accept: text/markdown' https://devtune.ai/
The homepage's Markdown response carries these headers:
HTTP/2 200
content-type: text/markdown; charset=utf-8
vary: Accept, Accept-Encoding
link: </llms.txt>; rel="service-doc"; type="text/plain"
Content-Type: text/markdown. Clients decide what they got from this header.Vary: Accept. Without it, a CDN can cache the Markdown and serve it to browsers, or cache the HTML and serve it to agents. CheckVaryon the final response, after your framework and CDN have set their own headers, since some frameworks replace it.- HTML stays the default. A request with no
Acceptheader, or one that preferstext/html, gets HTML. Linkon the homepage. ALinkheader pointing at/llms.txtlets an agent that starts at your homepage find the map without guessing the path.
Then tell clients the Markdown exists. In each page's HTML head:
<link
rel="alternate"
type="text/markdown"
href="https://devtune.ai/pricing.md"
/>
In Next.js App Router, alternates.types in a page's metadata renders that tag. The implementation for the negotiated URL is a middleware or proxy rule that checks Accept for text/markdown and rewrites to the .md route, plus the Vary header.
Write the Markdown from the same source as the page, not by converting rendered HTML. Converted HTML carries cookie banners, menu labels and repeated calls to action into the text. Keep the real headings, tables and code blocks, and keep prices and limits as text rather than images.
JSON-LD
JSON-LD states facts about the page as schema.org data in a <script type="application/ld+json"> block. A crawler can read it without interpreting your layout. Three types cover most software sites.
Organization, once on the home page, says who you are and links your other profiles through sameAs:
{
"@context": "https://schema.org",
"@type": "Organization",
"@id": "https://acme.dev/#organization",
"name": "Acme",
"url": "https://acme.dev",
"logo": "https://acme.dev/logo.png",
"sameAs": [
"https://github.com/acme",
"https://www.linkedin.com/company/acme",
"https://x.com/acme"
]
}
SoftwareApplication, on the product or pricing page, says what the product is and what it costs. Each offer needs both price and priceCurrency:
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Acme",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Web",
"publisher": { "@id": "https://acme.dev/#organization" },
"offers": [
{
"@type": "Offer",
"name": "Starter",
"price": "0",
"priceCurrency": "USD"
},
{ "@type": "Offer", "name": "Team", "price": "49", "priceCurrency": "USD" }
]
}
FAQPage, on a page with real questions and answers visible to readers. Each answer's text must match what the page shows:
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Does Acme retry failed jobs?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. Failed jobs retry up to five times with exponential backoff by default."
}
}
]
}
Rules that keep it trustworthy:
- Server-render it. JSON-LD added by client-side JavaScript is invisible to crawlers that don't run scripts.
- Match the page. Prices, names and answers in JSON-LD must be the ones a reader sees. When the pricing page changes, the markup changes in the same commit.
- Link nodes by
@id. Reference the Organization from the product'spublisherrather than repeating it. - Valid JSON. A trailing comma invalidates the whole block.
Check all three
- The llms.txt checker reads
/llms.txtand/llms-full.txt, flags a missing H1 or summary, link items that aren't[name](url)links, and relative links. It also tests whether your homepage answersAccept: text/markdown, whether its HTML links an llms.txt or Markdown version, and which/.well-known/agent discovery files you serve. With nollms.txt, it writes a starter file for your domain. - The schema markup checker lists the JSON-LD types on a page and flags invalid JSON, an Organization without
sameAs,urlorlogo, offers without a price or currency, and empty FAQ answers. It also generates Organization, SoftwareApplication and FAQPage markup from a form. - The AI agent directory lists the AI crawlers, answer fetchers and coding agents that read these files, and what each one does on your site.
Once they're in place, the question is whether AI systems fetch the pages and cite them. Your server logs answer the first part; How to track AI crawler and answer-fetch traffic shows how to read them, and robots.txt for AI search crawlers covers letting the right crawlers in.