Decorative Curve
Back to Resources

How Agents Pick Which Version of Your Docs to Read, and How to Influence It

Stale doc versions reach agents through training data, search caches, and version routing. Each has a different way to push them toward current docs.

March 12, 20262 min read

When a user asks a model about your API, the model is not guaranteed to read the latest docs. It might use what it learned during training. It might retrieve a cached page from a search index. It might land on a versioned URL for v1 when v3 is current. Each path has different ways to influence it.

Training data

Models learn from a snapshot of the web. If you changed your auth flow six months ago and the model was trained a year ago, the model knows the old flow. There is nothing you can do about a model that has already been trained.

What you can do is make the current flow easier to find in retrieval. If the agent has tool use or web browsing, it can override training data with retrieval. But that only works if the search returns your current page.

Versioned URLs

Many docs sites publish multiple versions at separate URLs (/v1/, /v2/, /v3/). Search engines and crawlers find all of them. Without help, a model retrieving "how to authenticate" might land on the v1 page.

Two signals help:

  • rel="canonical" on each version page, pointing at the current one.
  • noindex on deprecated versions, so they fall out of search results entirely.

If you want all versions readable but only the current one indexed, the second option is the cleaner choice.

Cached search results

If your docs were rewritten last month, search results may still link to the old text. Some caches honor lastmod in your sitemap and recrawl quickly. Others wait.

Two things speed this up:

  • An accurate lastmod in your sitemap, updated on every change.
  • A robots.txt that lists the sitemap URL and is reachable.

llms.txt

For agents that read llms.txt, point at the current versions of each canonical doc. Do not include deprecated pages in the index, even if they still exist. The point of the file is to tell the model which page you want it to use.

Versioning in the URL itself

Some sites bake the API version into the docs URL (api.example.com/v3/docs). Others use a single docs URL that always reflects the current version. The first is more honest. The second is easier for agents that strip versions when they search.

A reasonable compromise: one URL for the current version of every page, plus separate stable URLs for historical versions for the small number of users who need them.

The goal is the same in every case. Make the current page the easiest one for any reader, human or otherwise, to land on.

Connector
Everything to Build Great Docs
Connector
The Full Documentation Stack
Decorative CurveReady?
Get a preview
of your docs
ConnectorConnector
Decorative Curve
Terms of ServicePrivacy Policy
MSA