Skip to main content
The World Model isn’t just a set of numbers — it’s a graph: metrics connected to the drivers that move them, the components they’re built from, and (soon) the actions that change them. The @oxy-hq/sdk World Model interface exposes that graph to a customer app so you can build experiences that let people navigate their business, not just read a dashboard.
Alpha. The node interface below — useWorldModel() and the expand / drivers / explain / size / drill verbs — ships today and is backed by the metric-tree analyses. It is a design preview and may still change. drill is intentionally limited (see below); action simulation is not yet built (see Simulate an action).

The node paradigm

Everything in the World Model is a node, and every node speaks the same verbs. Learn them once and they compose across the whole surface: render a node, let the user pick a verb, get more nodes back, recurse.

Get the interface

A single hook — useWorldModel — returns the whole interface, scoped to the customer app’s project. It must run inside an OxyAppProvider. Everything else hangs off it: grab a node with metric(id) and the node speaks the verbs.
world.metric(id) returns a handle. Each verb is an async method on the handle, so you can nest them into a click-to-open UI.

Expand into components and drivers

expand fetches one hop of the tree on demand — the metric’s components and drivers — returning each child as a { node, edge, handle } you can render and recurse into.

Explain a move

explain decomposes a period-over-period change, recursively splitting the metric by its components and dimensions until the move concentrates — so you can show where a number came from, not just that it changed.

Size the opportunity

size finds underperforming segments and quantifies the upside of closing the gap to their peers — “match the best” across a dimension.

Drill into a segment

drill narrows a handle to a dimension = value segment and returns a new, scoped handle. Structural verbs (node, expand, drivers) are scope-invariant and keep working on it.
explain and size on a drilled handle throw. The metric-tree backend cannot yet scope those analyses to a segment, so rather than silently return population numbers for a scoped question, a drilled handle throws a WorldModelScopeUnsupportedError from explain/size. Catch it and fall back to the un-drilled node, or gate the buttons on handle.scope:

Simulate an action

Not built. Actions are the frontier of the World Model and have no SDK surface yet — the sketch below is the proposed shape, not a working API. Nothing in this section is callable today.
An action is a lever a human can pull — hire, raise prices, open a store. Actions would live in a catalog and declare only the leaf measure they directly move; everything downstream is already described by the metric tree’s drivers, so the SDK can propagate the effect for you — carrying the nonlinearity in the drivers.
Because the nonlinearity lives in the driver, not the action, the same hire would produce a different lift depending on where each store sits on its curve — which is what makes size + simulate compose into a ranked recommendation:
Hire 2 servers at San Mateo → +0.14 CSAT (4.62 → 4.76) → +$28k/mo. Diminishing returns past a 3rd hire.
The knots of a piecewise driver are inspectable metadata, so the interface can say why the returns diminish rather than emit an opaque number.

The entity-graph hook

useWorldModel() now names the node interface above. The hook that returns the raw semantic-model entity graph — entities, their measures/dimensions, and how measures promote up the hierarchy — is now useWorldModelGraph().

What it’s built on

The node interface is a thin composition layer over the metric-tree analyses that already ship — it adds no new backend. If you want the underlying calls directly:
  • React hooksuseMetricTree, useSensitivity, usePredict, useExplain, useOpportunity, useTimeDimensions, plus useBaseline and useProjection for scenario forecasting (same /semantic/metric-tree* endpoints, request/response shapes matching the server verbatim).
  • Node clientMetricTreeClient (getTree, getSensitivity, predict, explain, findOpportunities, getBaseline, getProjection) for API-key / server-side use — see Hooks & components.
These are the same analyses that power the IDE’s opportunity sizing and metric tree.

Try it

A runnable example lives in the SDK repo at sdk/typescript/examples/world-model-demo.tsx — an interactive explorer that starts at one top-line metric and walks the whole business from it (expand into drivers, explain a drop, size a gap), every object a live handle rather than a static number. Copy it into a bundle scaffolded with pnpm dlx create-oxy-app.

Next steps

The Metric Tree

Component vs. driver edges, forms, and promotion

Opportunity sizing

How the graph sizes a gap and decomposes it into drivers

Hooks & components

The stable SDK surface MetricTreeClient sits in

World Model

The semantic model, metric tree, and entity graph behind it