Repository navigation
Better nav for agents - #922
Merged
Merged
Conversation
|
❤️ |
- Search: process_hf_docs strips the header before chunking. It was indexed once per page, and was the only record kept for compact API pages (transformers model_doc, diffusers api). - PR previews (`pr_*` versions) get no header: they're served from moon-ci-docs, not the huggingface.co URLs the header links to. - The header regex (Python and the Copy page copy in the kit) is anchored on the header's own "> Agents: ... Fetch <base>/llms.txt": a page's own opening quote is never taken for it, and a long first line can't make it backtrack. A test checks the kit's copy against `markdown_pointer`. - `doc-builder preview` writes each Markdown file once, header included (`write_markdown_route_file(..., pointer)`). - Translation: a header-only change keeps the existing translation and its tries, with the new header. The page text is hashed like `walk` hashes files (xet hash in the bucket), so pages translated before English pages had a header are matched too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a header to the docs for agents to improve how it navigates and discovers docs. This helps the most for new or moved docs because agents often guess a docs URL from memory, which can be outdated and give the wrong or incomplete answer (on topics it's already familiar with, it doesn't make much of a difference). The header tells the agent to check the docs index,
llms.txtfirst and to read the Markdown which is much smaller than the HTML page.In my testing, I asked an agent about using Google TPUs, dequantizing, and quantizing an exporter in Transformers.