Product

Generative UI in Nakshi

Nakshi now answers with the interface the question calls for. A system comes back as a stack of cards. A network or a cycle comes back as a diagram. A figure that moves comes back as a chart. A how-to stays a list of steps, and a single fact stays a sentence.

The person does not specify the layout. They ask the question. The model picks the component by the shape of the content, writes it into the reply, and the app draws it. The prose around the component keeps streaming while the component is still open.

ChatGPT's Intelligent UI is the reference for this. The model chooses the format, and text remains the default when text is the right answer. Gemini's dynamic view generates a page of HTML, which can take a minute. We wanted the first behavior at the speed of chat: a small library of components, drawn as the model emits them.

What an answer looks like

A question such as "how does a generative interface work?" comes back as a stack. The model designs it. The first banner is navy and the last is green. The middle is a panel. A pill is only for the pipe between two layers. Items with a line of text become tinted tiles. Items that are only a title become a two-column list of icons. The control on the figure switches between those two panels.

How a generative answer is drawn

Your question

How does a generative interface work?

Pictures the reply can use
  • The question

    Ordinary words

  • A stack

    Top to bottom

  • A network

    Cards and arrows

  • A chart

    One unit

one fence
Nakshi draws it

The type, the color, and the arrows

A stack for "how does a generative interface work?" The switch changes the middle panel from tiles to an icon list. Download saves SVG or PNG, without the button.

Two to four things, each in its own words, go in one card: a title, a line, and a badge for the verdict. A photo is included only when a page read on that turn returned one. A product grid and a comparison of the same attributes are different components.

Which picture
  • Layers

    A system with an order, top to bottom.

    • Opening and closing banners
    • A panel of parts in the middle
    How an OS is built
  • Diagram

    Parts that point at each other.

    • Each part is still a card
    • ELK places the cards and the arrows
    A network or a cycle
  • Chart

    A number that moves, in one unit.

    • Bar or line
    • Switch to the table of the same numbers
    Only sourced figures
Two to four things, each with its own line and a verdict.

A network or a cycle is a diagram. Each node is a card. ELK, the same layout engine the Mermaid preview uses, places the nodes and routes the arrows. The model names the parts. It does not emit SVG. The figure below is that path, from the question to the card.

From the question to the card
The path from the question to the card. Expand opens it at full size. If layout fails, the same cards remain as a list.

How a reply is built

A reply is streamed Markdown. A component is a fenced block in that Markdown, the same kind of fence as a code sample, tagged with the component. Most replies contain none. A component is for content that has a shape of its own: a sequence, a figure, a series, a few things set side by side. It is not a container for a paragraph.

```nakshi:layers
{
  "layers": [
    { "kind": "banner", "tone": "navy", "title": "Your apps", "text": "What you tap" },
    { "kind": "panel", "title": "The system", "items": [{ "title": "Kernel", "icon": "box" }] },
    { "kind": "banner", "tone": "green", "title": "The hardware", "text": "CPU, memory, disk" }
  ]
}
```

The model reads a guide with one line per component: its fields and what it is for. "How is this built" is layers. "How do these parts talk" is diagram. "How has this number moved" is chart. "How do I" is steps. A programming question stays code. Worked examples span those shapes and include an answer with no component, because a model copies an example more readily than it follows a rule. A short reminder comes last in the turn, so a long conversation cannot bury the guide. The person never writes a fence.

Each fence streams on its own. A list-like component draws its finished items as they arrive: the first step shows while the second is still being written, and text cut off mid-word never shows. A chart waits for its fence to close, because a half-drawn series misleads. The sentences around the fence keep arriving. The parser repairs the failures we have already measured, such as a bracket closed in the wrong order, a number written in Bangla digits, or a duplicate node in a diagram. A block that still does not read is shown as text, never as raw JSON.

Charts are the strict case. Bar or line, one unit, and every value has to come from a source read on that turn. A chart the model filled in from memory is worse than no chart. A few headline numbers are stats, not a chart. A recipe carries a servings control that rescales the quantities. A calculator takes its inputs on the card. Those two are tools. The stack and the diagram are figures.

What we retired

After the runtime shipped, chat was switched to one nakshi:surface document per reply, with a card around each paragraph. The whole answer sat inside a single fence, so nothing rendered until the JSON closed. The model spent the reply on ids and escaped strings, and every explanation looked like the same set of boxes. We retired that policy for chat on 19 November 2026. Messages already saved in that format still render. New replies do not emit it.

Telegram has no renderer for these components, so a reply there stays text.

The prompts we use to check this are ordinary questions: "How does an operating system work?", "How does the water cycle work?", and how a price has moved over several years. The last of those is a chart only when the turn has a source for the numbers.

Open source

The framework under all of this is @nakshi/genui, Apache-2.0. Each component is defined once: its schema, what may show while it streams, the line the model reads, its plain-text form and, for charts, the figures to check against the sources. From those definitions it writes the guide, splits a streaming reply, reads every block with the repairs above, and gives the same answer as text for channels without pictures. Nakshi runs on the same packages.

Eleven ready components ship with React views. A kit measures how a model writes them: whether it uses the right component, whether every block reads, and how soon the first one can be drawn. Every component is drawn live, from real model replies, on its page on Nakshi Engineering, with the benchmark across five models.

Open sourceApache-2.01.0.0

The framework

The components above run on these packages, and so does every Nakshi reply. A reply stays Markdown, with a component only where the content has that shape. Each component is defined once, and any model that streams text can write it. The vault, the agents and billing are not in these packages.

npm install @nakshi/genui @nakshi/genui-react @nakshi/genui-blocks
  • @nakshi/genuiStart here

    The core: define a component once, then write the guide, split a streaming reply, read every block, and give the answer as text. Any model. No framework.

    GitHubnpm
  • @nakshi/genui-react

    <Answer> draws a reply as it streams: finished items while a block is still being written.

    GitHubnpm
  • @nakshi/genui-blocks

    Eleven ready components with views: steps, checklist, recipe, chart, compare and more.

    GitHubnpm
  • @nakshi/genui-eval

    Measure how a model writes them: the right component, blocks that read, time to the first one.

    GitHubnpm