Skip to content

GrainUniversal interaction layer for AI interfaces

Standard vocabulary for every surface where AI meets humans — or AI meets AI.

Interactive preview initializes in the browser.

Use the editor and rendered preview after the page hydrates. The docs site is mounted under /grain/.

Why Grain ​

Grain gives AI producers and interface surfaces one shared contract. A model, orchestration layer, or tool runner can emit Grain once, and adapters can render the same document consistently in the browser, terminal, MCP surface, or agent runtime.

The documentation site is treated as part of the product contract. If an example on this site stops parsing or rendering, that is a repo bug rather than a low-priority docs mismatch.

What This Site Covers ​

  • The Grain language contract and core primitives.
  • Reference APIs for the runtime packages and adapters.
  • Production-oriented notes for npm delivery, GitHub Pages deployment, and local preview.

Local Preview ​

Use the canonical preview command from the repository root:

bash
pnpm docs:preview

The docs site is deployed as a GitHub Pages project site under /grain/, so the correct local preview URL is http://127.0.0.1:<port>/grain/. Opening / is expected to return 404.

Released under the MIT License.