Skip to main content
Configure a Domain to learn a bounded sequence of numeric controls. The examples below define the interface used by the acquisition and refinement guides. You need a Unit API Key and an application that can reset or observe an environment, execute bounded controls, and measure what happened. Start with execution patterns if you are still choosing the control interface.

Match the controls to the executor

Define which values your application can measure, which controls it can execute together, and how long each command lasts. Set the dimensions and horizon from that interface. The two-actuator example below shows the API shapes; replace its coordinate meanings with your own measured contract.

Choose the API surface

After creating the Domain, configure its trajectory learner by sending the mechanism inside the config object to /trajectory/configure.

Connect to the API

Send Authorization: Bearer <Unit API Key> and Content-Type: application/json. Keep the key server-side. The bearer token determines the owner; omit body session_id and never send a trusted owner header to select a tenant.

Define the vector schema

Consider a planar platform with two continuous control coordinates. This small example has four state coordinates and up to eight commands. Replace these choices with your own measured interface. The goal specifies the desired state. goal_indices: [0, 1] maps the two goal coordinates into the state vector. Every index must be smaller than state_dimensions; the goal length must equal the number of goal indices. Keep names, units, ordering, scaling, and invalid-measurement rules in an application-owned manifest. The trajectory API receives numeric arrays; your manifest defines the physical meaning of each position. action_dimensions is the number of values applied together in one command. horizon limits the ordered command count. Their product gives the maximum number of scalar outputs in a proposal. A later retained sequence may be shorter than the acquisition horizon.

Separate API configuration from executor configuration

For this example, the application holds each command for 0.5 seconds and uses a fixed eight-slot execution window. If structural deletion shortens the logical sequence, it appends neutral commands to the unused slots. That preserves the physical duration while the logical command list changes. Implement and version command_duration, action_bounds, and padding in your executor, outside the trajectory configuration body. A neutral command applies the declared neutral actuator input. The platform may continue moving under its existing velocity. For a concrete outcome contract, define completion as finishing within 0.05 metres of the goal with speed at most 0.1 metres/second. Assess it after the eight-slot window, or at a declared earlier task-terminal state. A safety stop sets completion to false. The acquisition reward and structural completion objective both use float(completed). These tolerances are example application settings; choose and keep fixed the values appropriate to your task.

Create and configure the Domain

Choose a fresh run-specific Domain ID. POST to https://rei-neuroadapt-api.reilabs.org/api/v1/domains:
Then POST {} to /domains/control-example-UNIQUE-acquisition/trajectory/state. Require status: "not_configured" before configuring a fresh trajectory learner. This check concerns trajectory state. Check the state of any other Domain mechanisms your workflow uses separately. POST to /domains/control-example-UNIQUE-acquisition/trajectory/configure, relative to the production base:
The dimensions and resource settings above are an example profile. Choose them from the actual interface and the number of proposals your runner can execute and reconcile. Capacity limits retained records. Set the attempt budget in your runner. Start with one pending proposal while checking an adapter, then increase concurrency only when every returned decision can be matched to its measured execution.

Acquisition fields

These limits come from the reference request schema. A deployed service can impose lower account or runtime limits. Read and save the resolved configuration; do not assume schema maxima are available capacity. For reward, explicitly return the application’s measured outcome after execution. Keep its direction and scale fixed. Using goal_error requires an adapter that implements the deployed goal-error contract.

Optional acquisition profile

The following optional settings control proposal edits and retention. Choose them for your measured feedback and execution contract:
Merge this configuration fragment into config before initial configuration. The minimal example leaves native defaults in place. Enable progress-related options only with a defined, measured per-command outcome stream; do not manufacture intermediate outcomes from the terminal value. Save the full resolved settings with the run.

Choose the feedback granularity

The example uses outcome_mode: "reward" and a binary completion measurement. You can define a more informative measured reward for your own task while keeping the same proposal and observation shapes. Keep the completion test separate from the learning score. Preserve score direction, scale, and assessment time within a learning run. If you change this example’s binary scorer, also change the binary validation in the acquisition loop. Supply step_outcomes only when you measure outcomes at each executed command.

Request helper

The following helper uses the Python standard library. Set ADAPT1_API_KEY in the server process environment. All later snippets use these functions and the same PREFIX.
Generate PREFIX once, then persist and reload it to resume. Regenerating it creates a new lineage. The helper sends HTTP requests. Your runner supplies execution scheduling and recovery. Add request-intent and response recording before a long run, as described in Retained use and recovery.

Check the configured interface

Read /trajectory/state and save the resolved mechanism and configuration with your executor manifest. Then make one measured attempt and confirm its observation acknowledgement before increasing the run budget. Check each mechanism your application will use: acquisition, one complete structural comparison, and contextual evaluation. For precision refinement, also check support for the optional context and search settings. Preserve rejected fields and their validation errors for diagnosis.

Choose the next guide

Acquire a sequence

Propose, execute, validate, and return actual trajectory observations.

Structural stages

Export acquired records and run selection, deletion, and ordering.

Contextual refinement

Configure contexts and evaluate candidate offsets around a retained base.

Retained use and recovery

Execute with learning stopped and reconcile interrupted operations.