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 aSiteHeaderConfig to withAgentXP() to replace auto-extraction with a fixed navigation preamble you control.
SiteHeaderConfig fields
| Field | Type | Description |
|---|---|---|
name | string | Site name displayed at the top of the preamble. Required. |
links | SiteHeaderLink[] | Standalone links rendered inline (e.g., Pricing, Blog). |
sections | SiteHeaderSection[] | Grouped navigation sections with a label and list of links. |
ctaLinks | SiteHeaderLink[] | Call-to-action links rendered after the main nav (e.g., “GET STARTED”). |
SiteHeaderLink fields
| Field | Type | Description |
|---|---|---|
text | string | Link label. |
href | string | Absolute URL or root-relative path. Relative paths are resolved against baseUrl. |
SiteHeaderSection fields
| Field | Type | Description |
|---|---|---|
label | string | Section heading (e.g., "Documentation"). |
links | SiteHeaderLink[] | Links listed under this section. |
Rendered output
Given the configuration above, AgentXP prepends the following to every markdown response:Disabling the site header
To disable the site header entirely, omitsiteHeader from your config or pass undefined. Auto-extraction remains active unless you explicitly disable it.
SiteHeaderConfig to createMarkdownHandler so both paths produce consistent output.