Runtime discovery · 3 min read

Why AI Infrastructure Should Be Self-Describing

Let a worker ask a running service which documentation and capabilities it exposes.

Lemonade · HTTP discovery. Discover — GET /v1/docs. Inspect — GET /v1/docs/api/lemonade. Integrate — Answer with the retrieved reference.

A new worker starts with a service address and a task. Its setup notes mention a model endpoint but say nothing about where to find the server’s own API reference. A static onboarding prompt could list every path the author remembers. The next installation might run a different build. Now the worker has two problems to solve before it can begin the original assignment.

Lemonade PR #3347 made bundled API documentation available through HTTP and MCP. Serving a reference alongside the service gives a worker a concrete starting point for asking what this deployment documents. It also gives an operator something to inspect when a worker’s assumptions and the installation’s behavior disagree. Lemonade PR #3347

Walk the shortest discovery path

curl -s http://localhost:13305/v1/docs
curl -s http://localhost:13305/v1/docs/api/lemonade

The first request starts at the documentation index. The second illustrates retrieving a named reference. An MCP client can use the service’s MCP surface at /mcp to discover its advertised documentation capabilities. Use the advertised names and contracts for that installation. Guessing a tool name from a blog post gives the integration the same maintenance problem as a hard-coded list of URLs.

Suppose a research worker wants to explain how to inspect a server. It can first obtain the index, read the relevant entry, and retain the reference with its observation. The team can later distinguish “the bundled reference describes this operation” from “our worker invoked the operation and received this response.” Both are valuable evidence. They describe different events and belong in different fields in a work record.

Give cached knowledge an identity

For a proposed worker cache I would store the service identity, the observed runtime or document revision when available, the reference path, and when the worker retrieved it. If the server provides a validator, use that on the next read. Otherwise apply a bounded refresh policy. A cache keyed only by product name risks handing one installation’s documentation to another.

Imagine two machines behind the same scheduler. One exposes the index and the other returns an ordinary missing-resource response. Classify the second observation as discovery unavailable on that installation. Retain the URL and response status. The operator can supply a pinned manual or select another worker. A silent fallback to a guessed write operation would turn a documentation mismatch into an execution decision.

Test onboarding with an unfamiliar worker

For a small Fredrin-style integration trial, give the worker a base address and one read-only question. Keep a transcript of the discovery requests, the reference it selected, and the sentence that answers the question. Repeat with a fixture that removes the referenced page. A useful failure report names the missing dependency and preserves the partial evidence so another worker can continue.

For evaluation, count how many steps require a hard-coded service-specific fact beyond the documented entry point. Also check whether the final statement can be traced to the retrieved reference. Discovery reduces the amount of topology that a prompt must carry. Authorization and runtime health still need independent checks. An endpoint can be described, permitted, and temporarily unavailable all at the same time, and a worker that can report those facts separately is much easier to onboard.

Supporting diagrams (4)
Lemonade · entry points. HTTP index — GET /v1/docs. Named reference — GET /v1/docs/api/lemonade. MCP surface — POST /mcp.
Two ways into documentation
Proposed cache record. Installation — observed server identity. Reference — document path. Freshness — revision or retrieval time.
Identify the cached reference
Illustrative discovery fixture. GET      /v1/docs. index    reference listed. GET      /v1/docs/api/lemonade. 404      reference missing on this host.
Preserve the failed discovery step
Proposed experiment. Give — A base address and a question. Observe — Log the index and reference reads. Check — Trace the answer to a source.
A read-only onboarding trial
Web researcher workspaceDiscover a bundled reference ↗