Generative UI with Lyra Gen

Model answers and live dashboards that render as real, validated Lyra controls.

Lyra Gen turns a model’s structured answer into accessible Lyra components through a reviewed catalogue. Generated content can only name catalogue roles, never arbitrary tags, scripts or actions; your application keeps the model request, data, actions and storage. Live dashboards bind your data, queries, repeated rows, computed values and conditional visibility, and each update repaints only the panels it affects. An inspector, mock data, telemetry and a lyra-gen init starter help you build without a backend or a model.

Try a request

  • Show my monthly spending
    • Why is eating out so high?
      • Set an eating-out limit
      • Warn me before I overspend
    • Compare with last year
      • What went up the most?
      • Project the rest of the year
    • Where can I save?
      • Cancel the ones I barely use
      • Set a savings goal
  • How is my shop doing?
    • Where do people drop off?
      • Win back abandoned baskets
      • Mobile vs desktop
    • Which countries are growing?
      • Zoom in on the fastest grower
      • Plan a launch in a new country
    • What sells best?
      • Restock the top sellers
      • Bundle the top two
  • When is my café busiest?
    • Just Saturdays
      • Add a second barista at the peak
      • Compare with Sunday
    • Compare with last month
      • Why did Tuesday drop?
      • Show the last 6 months
    • When am I short-staffed?
      • Plan next week’s rota
      • Should I open earlier?

Example

Select a reviewed catalogue subset, then validate a generated view before rendering it.

import '@aceshooting/lyra-ui/theme.css';
import { initialCatalog, subsetCatalog } from '@aceshooting/lyra-gen/catalog.js';
import { validateView } from '@aceshooting/lyra-gen/runtime.js';
import { LyraGenViewElement } from '@aceshooting/lyra-gen/gen-view.js';

const selected = subsetCatalog(initialCatalog, ['stack', 'heading', 'text']);
if (!selected.ok) throw new Error('The requested catalog is unavailable.');
const catalog = selected.value;
const result = validateView({
  version: '1', catalog: { id: catalog.id, version: catalog.version },
  surfaceId: 'answer-1', revision: 0,
  root: { id: 'summary', type: 'stack', children: [
    { id: 'title', type: 'heading', text: 'Quarterly summary' },
    { id: 'detail', type: 'text', text: 'Revenue increased this quarter.' },
  ] },
}, catalog);
if (!result.ok) throw new Error('The generated view was rejected.');

const view = new LyraGenViewElement();
view.catalog = catalog;
view.document = result.value;
document.body.append(view);

Browse components · Read guide (English)