Sequential learning does not require the whole Domain ontology to be discovered. The public action space, approved state paths, reward semantics, and episode boundaries can be authored, discovered where supported, or mixed. The acquisition schedule is separate again: sequential state can form inside a zero-start run, form in a separate trajectory acquisition phase, or continue from a separately acquired checkpoint.
1. When to use sequential learning
Enable sequential learning when all of the following are true:- the system repeatedly chooses among two or more policies or actions;
- actions influence later observations;
- action quality depends on the current state;
- reward may be delayed, sparse, or distributed over an episode;
- events can be grouped into episodes and ordered by step;
- every action can eventually be linked to a measured outcome.
Sequential learning does not register a separate
sequential entry in learning_state.active_subsystems. It is an episode-aware model path inside feedback_policy. A Domain can therefore report feedback_policy and structured_transition as its active subsystems while sequential learning is enabled. When the sequential candidate trains and passes validation, inspect learning_state.subsystems.feedback_policy.model.report.model_type for sequential_q_mlp.Choose zero-start learning, separate acquisition, or both
The complete declared run determines the acquisition label. A later episode is not warm-started merely because earlier episodes in the same zero-start run produced retained state.
Under the current defaults, the sequential candidate needs at least eight distinct episodes and reserves at least two episodes for validation. A Domain can declare a higher
minimum_episodes. A single test episode may update ordinary contextual evidence when policy admission succeeds, but it does not establish validated sequential_q_mlp behavior.
A separate trajectory acquisition phase helps only when the state fields, actions, reward, terminal meaning, and useful action-value relationship transfer into the new run. Use a zero-start task-local scope when each independently redrawn task has a different hidden mapping and the current context does not identify that difference.
Historical trajectories use the same event and feedback contract as live trajectories. Replay approved records into fresh Domain state, preserve the true episode and step order, wait for asynchronous fitting, and inspect the model report before freezing. See Choose a learning setup for the schedule and scope decision.
2. The learning contract
Each sequential transition must provide this logical tuple:POST /domains/{domain_id}/querysupplies the current context and returns a selected policy plus adecision_id.POST /domains/{domain_id}/feedbackreturns the observed transition and reward.
decision_id gives the strongest sealed binding to the earlier query, but policy admission can recover decision-time context through other supported routes. Current runtime context sources are a valid decision_id (decision), a valid target_memory_id (memory), or explicit structured context (request). Sequential readiness is downstream of this policy-admission step.
The default field mapping is:
All five values must be present and correctly typed for a record to be eligible for sequential training:
episode_id: string or other stable identifier;step: finite number, normally a zero-based integer;next_state: JSON object;step_reward: finite number;terminal: JSON Boolean, not the strings"true"or"false".
Scope rule
Keep the same authenticated owner anddomain_id when learning should carry across episodes. Use metadata.episode_id to separate environment episodes.
On the hosted API, the bearer token determines the effective session; changing the body session_id does not create a new tenant or learner. Use a new Domain for an independent task-state history, or a separate credential for a separate identity. The examples use session_id: ignored for compatibility.
3. Recommended starting declaration
The following declaration is a general starting point for a delayed-reward policy task. Replace the state fields, policies, policy features, and reward limits with values from the real application.Configure the learner
4. Define the policy space correctly
4. Define the policy space correctly
Each selectable hypothesis needs:Poor policy features:Do not make the learned outcome or target action itself an autonomous structure target. A policy-less induced hypothesis is predictive evidence, not an executable action. Action selection must resolve to a declared policy.
- a
namefor humans and traces; - the same
relationfor policies competing in one decision; - a unique, non-null
policyidentifier; - optional
policy_featuresdescribing the action itself; - optional
when,predicts, andfalsified_byclauses for interpretable conditions.
policy is the action identity. policy_features are observable action attributes that let the learner generalize between related actions. They must describe the candidate action, not its result.Good policy features:5. Choose context features
5. Choose context features
learning.context.feature_paths determines which state fields are visible to contextual and sequential model training and inference.Include fields that are:- available before the decision;
- causally or predictively relevant to action value;
- represented consistently at query and feedback time;
- stable in name, unit, and type.
- generated after the action;
- direct encodings of the answer or reward;
- identifiers with no transferable meaning;
- timestamps when elapsed time or phase would be more useful;
- high-cardinality provenance that encourages memorization.
feature_paths list uses all structured leaf fields. This is convenient for exploration but risky in production because IDs, logging fields, and accidental outcome leakage may enter the model. Explicit paths are recommended.context.event_types filters stored events when a query asks Adapt-1 to infer the latest context. It does not replace explicit query context. Supplying context directly is the clearest and least ambiguous path.context.max_samples bounds retained policy examples. For sequential tasks, size it to retain several representative episodes:2048 or 4096, not the default 512. Replay eviction balances episode groups and preserves failure evidence, but it cannot recover transitions that were never retained.6. Define a real reward
6. Define a real reward
Policy learning only updates from measured reward. A successful HTTP response does not imply that the feedback changed the learner.Declarative reward componentsEach component supports:Without components, Adapt-1 recognizes numeric
Aggregation modes:
Example with performance and safety:
values.reward, values.score, or values.utility; Boolean correct, success, or accepted; and recognized binary outcome labels. Fields such as error_distance have no implicit reward meaning. Either declare them as components or compute a normalized reward externally.Reward scale and neutral rewardKeep rewards in [0,1]. The default neutral point is 0.5:- below
0.5is disadvantageous; 0.5is neutral or unresolved;- above
0.5is advantageous.
[-100,100] with min: -100, max: 100, and goal: maximize.Do not invent a success or failure label for an unknown outcome. Use an outcome value accepted by the current feedback schema and provide the numeric field required by the reward declaration. Do not rely on undocumented outcome labels; the live validator is authoritative for accepted enum values.7. Configure sequential return learning
7. Configure sequential return learning
Sequential parametersApproximate examples:
The learner uses episode-held-out validation. The last portion of ordered episode IDs is reserved for validation, with at least two validation episodes. A model is installed only when its validation skill meets the declared threshold. This is why one long episode is not a substitute for multiple episodes.Picking
discountUse the effective horizon as a guide:Very high discount values can propagate noise and make policies hard to distinguish. Start from the shortest horizon that can still reach the delayed consequence of interest.Picking
n_step- Dense reward every step: start at
1to3. - Reward after a short action chain: start at
4to8. - Sparse terminal reward: start at
8to20, with eligibility traces enabled. - Highly stochastic outcomes: use a smaller value and more episodes.
n_step does not need to equal the episode length. It controls the direct return window before the model bootstraps from the successor state.8. Configure delayed credit
8. Configure delayed credit
credit_assignment.mode controls synchronous reward attribution in the online policy state. Sequential Q learning separately consumes the episode transitions and returns.With eligibility traces enabled, a later non-neutral
step_reward can update earlier neutral transitions in the same episode. Propagation stops at a prior non-neutral signal, a terminal boundary, an unchanged transition, or the minimum weight cutoff.Use mode: none when rewards are immediate and accurately assigned. Use eligibility_trace when the effect arrives later than the responsible action.Do not use a large minimum_weight for long sparse-reward episodes. With discount: 0.95, a cutoff of 0.05 reaches roughly 58 steps; a cutoff of 0.01 reaches roughly 90 steps.9. Configure exploration and selection safety
9. Configure exploration and selection safety
Exploration modes
The Domain configuration sets the default, but exploration only occurs when the query sends
allow_exploration: true. A query can temporarily override the mode with selection_mode.exploration_strength scales UCB uncertainty. 0 removes the UCB bonus. Values near 0.5 are cautious, 1.0 is a reasonable start, and values above 1.0 deliberately favor underexplored actions.Selection gatesThese gates are deployment controls, not training accelerators. Keep them loose while collecting initial coverage, then tighten them using held-out operational data. The client must always handle
status: "abstained"; abstention is a valid safety output.10. Configure transfer and nonstationarity
10. Configure transfer and nonstationarity
Policy transfer
Set both transfer strengths to
0 when actions or relations have unrelated semantics. Increase action_transfer_strength only when policy features have stable physical or operational meaning. Transfer never crosses owner, Domain, or session scope.Decaydecay_half_life_seconds exponentially reduces the influence of older feedback. 0 disables time decay.Use decay for regime changes, market drift, changing users, or equipment aging. Pick a half-life in application time, not request count. It should be longer than ordinary noise but shorter than the expected persistence of obsolete behavior.Examples:- stable physical process:
0or several months; - weekly operational drift: several days to weeks;
- intraday regime changes: tens of minutes to hours;
- controlled reversal test: long enough to retain evidence, short enough for new evidence to dominate.
11. Configure latent belief
11. Configure latent belief
Latent belief separates recurring or changing context regimes without requiring the client to provide a regime label.
Tuning effects:
- Lower
novelty_threshold: creates regimes more readily; useful for distinct modes, risky with noisy features. - Higher
novelty_threshold: merges more contexts into one regime. - Lower
temperature: sharper regime assignments. - Higher
temperature: blends evidence across nearby regimes. - Lower
change_point_patience: reacts faster and risks false changes. - Higher
historical_regime_weight: improves recurrence reuse but increases interference from old regimes.
12. Configure offline model training
12. Configure offline model training
Feedback updates the online posterior synchronously. Neural model fitting is asynchronous and feedback-triggered. The API remains available while training runs.
retrain_interval: 20 is not inherently too early for a 2,000-sample task. It means at most one new fit for every 20 accepted feedback samples after the minimum. Choose the interval from the acceptable compute load and adaptation delay:- rapid drift, cheap fitting:
8to20; - stable task, moderate load:
32to100; - expensive fitting or very large streams:
100or more.
minimum_episodes. A fit triggered before enough episodes exist may train the ordinary contextual candidate; once enough valid episodes accumulate, the sequential candidate can be trained and validated.13. Execute the online loop
Step 1: query before acting
decision_id;selection.status;selection.selected_policy;- the exact action actually executed;
- the pre-action context.
Step 2: observe the transition
After executing the selected policy, collect:- the successor state;
- the reward components;
- whether the episode ended;
- the episode ID and step;
- any measured delay.
Step 3: write decision-linked feedback
next_state object and must send "terminal": true.
decision_id is the preferred binding for a query → action → outcome loop because it uses the sealed pre-action context. It is not the only context route. Current runtime policy admission can also recover context from target_memory_id or from explicit structured context. In every case, send the executed relation and policy explicitly and verify that credit_assignment.contextual_learning_applied is true.
Current admission checks require the relation field to be present and do not validate its value against the bound decision. Send the real relation from the Domain. A successful feedback response without relation can store the record while leaving feedback_policy.sample_count unchanged.
14. Batch feedback without losing sequence semantics
POST /domains/{domain_id}/batch accepts ordered event and feedback operations. Every feedback operation retains its own decision_id, metadata.episode_id, metadata.step, successor state, reward, and terminal flag.
Batching reduces HTTP overhead; it does not remove the need for per-transition identity. It is safe when decisions have already been made and their results are being uploaded together. It cannot replace the online query loop when the next action depends on the previous query result.
Minimal shape:
15. Read the diagnostics
Request a normal Domain query and inspect:
The top-level
learning_state.sample_count is an aggregate across active learning subsystems. Use the feedback-policy subsystem count when diagnosing sequential policy learning.
Do not wait for a separate sequential subsystem to appear. Sequential return learning is represented by the model lifecycle inside learning_state.subsystems.feedback_policy. Before feedback_policy.sample_count increases, the episode, sample, training, and validation thresholds for sequential_q_mlp are not yet relevant. Samples admitted by the separate structured_transition subsystem do not satisfy the policy learner’s sample or episode gates.
Evidence that sequential learning is active includes all of the following:
- feedback-policy
sample_countincreases after accepted feedback; - multiple valid episode IDs are retained;
- model status advances from
waitingtorunningand theninstalled; - the installed model type is
sequential_q_mlp; - validation skill meets the configured threshold;
- sequential expected rewards differ across policies or contexts;
- frozen exploit decisions improve on held-out episodes without feedback writes.
16. Freeze evaluation correctly
To measure learned behavior rather than continued adaptation:- train only on the training partition;
- wait for asynchronous training to complete;
- stop all
/feedbackwrites; - query held-out episodes with
allow_exploration: false; - use
selection_mode: "exploit"; - keep the same authenticated owner and
domain_idso the trained state remains available; - use unseen episode IDs, and preferably unseen scenarios or entities;
- record abstentions as abstentions rather than silently replacing them in the Adapt-1 score.
Advanced configuration
17. Tuning profiles
17. Tuning profiles
These are starting profiles, not guaranteed optima.Sparse delayed rewardUse when most steps are neutral and terminal outcomes carry the useful signal.Dense short-horizon controlNonstationary or reversal-prone taskSet the decay half-life in real application time. Collect exploration data in a safe environment before enabling these deployment gates.Many structurally similar actionsUse informative
86400 is one day and is only an example.High-stakes conservative deploymentpolicy_features, set action_transfer_strength around 0.1 to 0.25, and increase conservative_weight when many actions remain unsupported. Verify with an ablation against action_transfer_strength: 0 to confirm transfer helps held-out actions rather than blending distinct ones.18. Advanced bound-transition projection
18. Advanced bound-transition projection
learning.sequential.bound_transition is an optional non-neural projection for tasks with explicitly bound state objects and action roles. It can estimate how a declared transition action changes a bounded objective and blend that estimate into policy scoring. Most sequential tasks should leave it disabled.It is appropriate when:- one context contains multiple indexed entities or objects;
- a policy selects which entity is the current state and optionally which is the action source;
- action roles can be declared from policy features;
- the objective has known numeric bounds;
- state transformations can transfer between structurally similar bindings.
This surface is for explicit, reusable structural bindings. Do not enable it merely to increase a benchmark score. If the application cannot state what the selectors, state features, action roles, and objective mean independently of its evaluation labels, use the ordinary sequential learner.
19. Common failure modes
sample_count stays at zero
First distinguish storage from learner admission. A successful feedback response can store the record while leaving feedback_policy.sample_count unchanged.
Check:
learning.enabledistrue;- feedback includes a real measured reward;
relationis present in the feedback request;- the executed
policyis present and is one of the declared hypotheses; - decision-time context is recoverable from a valid
decision_id, a validtarget_memory_id, or explicit structuredcontext.
credit_assignment.contextual_learning_applied. If it is false, the record did not enter contextual policy learning even if the HTTP request succeeded. Current responses report the context route under credit_assignment.context_source as decision, memory, or request.
An unrecognized outcome label does not update policy learning unless a numeric, Boolean, or declarative reward is also present.
Feedback count rises but no sequential model appears
Check every row for all five configured sequential paths and types. Then check:- at least
minimum_episodesdistinct episode IDs exist; - replay capacity retains enough rows from those episodes;
- training has reached
min_samples; - Torch or the configured training service is available;
- asynchronous fitting has completed;
- validation skill meets
minimum_validation_skill.
Every decision abstains at the start
Useallow_exploration: true during data collection. With no policy evidence and exploration disabled, abstention is expected. Keep strict confidence, dominance, and OOD gates disabled until there is enough coverage.
Decisions return selected_policy: null
Only declared hypotheses with non-null policies are executable. Predictive or induced hypotheses without a policy cannot be selected as actions. Verify that all competing policy hypotheses share the requested relation and have unique policies.
Learning becomes worse across episodes
Check for:- reward direction or normalization errors;
- incorrect decision-to-feedback linkage;
- outcome leakage in context features;
- reused episode IDs or non-monotonic steps;
- too-small replay capacity;
- excessive transfer between unrelated actions;
- too-high discount or
n_stepfor noisy rewards; - validation episodes drawn from a different regime due to lexicographic episode naming;
- exploration still enabled during evaluation;
- client fallbacks being scored as if Adapt-1 selected them.
The model trains but policy ordering stays flat
Inspectvalidation_skill, sequential_expected_reward, model weight, and OOD status. Common causes are constant rewards, action-independent features, identical policy features, low action coverage, a feature path mismatch between current and successor state, or OOD downweighting.
20. Building the learner for a new use case
20. Building the learner for a new use case
Use this sequence:
- Define the decision. Write one sentence: “Given state X, choose one policy from Y to maximize measured outcome Z over horizon H.”
- Declare policies. Give every executable action a unique policy and observable policy features.
- Declare pre-action state. Select only fields known before acting.
- Define reward mathematically. Normalize every objective to
[0,1]; specify tradeoffs and hard constraints. - Define episode boundaries. Establish stable episode IDs, ordered steps, successor state, and terminal semantics.
- Estimate the horizon. Pick the shortest discount and
n_stepthat reach the relevant consequences. - Size replay. Retain enough transitions from enough complete and diverse episodes.
- Choose exploration. Explore in a safe environment; exploit or abstain in high-risk deployment.
- Set validation gates. Require positive held-out skill and keep conservative penalties when action coverage is incomplete.
- Instrument the loop. Persist decisions and verify that every executed action receives correctly linked feedback.
- Run ablations. Compare sequential enabled/disabled, transfer enabled/disabled, and latent belief enabled/disabled.
- Freeze and evaluate. Use unseen episodes with no feedback writes and no exploration.
21. Pre-deployment checklist
21. Pre-deployment checklist
- The authenticated owner and Domain stay stable across training episodes.
- Every policy is unique, executable, and attached to the queried relation.
- Policy features describe actions, not outcomes.
- Context features contain no post-action or answer information.
- Reward is measurable, normalized, and directionally correct.
- Every feedback row has episode, step, next state, step reward, and Boolean terminal.
- Every executed action has one valid decision-time context binding: sealed
decision_id, validtarget_memory_id, or explicit structuredcontext; usedecision_idfor sealed query attribution when available. - Replay capacity covers several representative episodes.
- Exploration is enabled only where exploration is acceptable.
- The client handles abstention explicitly.
- A
sequential_q_mlpis installed only after positive held-out validation skill. - OOD and confidence behavior is tested before high-stakes deployment.
- Evaluation is frozen, held out, and free of feedback writes.
- Results include variance, coverage, abstention, and learning curves rather than only the best episode.
Sequential Discovery
Start with the Discovery behavior, public boundary, and minimal contract.
Discovery overview
Review Transition, Structure, and Sequential Discovery together.
