Skip to main content

Recipes

Ready-to-use AgentXP configurations for common site types.
Pick the recipe closest to your site and adjust as needed. Each config is a complete middleware.ts you can copy directly.

Documentation site

Documentation sites have clean structure and work well with zero config. Add a llmsTxt page list so agents can discover your docs without crawling.
middleware.ts

SaaS landing page

Landing pages contain pricing, features, and social proof. Exclude marketing widgets and keep token limits moderate.
middleware.ts

E-commerce product pages

E-commerce pages have sidebars, filters, cart widgets, and recommendation carousels. Use contentSelector to target the product content and excludeSelectors to strip shopping chrome.
middleware.ts

Blog or content site

Blogs work well out of the box. Exclude comment sections and social widgets to keep output clean.
middleware.ts

News or media site

News sites have ad slots, trending sidebars, and comment sections inside the main content area. Aggressive excludeSelectors are required.
middleware.ts
News sites benefit the most from contentSelector: 'article'. Without it, sidebar ads and trending sections inside <main> will appear in the markdown output.

Dashboard or web app

App pages have toolbars, sidebar navigation, and notification drawers. Target the content area directly.
middleware.ts

With existing middleware

If you already have middleware (Clerk, next-intl, or custom auth), pass it as the second argument. AgentXP handles agent requests; everything else goes to your middleware unchanged.
middleware.ts
This works with any middleware that follows the Next.js middleware signature.