Worlds and traces
Hue maintains a World model for each of your users from your production traces, without any setting to turn on. The World model retains that user’s history across apps and accounts. Each trace adds evidence: what their apps held, as the agent read and changed it. A World at a chosen time holds what Hue knew was true then, including facts a later trace revealed about that moment. A later trace can fill in the body of a message that already existed at that time, but nothing created afterwards is included, and new evidence never changes an instance that is already running or finished. Hue builds these Worlds only from what your traces record. It never fetches data from your real apps, and a World never holds your app credentials. To make a user’s World complete:- Identify the user. Attach a stable user ID to every request’s root span. For an entity other than a user, such as a team, set both
hue.world.entity.namespaceandhue.world.entity.idon the root span instead. - Mark production traffic. Set
deployment.environment.nametoproductionon the resource. Traces from other environments, and traces your evaluation runs and Worlds record, never add to a user’s World. - Import history through the import route. Traces you bring in with Bulk import existing traces add to Worlds by the origin the import recorded. Imported records sent any other way, over OTLP with a project key, count only when they declare
productionthemselves, so an imported evaluation or synthetic recording never becomes a user’s history. - Record real tool calls with content. Capture content and record each tool call on its own span, with the MCP server identity on MCP calls; see Traces and spans.
- Name the account behind each tool call. Hue recognizes the account for some apps from their recorded calls. For other apps, or a user with several accounts of one app, set these attributes on the tool span:
In TypeScript, set them inside
hue.tool with trace.getSpan(hue.getContext())?.setAttributes(...); in Python, use tool.otel_span.set_attributes(...) inside with hue.tool(...) as tool. A tool argument or a matching email address does not identify an account, and these attributes never hold OAuth tokens or credentials.
Choose the starting state
Every instance starts from an immutable starting World, so instances started from the same one begin in the same state.
A run fixes its starting Worlds when it begins, and each case execution, including a retry, gets its own instance. To reproduce an earlier instance of a user’s World, select it on the World’s page and choose Run original: Hue starts a fresh instance from the same starting World, without the earlier agent’s changes. Reproducing needs the original evidence to still be retained.
Use an instance
An instance gives your agent a URL for each app the World includes and a world token to use as the app’s credential.- URLs. Each app keeps its real API paths under a Hue base URL:
https://app.hue.run/api/sim/<real host>/<real path>. Gmail’s REST API becomeshttps://app.hue.run/api/sim/gmail.googleapis.com/gmail/v1, and Slack’s Web API becomeshttps://app.hue.run/api/sim/slack.com/api/. Replace only the base URL in your agent’s existing client; Connect your agent covers clients that need more. - World token. Send the token where the real credential went, usually
Authorization: Bearer <token>. It is scoped to one instance and expires with it. It is not a Hue project key, and it cannot reach your real apps or other instances.
hue eval passes these to your agent as environment variables, HUE_SIM_<SURFACE>_URL and HUE_WORLD_TOKEN. Connect your agent adds one helper so the agent uses them during an evaluation and its production values otherwise.
To use an instance by hand:
- Start it as above. An instance you start this way lasts up to four hours.
- Read its connection values: the Sim URL & Token tab on the instance in Hue, or
get_instance_connectionsover MCP, which returns each app’s URL, protocol and where the token goes. Revealing them needs write access and is audited. Keep the token in your agent’s secret configuration. - Point the agent’s app clients at those values and run the task.
- Inspect what happened: the instance’s State and Server tabs in Hue, or
get_instance_state,list_instance_requests,list_instance_stepsandget_instance_diffover MCP. - Stop the instance when the attempt ends. For a fresh attempt, restart an instance of an authored World, or start another instance of a user’s World. A stopped instance’s data and requests stay inspectable.
Build a World from one trace
To debug a single failed task, an agent connected to the Hue MCP server with?toolsets=debug can build a World from one exported trace, for the apps the build supports.
- Export the complete trace, every observation with its inputs and outputs, as Langfuse observations or OTLP JSON, and keep source credentials out of the export.
- Call
create_world_from_tracewith the export, the task and any facts you know, such as the project the task belongs to. Larger exports upload first withprepare_trace_uploadandcomplete_trace_upload. - Follow
get_world_builduntil the build is ready, then use its instance as above. If the build reports missing evidence, add the facts it names in a new build.