Introduction
Agentside serves markdown twins of your pages to AI agents and lets you A/B test what each agent reads.
Agentside is a small SDK that answers AI agents with a markdown version of your pages. People keep getting your HTML from the same URL, while agents that ask for markdown or identify themselves by user agent get a clean twin that is cheaper to read and easier to cite.
It is built on Effect and only depends on the fetch-standard Request and Response, so one config runs in TanStack Start, Astro, Next.js, Hono, Cloudflare Workers, Bun and anything else that speaks fetch.
import { agentside } from "@usenotra/agentside";
const twins = agentside({
routes: {
"/": "# Acme\n\nAcme sends invoices your customers actually pay.",
"/pricing": () => renderPricingMarkdown(),
},
});
const response = await twins.handle(request, () => app.fetch(request));
What you get
- Content negotiation for
.mdURLs,Accept: text/markdownand known AI agent user agents, with aLinkheader on HTML pages that have a twin. - A/B variants per agent so you can serve a different twin to a vendor, a purpose such as search or a single agent and measure what happens.
- Error handling that protects agents from broken twins. A failing variant falls back to control and a failing twin falls back to your HTML page.
- Caching with a TTL, request deduplication and no caching of failures.
- Typed errors and the raw Effect program through
@usenotra/agentside/effect.
Quickstart
Install Agentside and serve your first twin.
Migrating from Dualmark
Map your Dualmark config to Agentside routes.
Benchmarks
We are benchmarking Agentside against Dualmark on negotiation, cached reads and cold renders. The results and the harness will be published in the benchmarks section of the README.