Skip to main content

Introduction

What AgentXP is, who it’s for, and why it matters.
AgentXP is a drop-in Next.js SDK that detects AI agents visiting your site and serves them clean, token-efficient markdown instead of raw HTML. Human visitors receive your normal site, unchanged. There is no build step to modify and no measurable impact on page load.

Who it’s for

AgentXP is built for Next.js developers who want their sites to work well with AI tools — crawlers, assistants, and agents that read your content programmatically. If you care about how GPT, Claude, Perplexity, or similar tools see your site, AgentXP gives you direct control.

What it does

When an AI agent requests one of your pages, AgentXP intercepts the request in middleware, fetches the page HTML internally, runs it through a four-stage transformation pipeline, and returns markdown. The pipeline expands hidden content (accordions, tabs, modals), strips navigation and boilerplate, converts HTML to clean markdown, and applies any token limit you configure. The result is your actual content as markdown — no markup, styles, or scripts. Token reduction: up to 94% fewer tokens than raw HTML.

Before and after

Without AgentXP, an AI agent requesting your pricing page receives the full HTML document — scripts, styles, navigation, cookie banners, and all. A typical page is 40,000+ characters.

Key capabilities

  • Automatic agent detection — Identifies 20 known AI crawlers by User-Agent and accepts explicit Accept: text/markdown requests from any agent
  • HTML-to-markdown pipeline — Four-stage transformation: hidden content expansion, content extraction, HTML-to-markdown conversion, cleanup and truncation
  • /llms.txt endpoint — Auto-generated site index following the llmstxt.org specification
  • Agent manifest/.well-known/agent-experience.json advertises your site’s capabilities in a machine-readable format
  • Content permissions — Declare whether agents may use your content for training, inference, or search indexing
  • Zero browser overhead — The middleware short-circuits immediately for non-agent requests; human visitors are never affected

Why not just use Readability?

You could parse HTML with Mozilla Readability directly. Here’s what AgentXP adds on top: AgentXP wraps Readability and adds detection, hidden content expansion, permission headers, standards compliance, and Next.js integration.

Next steps

Quick Start

Install AgentXP and serve your first markdown response in minutes.

How It Works

Understand agent detection, the transformation pipeline, and special endpoints.