Skip to main content

Site Header

Add a navigation preamble to every markdown response so agents understand your site structure.
Every markdown response AgentXP serves begins with a navigation preamble — a compact markdown block that tells agents your site name and where to find key pages. This gives agents the context they need to navigate your site without having to discover links from page content alone.

Auto-extraction (default)

By default, AgentXP extracts your site’s <header> and <nav> HTML from each page and converts it into a markdown navigation block. No configuration is required. The extracted navigation is prepended to every markdown response before the page content. Because it’s derived from the live page HTML, it automatically reflects any navigation changes you make to your site. Manual site headers are recommended for production. They’re stable, predictable, and don’t break if your nav HTML structure changes.

Manual site header

Pass a SiteHeaderConfig to withAgentXP() to replace auto-extraction with a fixed navigation preamble you control.

SiteHeaderConfig fields

SiteHeaderSection fields

Rendered output

Given the configuration above, AgentXP prepends the following to every markdown response:

Disabling the site header

To disable the site header entirely, omit siteHeader from your config or pass undefined. Auto-extraction remains active unless you explicitly disable it.
If you’re using a Route Handler for markdown overrides, pass the same SiteHeaderConfig to createMarkdownHandler so both paths produce consistent output.