diff --git a/sx/sx/essays/hypermedia-age-of-ai.sx b/sx/sx/essays/hypermedia-age-of-ai.sx new file mode 100644 index 0000000..37bab67 --- /dev/null +++ b/sx/sx/essays/hypermedia-age-of-ai.sx @@ -0,0 +1,120 @@ +;; --------------------------------------------------------------------------- +;; Hypermedia in the Age of AI +;; A response to Nick Blow's article on JSON hypermedia and LLM agents. +;; --------------------------------------------------------------------------- + +(defcomp ~essays/hypermedia-age-of-ai/essay-hypermedia-age-of-ai () + (~doc-page :title "Hypermedia in the Age of AI" + (p :class "text-stone-500 text-sm italic mb-8" + "Nick Blow argues that JSON hypermedia can serve AI agents better than HTML or RPC. He is right about the problem and wrong about the solution. The answer is not a better serialization of links. It is a representation that is simultaneously content, control, and code.") + + (~doc-section :title "I. The argument" :id "the-argument" + (p :class "text-stone-600" + (a :href "https://nickblow.tech/posts/hypermedia-in-the-age-of-ai" :class "text-violet-600 hover:underline" "Blow's essay") + " starts from a position familiar to anyone who has followed the hypermedia discourse: Carson Gross's contention that sprinkling link objects into JSON does not make an API truly RESTful, because REST demands generic clients capable of interpreting hypermedia controls. Blow agrees that this has merit but argues the position is too restrictive. HTML is not the universal hypermedia format. LLMs choke on it. The real prize is " (em "progressive discovery") " — a client that learns what it can do by following links, not by reading documentation upfront.") + (p :class "text-stone-600" + "He contrasts this with MCP, the Model Context Protocol now dominant for LLM tool use. MCP is RPC in a trench coat: the server declares all its tools upfront, the model receives the full catalogue in its system prompt, and it calls functions by name. This works, but it does not scale. A file management API that exposes create, read, update, delete, list, search, share, unshare, move, copy, rename, and permission management overwhelms the model before it has done anything. MCP forces " (em "total disclosure") " where hypermedia would offer " (em "progressive revelation") ".") + (p :class "text-stone-600" + "Blow proposes JSON-flavoured hypermedia as the fix — " (code "vnd.siren+json") ", custom content types, link relations in response payloads — so agents can discover capabilities by doing, not by reading a manual. Resources become state machines. Hyperlinks are state transitions. The agent explores the graph.") + (p :class "text-stone-600" + "This is the right diagnosis. The prescription is too weak.")) + + (~doc-section :title "II. The JSON hypermedia trap" :id "json-trap" + (p :class "text-stone-600" + "JSON hypermedia has been proposed, specified, and implemented many times. HAL, JSON:API, Siren, Hydra, UBER, Collection+JSON. Each adds a linking convention on top of JSON. Each generates roughly the same amount of adoption: enough for a conference talk, not enough for an ecosystem. The reason is structural, not cultural.") + (p :class "text-stone-600" + "JSON is a data serialization format. It represents maps, arrays, strings, numbers, booleans, and null. That is all it represents. To make it hypermedia you must layer conventions on top: " (em "this key means a link") ", " (em "this object means an action") ", " (em "this array means available transitions") ". The client must know the convention. The convention must be specified in a separate document. The separate document must be read before the response makes sense.") + (p :class "text-stone-600" + "This is exactly the problem Blow identifies with MCP — the client needs upfront knowledge — relocated from the system prompt to a media type specification. You have not eliminated the manual. You have moved it.") + (p :class "text-stone-600" + "HTML avoids this because presentation " (em "is") " semantics. A " (code "