Skip to content

(AI) Add llm page hints#34713

Open
hestonhoffman wants to merge 7 commits intomasterfrom
heston/llm-page-hint
Open

(AI) Add llm page hints#34713
hestonhoffman wants to merge 7 commits intomasterfrom
heston/llm-page-hint

Conversation

@hestonhoffman
Copy link
Contributor

@hestonhoffman hestonhoffman commented Feb 19, 2026

What does this PR do? What is the motivation?

We publish .md versions of most pages on the docs site to help LLMs read our documentation, but agents seem to have trouble finding these pages when a user asks an Agent to fetch and read a page.

This PR adds two methods to help the agent find the correct version of the page (if one exists).

If a .md version of the page exists:

  • it adds an "invisible" div to the top of the page with directions to the .md version.
  • It adds a meta entry to the page with the same link. This is a kind of fallback because some agents may automatically skip divs that are set to display:none. We haven't really landed on an industry standard for how agents search pages, so we have to cover a variety of bases.

How it works

  1. Once per build, pages-json-cache.html uses partialCached to download pages.json from the docs site and store the data in a cached Hugo dict.
  2. Once per page, page-agent-hint.html checks if a key exists in the cached dict and returns the .md URL if one exists. This also uses partialCached to prevent multiple calls for the same page.
  3. If a key exists, the meta tag and div are added to the page.

Note:

  • I borrowed a lot of this functionality from something @jhgilbert was working on.
  • There is a bit of futzing with URL strings to get the correct .md path to the page.
  • I needed to add this higher in the body element to get it to work
Screenshot 2026-02-19 at 11 51 01 AM

@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Feb 19, 2026
@hestonhoffman hestonhoffman added the WORK IN PROGRESS No review needed, it's a wip ;) label Feb 19, 2026
@hestonhoffman hestonhoffman marked this pull request as ready for review February 19, 2026 20:05
@hestonhoffman hestonhoffman requested a review from a team as a code owner February 19, 2026 20:05
@hestonhoffman hestonhoffman removed the WORK IN PROGRESS No review needed, it's a wip ;) label Feb 19, 2026
hestonhoffman and others added 3 commits February 19, 2026 12:11
Co-authored-by: Jen Gilbert <jen.gilbert@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments