Docs⌘ K  Search
Docs/Memory/Outcome Memory
Outcome Learning

Outcome Memory

Let your application learn which action works best from the results you report. You list the options, Hebbrix picks one, you carry it out and report whether it worked. Over time it picks the winner more often.

1
Set up
Name a decision and the actions your application is allowed to take.
2
Decide
Ask Hebbrix to pick one. It records what it chose and with what probability.
3
Report
Carry out the action yourself, then report whether it worked.

01. What it is for

Use Outcome Memory when your application chooses between a few allowed actions and can tell, sooner or later, whether the choice worked: which reply style resolves a ticket, which retry strategy fixes a failing job, whether to escalate or answer directly. Each choice is a decision; the result you report is its outcome.

Hebbrix never performs an action and never grants permission. Your code decides what is allowed and carries the action out. A decision whose outcome you never report stays unknown; it is not counted as a failure.

Plan availability

Outcome Memory is available on every plan, Free included: metrics, policies, decisions, outcomes, corrections, advice and insights. These requests cost 0 operation credits; creating decisions follows your plan's per-minute request limit. Only two parts are gated. The batch routes, POST /v1/learning/decisions/batch and POST /v1/learning/outcomes/batch, need Starter or above. GET /v1/rl/metrics and POST /v1/rl/evaluate, the metrics and evaluation of the separate reinforcement-learning agents rather than Outcome Memory, need Pro. GET /v1/users/me/capabilities reports your account's gates.

02. Quickstart: watch it learn

This simulation offers two reply styles. One secretly works 80% of the time and the other 30%. Hebbrix is never told the rates; it only sees the results the loop reports. Run it with a test API key: it makes 40 decisions, about 80 requests, which stays inside every plan's per-minute decision limit (60 on Free).

Quickstart: watch it learn (Python)
import os, random, uuid
from hebbrix import SyncMemoryClient

learn = SyncMemoryClient(api_key=os.environ["HEBBRIX_API_KEY"]).proofloop
rates = {"short_reply": 0.3, "detailed_reply": 0.8}  # true success rates, kept secret
key, ctx, picks = f"demo-{uuid.uuid4().hex[:8]}", {"channel": "chat"}, []
schema = {"version": "v1", "fields": {"channel": {"values": ["chat"]}}}
allowed = {"target": "reply", "risk_tier": "low", "exploration_allowed": True}
options = [{"action_key": a} for a in rates]
learn.setup_policy(key, user_id="demo", context_schema=schema,
                   actions={a: {"description": a, **allowed} for a in rates})
for i in range(40):
    d = learn.decide(policy_key=key, user_id="demo", context=ctx, candidates=options,
                     idempotency_key=f"{key}-{i}")
    picks.append(d["chosen_action_key"])  # your app would act on this, then report:
    worked = random.random() < rates[picks[-1]]
    learn.record_outcome(d["decision_id"], success=worked, idempotency_key=f"{key}-{i}-out")
    if i % 10 == 9:
        n = picks[-10:].count("detailed_reply")
        print(f"decisions {i - 8}-{i + 1}: chose detailed_reply {n} of 10")

This is the output of one real run. Your counts will differ, because the simulated results are random:

Output
decisions 1-10: chose detailed_reply 8 of 10
decisions 11-20: chose detailed_reply 8 of 10
decisions 21-30: chose detailed_reply 8 of 10
decisions 31-40: chose detailed_reply 9 of 10

Hebbrix starts with no evidence, so its very first picks are a coin toss. After a handful of reported results it picks detailed_reply most of the time, while still trying short_reply now and then in case things change. With a smaller gap between the two success rates it needs more decisions to become sure.

03. How it chooses

  • For each action it keeps an estimate of how often the action works and how sure it is, built only from that action's own outcomes. An action nobody has tried yet starts at the prior you configured for it (otherwise "anything from 0 to 1"), never at another action's results.
  • For each decision it weighs how good each action probably is against how much trying it would teach, and picks with those probabilities. Uncertain actions still get tried, a clear winner wins most of the time, and every action you declared explorable keeps a small chance of being picked.
  • The order you list candidates in never matters. Only your declarations and your evidence decide.
  • It explores freely only among actions you marked risk_tier: "low" and exploration_allowed: true. Actions whose risk you did not declare are tried only within a safety guarantee against your current action. An action you declared not explorable is never tried just to learn.
  • It learns separately for each context you declare, such as ticket type or customer tier, and notices when the best action changes over time.
  • Every decision counts every outcome you reported before it, and returns a receipt with the probabilities it used and the evidence it saw, so you can audit any choice later.

04. Use it in your application

In a real application the same three calls wrap your own action. The SDKs group them under client.proofloop; the snippet assumes an authenticated async client and an existing collection.

Python: set up, decide, record the outcome
await client.proofloop.setup_policy(
    "support.reply.v1", collection_id=collection_id, user_id="customer-42",
    context_schema={"version": "v1", "fields": {
        "issue": {"values": ["delivery", "billing"], "required": True}
    }},
    actions={
        "explain": {"description": "Explain the delivery status", "target": "ticket",
                    "risk_tier": "low", "exploration_allowed": True},
        "review": {"description": "Request a support review", "target": "ticket",
                   "risk_tier": "low", "exploration_allowed": True},
    },
    configuration={"strategy": "posterior_sampling"},
)
receipt = await client.proofloop.decide(
    policy_key="support.reply.v1", collection_id=collection_id, user_id="customer-42",
    mode="auto", context={"issue": "delivery"},
    candidates=[{"action_key": "explain"}, {"action_key": "review"}],
    idempotency_key="ticket-42-decision",
)
# Read receipt["chosen_action_key"]. Your application separately checks permission,
# performs that action, and determines actual_success. Do not score a proposal.
await client.proofloop.record_outcome(
    receipt["decision_id"], success=actual_success,
    idempotency_key="ticket-42-result",
)

The TypeScript SDK has the same calls as setupPolicy, decide and recordOutcome. These work in the current SDKs, Python 2.12.0 and TypeScript 2.10.1. Keep the same collection and user scope throughout. Use a new policy/version when changing an action, target or outcome meaning; missing outcomes remain unknown.

Recommended integration defaults

  • Use native mode: "auto" when Hebbrix should select among actions your application already allows. Use the returned chosen_action_key, not the largest rounded number in an advice card.
  • Use mode: "observe" only when another controller intentionally chooses. Report its actual complete choice distribution if known; model confidence and advisory samples are not execution propensities.
  • Use advice as context for an external chooser, not as proof that an LLM will follow it or explore. Independently check present permissions and required human approval before every side effect.
  • Declare relevant context and risk before collecting outcomes. A new policy set up with defaults gets the default learner: declare risk_tier: "low" and exploration_allowed: true on the actions it may explore freely. It notices changes over time by itself, so change_response: true is not needed; sent at setup, it keeps the default learner and the receipt says so. For v3 posterior sampling with its change-response heuristic instead, set up with learning: "adaptive".
  • To change a policy, PUT its configuration with the current expected_revision. The update keeps every setting it leaves out, schema_version included, but actions and the optional components (value_objective, horizon, selection_controls) are replaced by what you send: leaving one out removes it.
  • An action's target and description are its definition. Changing either under the same key starts that action's evidence over, under every learner, in decisions and Insights alike: outcomes recorded under the earlier definition no longer count for it. Policy settings (risk tier, exploration, autonomy, priors, thresholds) never reset evidence, and unchanged actions keep theirs. For a deliberate wording fix that does not change what the action does, send keep_evidence: true on that action in the update; the kept definitions appear as the read-only evidence_from. The update response's evidence_identity reports each action as new, unchanged, reset, kept or removed, and decision receipts and Insights carry each action's definition fingerprint and the configuration revision. When an action now does something else, a new action key is still the clearest choice.
  • Send decisions with the same collection_id and user_id the policy was set up with. A mismatch returns 409 policy_not_configured_for_scope instead of silently never learning; send allow_unconfigured: false to make every unconfigured scope an error.
  • Read winner_evidence.missing in the weekly report to see what a leader still needs (more evaluated outcomes, a higher lower bound, or separation from the runner-up).

05. Reference

The sections below describe every option in detail. You do not need them to get started. Changes from one release to the next are listed in the changelog.

Glossary

FieldTypeDescription
ACT gateautonomyWhether an action may run without review. It needs at least minimum_evaluated evaluated outcomes (default 8) and a 95% Wilson success lower bound of at least minimum_success_lower_bound (default 0.65), and it must also pass the recent-window, scope, risk and aggregate guards. Failing it never blocks recommending the action.
posterior samplingstrategyPicks each eligible action with the probability that it is the best one given the outcomes so far (Thompson-style), plus any minimum exploration share the policy sets.
minimum_explorationsettingThe share of decisions spread evenly across eligible low-risk actions so that none is starved of evidence (default 0 for a new outcome-policy-v3 policy, whether schema_version is named or omitted; 0.04 for outcome-policy-v2).
propensityreceiptThe probability with which the served action was chosen (action_probability), with the full distribution in behavior_probabilities. Offline evaluation needs it to correct for how actions were chosen.
change_responsev3Watches for a sustained drop in an action's success in the same context. When one is detected, selection uses only outcomes since the change and exploration is raised to 0.20 for 24 observations. History is kept.
epochv3The outcomes since the last detected change. Selection and the ACT gate count only the current epoch's outcomes for that context.
finite_horizon_v3 / legacy_challenger_v2policy_pathWhich selection path served a decision: the v3 path that plans exploration over a declared decision horizon, or the v2 challenger path. Reported in policy_path on decision cards.
policy_mixturev3 proposal_modeCombines the learner's distribution with your prior_action, weighted by prior_strength as initial odds. The proposal's weight shrinks as real outcomes accumulate, and it never counts as an outcome.
winner_establishedreportTrue when the leader has its minimum evaluated outcomes, its lower bound reaches the bar, and that lower bound is above every other action's upper bound. winner_evidence.missing lists exactly what is still missing.
policy_not_configured_for_scope409mode: "auto" was used in a collection or user scope with no configuration while the policy is configured for another scope (or the request set allow_unconfigured: false). Send the same scope as the setup, set the policy up for this scope, or pass allow_unconfigured: true to get the conservative recommendation without learning. A policy configured nowhere keeps the conservative recommendation.

The default learner

A new policy whose setup sends no learning mode and no learner component (and keeps the v3 defaults: posterior sampling, exact context, no value objective) gets the auto-mode learner, outcome-learner-v4. Setup reads each action's declarations and stores them unchanged:

  • Declared risk_tier: "low" and exploration_allowed: true: explored freely. No guarantee constrains it and no baseline pins it.
  • Risk and exploration left undeclared: listed in learner.guarded_actions and explored only within the conservative guarantee (below).
  • Declared medium or high risk, or not exploration-allowed: never explored.

How it serves

The learner keeps several models of your outcomes at once (does a context field matter, is the rate drifting, did it change suddenly, does it cycle by hour or weekday, do similar texts behave alike, can your elicited prior be trusted) and weighs them by how well each predicted the outcomes that followed. From 512 draws of that belief it serves information-directed sampling mixed with plain Thompson sampling (thompson_share 0.25), and logs the exact probability it served. Each action declared explorable keeps at least Thompson sampling's own add-one share, 0.25 / (512 + number of candidates), about 0.0005 for five, so no decision serves such an action with certainty; learner.minimum_probability (0 to 0.05) changes it and 0 turns it off. Receipts state serving_rule, reward_model (binary, continuous or value, chosen from your outcomes; value_components for a value objective), candidate_posteriors and, per action, pending and matured evidence.

An action with no outcomes starts at its configured prior_mean and prior_strength, otherwise uniform. Its belief never moves because another action succeeded or failed. Evidence is shared only across the contexts of the same action. For a declared context field, each cell borrows from its action's other cells only as far as their outcomes agree: when contexts disagree (one works for billing, another for delivery), each cell soon follows its own outcomes.

With no evidence, actions the learner cannot tell apart are served exactly alike, whatever their names. Each decision's random draws are seeded with its policy and decision id, logged in selection_contract.inputs.seed_identity beside the summaries, so the receipt still reproduces the distribution it served.

The conservative guarantee

It covers only guarded actions. A guarded action is served only while, with posterior probability at least 0.95, cumulative expected reward stays at or above (1 − safety.alpha) of what always serving the baseline would have earned on the same contexts. The safe setup writes alpha 0.1; 1 turns the guarantee off. The baseline is the decision's baseline_action_key, else the first candidate listed, and a decision has one only when it has guarded candidates. The receipt states the baseline and why. A policy whose actions are all declared explorable has no guarantee and no baseline, so nothing it serves depends on the order of its candidates.

Declared actions are explored like Thompson sampling, including while outcomes take long to arrive. To keep serving your current action while slow outcomes come in, leave the alternatives undeclared (guarded) and name the current action in baseline_action_key.

Change over time

Change-point and discounted models compete with the stable ones on predictive likelihood, so the learner shifts to recent evidence when the data says something changed, without a separate alarm. After a large change this typically takes tens of decisions, while staying accurate when nothing changes. If fast reaction to a sustained drop matters more than accuracy on stable outcomes, set up with learning: "adaptive" and change_response: true (v3 posterior sampling with its change detector, below): it adapts sooner after a drop and is less accurate while nothing changes. change_response: true sent at setup keeps this learner: it is stored as false and the setup receipt says the learner provides change response. The weekly report names each context's current_epoch_leader (since the learner's last detected change, else over the most recent 50 outcomes) beside the all-time observed_leader.

What a decision counts

Every outcome, correction and early proxy committed before a decision is counted, whichever API process serves it, and a later decision never counts fewer. The receipt's evidence_as_of states the learner state's revision, the outcomes it holds, the waiting outcomes applied on top, any corrections pending and the newest outcome time. A correction, a configuration change or a learner upgrade rebuilds the state from the policy's most recent 2,000 outcomes at the next decision, which waits up to 10 seconds for it.

Existing policies

Policies created before this release keep their configuration. Auto-learner policies change in these ways: declared explorable actions are no longer constrained by the guarantee, untried actions start at their own prior, the probability floor applies, and the learner's state is rebuilt from history at the policy's next decision. Policies on v1, v2 or v3 selection are unchanged.

Versioned change response and optional feature sharing

This section covers v3 posterior sampling, which a policy uses when it is not on the default learner: setup with learning: "adaptive" or "adaptive_evaluable", a setup that sends a v3-only option (for example selection_half_life_decisions, contextual_model: "adaptive_optional", proposal_mode or a value_objective with selection_model: "success_cost_v1"), or a policy created before the default learner. It samples each eligible action with its posterior probability of being best, with minimum_exploration: 0, selection_half_life_decisions: null and change_response: false unless the configuration sets them. Policies created earlier keep their stored settings, and a v2 policy keeps its 0.04 floor. An older v3 policy may still have a 64-decision selection half-life and a 0.04 exploration floor; to match the current v3 defaults, update it with selection_half_life_decisions: null and minimum_exploration: 0. outcome-policy-v1 and outcome-policy-v2 keep their historical defaults.

With change_response: true, a v3 policy runs a bounded change detector over current final, full-confidence outcomes in the same exact context, watching for a sustained drop in success. A detected drop limits serving selection to the reconstructed post-change epoch and temporarily raises low-risk exploration to 0.20 for 24 post-change observations. It does not delete history, rewrite rewards, certify a change or reset the full-trial ACT gate. The separate action-advice distinction is described below. Corrections can retract an unsupported alarm. Set change_response: false to disable this heuristic.

Opt into contextual_model: "linear_optional" only after declaring relevant categorical context. The bounded additive linear model shares declared optional features within the same required-context partition, owner, policy, action and metric contract. At most four optional fields and 32 categories are supported. This is an approximate utility model and can miss interactions; required context is never dropped and pooled evidence never earns ACT. Default "exact" retains exact buckets with bounded optional-field priors.

Explicit v3 contextual_model: "adaptive_optional" compares required-only, exact and optional predictions frozen before each selected action's actual final outcome. Optional fields must earn their predictive complexity; shared rows are not counted three times. Historical rows without prediction receipts are not reconstructed. This observed-action competition does not establish causal relevance, calibrated intervals or improved performance.

The advice card suggests a challenger, never the current empirical leader. Under-sampled alternatives receive wider optimism and a reason to explore; a single failed trial does not settle an action's value. Your application owns its exploration budget and risk decision. The card is not a receipt, authenticated randomization or execution permission.

Read the machine-readable recommended_action rather than taking the first maximum of rounded card values. For v3 /advice, declare remaining_decisions (1–10,000), optionally max_pilot_decisions (1–8, default four). Without a horizon, the suggested exploration budget is zero. Bounded pilot estimates include immediate expected utility forgone and remaining exploitation; equally valued positive pilots are sampled uniformly. Re-read after actual outcomes. These estimates rely on unverified stationarity and utility assumptions, and ignored suggestions never become trials.

Inspect policy_path to distinguish legacy_challenger_v2 from finite_horizon_v3. Supplying a horizon to a v2 policy does not upgrade it; the card explicitly reports that the legacy path ignored it. A new v3 policy has change_response: false unless the configuration sets it; change response, adaptive optional features and policy mixture are separate opt-ins.

Explicit v3 advice with a context-local remaining horizon
await client.proofloop.setup_policy(
    "support.pilot", collection_id=collection_id, user_id="alice",
    context_schema=owner_declared_schema, actions=owner_declared_actions,
    configuration={"schema_version":"outcome-policy-v3", "change_response":False})
# Your application tracks this horizon for the SAME context, not all users.
card = await client.proofloop.policy_advice(
    "support.pilot", collection_id=collection_id, user_id="alice",
    context={"issue":"late"}, remaining_decisions=remaining_in_this_context,
    max_pilot_decisions=4)
assert card["policy_path"]["horizon_applied"]
# Re-read after an actual outcome; decrement your declared horizon.
# An ignored suggestion is not a trial or a behavior probability.

Explicit v3 proposal_mode: "policy_mixture" combines the native distribution with prior_action using prior_strength as initial odds, not reward trials. Native receipts log the actual distribution and selected propensity. Complete same-context native outcomes can attenuate proposal weight through bounded relative policy losses; protected, provisional and caller-forged receipts do not qualify. Importance clipping can introduce bias. Default legacy_prior is unchanged; faster cold start and hybrid gains are unqualified.

Built-in success minus actual cost

Pass value_objective to atomic setup: success_value, max_cost and cost_unit. It creates separate required success and cost metrics. Within declared bounds, normalized utility preserves the ordering of success_value × success − cost. Record actual units, not a guessed provider charge. Cost normalization clips outside [0, max_cost]; choose a defensible bound and add a separate guardrail for unacceptable costs. Missing or provisional cost cannot complete the outcome.

On the default learner, a value objective's outcomes are learned as their parts: each action's success rate, and its own cost, not pooled across actions. It serves the value they produce, so an early failure of a cheaper action does not settle it while its success rate is still uncertain. Receipts state reward_model: "value_components", and each action's served mixture carries its cost posterior.

Stable SDK: explicit business value
await client.proofloop.setup_policy(
    "support.value", collection_id=collection_id, user_id="alice",
    context_schema={"version":"v1", "fields":{"issue":{"values":["late","damaged"]}}},
    actions=owner_declared_actions,
    configuration={"schema_version":"outcome-policy-v3"},
    value_objective={"success_value":10, "max_cost":20, "cost_unit":"USD"})
# After independently authorized action execution, report both actual metrics:
await client.proofloop.record_outcome(receipt["decision_id"], observations=[
    {"metric_key":"success", "value":1, "is_final":True},
    {"metric_key":"cost", "value":5, "is_final":True}])

For separately modeled value selection, explicitly set value_objective.selection_model: "success_cost_v1" and declare declared_action_costs for every configured action. This requires v3, exact context and posterior sampling. Those pre-action costs are caller assumptions, not recorded charges. After admitted complete final confidence-1 binary success and bounded actual cost, the selector samples the success posterior separately and subtracts the weighted mean actual cost. Missing, provisional, implicit, future, protected and unproven legacy components do not qualify. The actual-cost mean replaces the cold-start assumption; cost uncertainty is not modeled and utility intervals are conditional on that estimate. No optional pooling or optimistic proposal pseudo-success is applied. Use policy_mixture for a transient proposal rather than the legacy prior. The Python SDK accepts this objective dictionary as is; the TypeScript SDK's convenience type does not list the component fields yet, so send them over HTTP.

Opt-in component-value objective
{
  "success_value": 40, "max_cost": 20, "cost_unit": "USD",
  "selection_model": "success_cost_v1",
  "declared_action_costs": {"review": 2, "assist": 14}
}

Action keys and costs above are illustrative, not a recommended configuration. Log actual selected-action costs separately. Native selection_contract.inputs.summaries and advice component_value_estimate expose success evidence, expected cost, cost basis and expected value. Finite-horizon component pilots assume costs remain constant during the pilot. This opt-in has not established a performance gain, calibrated uncertainty or monetary return. Existing composite_utility behavior is unchanged.

Opt-in follow-up outcome capture

On POST /v1/chat/completions, use features.learning: true and outcome_followup: {"decision_id": "prior-receipt-UUID"} in the same owner, collection and end-user scope. API keys also need learning:write; chat permission alone is insufficient. Standalone signals such as “thanks, that fixed it” or “customer reopened the ticket” can be recorded as source: implicit, confidence 0.35, is_final: false. Inspect memory_context.outcome_capture in JSON or the final SSE chunk.

The decision may have been created directly through /v1/learning/decisions in observe or automatic mode. No chat-session, trace-ID or capture-specific time-window join is required. Match the exact end-user value: omission differs from supplying one. Only a canonical maximized binary success contract allowing implicit evidence is eligible; protected episodes and foreign scopes return 404, conflicting receipts return 409 and other contract errors return 400. Completed/censored decisions are preserved, and repeated text on different decisions has separate generated receipt keys.

Default semantic_fallback: true on the explicit binding adds at most one meaning extractor for unsupported natural language, capped at 400 output tokens and eight seconds within the request deadline. It requires a current direct report attributable to the bound action and a verbatim source witness; unknown, quoted, hypothetical, request-only, invalid or unavailable extraction abstains. The witness authenticates text, not inferred meaning. Set semantic_fallback: false for the finite-parser-only path. Broad language accuracy remains unqualified. Implicit capture does not confirm execution, complete an outcome, train serving selection or earn autonomy. Confirm actual outcomes explicitly. Learning disabled prevents capture.

Recorded captures now include outcome_capture.observation: persisted observation ID, metric, value, polarity, confidence, source and finality, plus stored source_sha256 and character-offset source_span. First capture and replay project the same committed interpretation even when retry casing or spacing differs. No message text is echoed; old receipts without a witness return null fields instead of fabricating provenance. A source witness authenticates text, not semantic truth or execution.

Smaller reads and explicit writes

Compact evidence and one machine-readable gate

POST /v1/search with view: "compact" keeps the top-level grounding, evidence IDs, proof token and row content while omitting optional diagnostics. GET /v1/learning/policies/{key}/advice?view=compact keeps brief lesson lines, scope, per-action direct completed counts and an exact native-decision request template. Missing binary counts remain null with binary_counts_available: false, not invented zero successes or failures. Full views and complete server-side receipts remain available; compact presentation does not promote evidence.

Policy insights and full/compact advice also expose outcome_evidence_counts: distinct stored observations in the exact owner, collection/user, policy and stored primary context. Final, provisional, implicit-provisional and correction counts describe retained history, including historical frozen action/metric versions. They are not completed trial counts, current-version selection eligibility or action permission. When observations are only provisional, provisional_evidence_guidance points to explicit checked caller confirmation or the bound registered-verifier path for protected episodes; it never automatically promotes evidence or certifies its meaning.

Configured advice uses canonical gate: ASK, REVIEW, ACT or BLOCK. BLOCK dominates weaker recommendations; inspect blocked_by and blocked_hint. ACT still requires your independent current permission. The confidence endpoint accepts canonical user_id, retaining end_user_id/enduser_id aliases; conflicting aliases are rejected, never substituted for the authenticated account identity.

Post-change and recent-outcome checks

The action-advice path shares the latest reconstructed change epoch across actions in the same exact context. Each action uses only its own matching post-change outcomes; other actions or contexts cannot restore ACT. The declared minimum and configured lower-bound thresholds remain unchanged, including a separate recent-window check. Recovery probation requires eight consecutive successes. A normal miss is treated differently from losing the recent gate: the latest failure still demotes immediately, but recovery probation begins only after a previously qualified recent gate fails or an epoch requires requalification. Eight successes alone never bypass the full-period, recent-window, scope, risk or aggregate guards. History is retained; the reconstructed epoch is descriptive, not a certified change event.

Wait for the original chat-learning job

Chat extraction is asynchronous. Read memory_context.memory_learning for its original job_id, poll_url, status and memory IDs. A non-streaming memory+learning request can set wait_for_learning_seconds from 0 to 20; timeout may still return a pending job. Resume observation of that original job rather than submitting the chat again. include_low_confidence: true is an explicit diagnostic opt-in, not a correctness certification.

Confirm one checked capture explicitly

A model interpretation or repeated phrase never finalizes a provisional capture. After an authorized person or application checks the actual result, POST /v1/learning/decisions/{id}/confirm-capture accepts the original observation, exact scope, explicit Boolean success, affirmative confirmed: true and an idempotency key.

Confirmation body — caller assertion, not a verifier
{
  "observation_id": "ORIGINAL_CAPTURE_OBSERVATION_ID",
  "collection_id": "ORIGINAL_COLLECTION_ID", "user_id": "ORIGINAL_USER_ID",
  "success": true, "confirmed": true,
  "idempotency_key": "checked-result-event-42"
}

The frozen metric/source contract must allow the explicit source; supply required source-system, event and digest fields when that contract demands them. Existing finals are not silently replaced, foreign scope is refused, and protected episodes remain on their separate verifier path. Caller confirmation does not authenticate semantic truth or execution.

Bounded batches with per-item results

POST /v1/learning/decisions/batch accepts 1–50 existing decision requests, each with a nonempty idempotency_key. POST /v1/learning/outcomes/batch accepts 1–50 objects containing decision_id, idempotency_key and outcome. The authenticated account needs Starter or above through its existing batch_operations capability; Free remains ineligible and a supplied tier field cannot grant access. Compact is the default batch view. The response says atomic: false: inspect every indexed accepted/rejected item because later failure does not undo earlier commits. Replay only an unchanged original item and key; do not repeat a partially accepted batch with replacement keys. Ownership, source/metric, protected-episode and per-item rate guards still apply. Batching is not a throughput or latency SLA.

Opt-in native trial and proposal controls

selection_controls requires an outcome-policy-v3 configuration, the default for a new policy. It can exclude approximately dominated actions using direct completed exact-context full-confidence utility evidence, explicitly cap proposal weight at 0–0.8, and reserve 0–20 assignments per action/context under one declared budget identity. These are owner choices and selection heuristics, not calibrated safe or performance-optimal settings.

Configuration fragment — separately approved finite trials
{
  "schema_version": "outcome-policy-v3",
  "strategy": "posterior_sampling", "proposal_mode": "policy_mixture",
  "selection_controls": {
    "exclude_dominated_actions": true, "minimum_completed_decisions": 8,
    "maximum_proposal_weight": 0.25,
    "reserved_trials_per_action": 4,
    "reservation_budget_key": "approved-initial-trials"
  }
}

Add the separately configured actions and immutable context to this fragment. An assignment consumes a reserved slot even if no outcome arrives. Reads and retries do not replenish it, and a disappointing result does not authorize a new budget. Reserved assignments and a policy-owned horizon cannot be enabled together. Read receipts and probation/change status before choosing further actions; no stronger-baseline, real-drift or learning superiority is established.

Selection, cold start and evaluation

V3 selection, transient advisor proposals and decision-count aging are experimental. Performance targets and reliable model compliance with feedback have not been established. Setup and report helpers expose configuration and evidence, not proof of improved decisions. ACT remains advice, never execution permission.

New policies default to an outcome-policy-v3 configuration with the default learner; outcome-policy-v2 and outcome-policy-v3 configurations without a learner default to finite posterior sampling, and every configuration to decision mode: "auto". Auto mode in a collection or user scope without a configuration returns 409 policy_not_configured_for_scope when the policy is configured for another scope, so a mis-scoped call cannot silently stop learning; allow_unconfigured: false makes any unconfigured scope an error and true always returns the conservative recommendation. Repeating a setup returns the existing policy with replayed: true when every field it sends matches the stored policy, including a policy set up under earlier defaults; anything else is a 409 that names the revision to update. Without a learner, exploration is restricted to actions explicitly declared low-risk and exploration-allowed, subject to existing aggregate guards; without that configuration, or when no such actions exist, auto remains conservative. The default learner also explores undeclared actions, within its conservative guarantee. A schema alone does not declare action risk or authorize exploration. Existing v1/v2 configurations retain their stored behavior; explicit recommend remains conservative.

The conservative selector starts with your baseline (otherwise the first candidate), requires at least 5 effective observations, and switches only when a challenger's lower bound exceeds the baseline mean by 0.02. Evidence decays with a default 90-day half-life. Inspect each receipt’s frozen selection_contract for its actual distribution, inputs and thresholds.

recommend never explores. Server-side explore accepts epsilon from 0 to 0.2: each of N candidates receives epsilon/N, and the conservative recommendation receives the remaining 1 − epsilon. Cold-start discovery can therefore be slow and is not guaranteed to outperform random choice. For an independently controlled experiment, use observe and record its true distribution; never invent propensities after seeing outcomes.

Five effective observations are a per-action conservative selection gate, not an all-candidates visibility gate. Insights show an action’s stored evidence before eligibility, with stored_but_not_selection_eligible. A tiny comparison tolerance prevents seconds-old rounding from requiring an extra observation. With epsilon 0.2 and four candidates, each challenger receives only 5% of traffic: collecting five observations averages about 100 decisions in that context, before the uncertainty/lift test. This is not a promise of switching at 100.

Risk-declared adaptive exploration

Configure actions before collecting decisions. Omit mode for auto, or use mode: "explore", omit chosen_action_key, and set exploration_rate: 0. The server computes a deterministic 512-draw posterior-win distribution with one residual vote per eligible action, mixes a default 0.04 uniform exploration fraction across eligible actions in v2, then samples that exact categorical distribution. Each eligible action therefore has probability at least 0.04/N, not a guarantee of being selected in any finite window. Receipts record the actual distribution—not estimated propensities for an ideal Thompson sampler. Aggregate guards still exclude ineligible actions.

PUT /v1/learning/policies/sandbox.restart/configuration
{
  "collection_id":"YOUR_COLLECTION_ID", "user_id":"alice",
  "expected_revision":0,
  "configuration":{
    "strategy":"posterior_sampling", "window_decisions":1000,
    "half_life_days":90, "partial_pool_strength":2,
    "actions":{
      "restart":{
        "description":"Restart sandbox-web pods", "target":"sandbox-web",
        "risk_tier":"low", "exploration_allowed":true,
        "autonomy_allowed":true, "minimum_evaluated":8,
        "minimum_success_lower_bound":0.65,
        "prior_mean":0.5, "prior_strength":0, "prior_source":"owner_assumption"
      },
      "review":{
        "description":"Review sandbox-web configuration", "target":"sandbox-web",
        "risk_tier":"low", "exploration_allowed":true
      }
    }
  }
}

GET the same configuration route to read its revision. Updates require the current expected_revision; 409 means read and reconsider, not blindly retry. An update keeps the policy's current value of every setting it leaves out, schema_version included, so changing actions never changes how the policy explores. actions and the optional components (value_objective, horizon, selection_controls) are replaced by what the update sends; leaving one out removes it. Sending a different schema_version is an explicit migration. Every write stores the complete configuration and GET returns it, so a stored policy never changes because a default changes. The request schema is PolicyConfigurationInput in the OpenAPI contract. A configuration that does not validate returns 422 naming the option, the policy's version and how to fix it, for example that change_response on an outcome-policy-v2 policy needs an update that sends schema_version: "outcome-policy-v3". Risk defaults to high; only low risk may opt into exploration or ACT advice. These are explicit caller assumptions, not independent risk certification. A production refund or deployment must not be relabeled low risk merely to pass a gate.

Prior strength is bounded to 0–10 per action and never counts as observed trials or earns autonomy. A changed action description or target cannot reuse old bound-action evidence. Configured policies require a declared schema for nonempty context. Optional-field partial pooling contributes a bounded prior, not duplicated trials; required fields and tenant boundaries are never dropped. V2 adaptive pooling multiplies the available prior strength by 5/(5 + local effective evidence), reducing its influence as local observations accumulate. pooling_mode: "fixed" preserves fixed behavior, and strength 0 disables borrowing. No algorithm can guarantee identifying the true winner from finite noisy outcomes.

Windows and change diagnostics

Configured policies read the latest 20–2,000 comparable decisions (default 1,000) with a configurable half-life of one minute to 3,650 days. A one-minute fresh plateau avoids immediate numerical decay. Required-context, action and metric admission precedes the bounded window; unrelated required contexts do not evict comparable evidence. Insights report truncation. Two adjacent windows of 20 full-confidence outcomes can produce observed_performance_drop when the normalized mean falls by at least 0.30. local_prior_divergence reports a local/pooled posterior-mean gap of at least 0.30 with at least five effective observations in each. Both are descriptive diagnostics, not statistical or causal change-point proof.

The experimental selector also supports selection_half_life_decisions from 20 to 2,000, or null to disable it. A new outcome-policy-v3 policy defaults to null (disabled), whether or not it names the version; a stored policy keeps its value until an update sends a new one. The latest 20 completed, positive-confidence exact-context observations have no decision-age discount; older observations decay by this half-life across candidate actions. This discount combines with wall-clock decay for selection only. It never rewrites stored outcomes or supplies the full trials required for ACT advice. Faster adaptation and higher quality are not established.

Migration and one-call setup

Create a new policy with POST /v1/learning/policies/{key}/setup, sending context_schema, configuration.actions, collection_id and user_id. Schema and configuration commit atomically; an existing configuration conflicts rather than being reset. Python setup_policy and TypeScript setupPolicy wrap this one request. Declare risk honestly; leave high-risk actions conservative.

Python: recommended setup
await client.proofloop.setup_policy(
    policy_key="sandbox.inspect", collection_id=collection_id, user_id="alice",
    context_schema={"version":"v1", "fields":{"issue":{"values":["slow","error"]}}},
    actions={
        "logs":{"description":"Read sandbox-web logs", "target":"sandbox-web",
                "risk_tier":"low", "exploration_allowed":True},
        "metrics":{"description":"Read sandbox-web metrics", "target":"sandbox-web",
                   "risk_tier":"low", "exploration_allowed":True}
    })
# Next decide() calls use auto; record real outcomes after authorized execution.

For an existing policy, GET its configuration, retain the exact scope/action identities, and PUT the current expected_revision with schema_version: "outcome-policy-v3", its actions, and every setting you want the v3 default for: strategy: "posterior_sampling", pooling_mode: "adaptive", minimum_exploration: 0, selection_half_life_decisions: null and a deliberate change_response choice. The update keeps every setting it leaves out, so a v2 policy migrated without minimum_exploration keeps its 0.04 floor. Send any value_objective, horizon or selection_controls again; each write replaces them. Review risk and exploration opt-ins before this change. Pin mode: "recommend" for no exploration, or retain the old version. No historical outcomes are relabeled by migration.

Default integration: native selection; advisor logging is optional

For reliable ownership of exploration, let the server select with decide(mode="auto"). An LLM reading a card can ignore an under-tested action, so advisor logging is not the recommended learning selector. Native selection does not guarantee beating a fixed strategy or Thompson sampling, and never grants execution permission.

When Hebbrix should select among actions, use the setup → native decide → actual outcome path above. Explicitly configure v3, low-risk exploration and a decision budget where appropriate. Inspect the receipt's actual distribution: an alternative with zero probability cannot be learned from selected-action feedback. Neither exploration nor v3 guarantees discovering a better action within a finite budget.

Use Python decide_with_advice / TypeScript decideWithAdvice only when your advisor deliberately owns the choice: fetch /advice, let it choose once, then log in observe mode. Observe does not make the native selector explore or compel the advisor to follow the card. The SDK helpers snapshot scope, candidates and context before the callback and reject malformed logging distributions without normalization or retries. Caller probabilities are not authenticated randomization. This is an optional integration pattern, not evidence of improved performance.

The callback must return chosen_action_key, its actual action_probability and complete behavior_probabilities. Do not pass an LLM's verbal confidence as a selection probability. A deterministic advisor logs probability 1 for its choice and 0 elsewhere, with limited retrospective support. The helper never executes an action or reports an outcome. Independently authorize execution and report the actual outcome afterward.

Python: evidence-guided selection with honest logging
async def advisor(card):
    # Implement one application-owned model call using this evidence card.
    # Return its validated action key; this is deterministic routing, not
    # a calibrated randomization probability or an execution permit.
    chosen = await choose_allowed_action(card, allowed=["logs", "metrics"])
    probabilities = {key: float(key == chosen) for key in ["logs", "metrics"]}
    return {"chosen_action_key": chosen, "action_probability": 1.0,
            "behavior_probabilities": probabilities}

receipt = await client.proofloop.decide_with_advice(
    policy_key="sandbox.inspect", collection_id=collection_id, user_id="alice",
    context={"issue": "slow"},
    candidates=[{"action_key": "logs"}, {"action_key": "metrics"}],
    advisor=advisor, idempotency_key="before-action-001")
# No external action was executed. Separately authorize, execute, then report.

Experimental transient advisor prior

Server-chosen posterior exploration accepts prior_action and prior_strength in (0, 5]. This caller proposal adds optimistic pseudo-evidence only to that decision, attenuated by 5/(5 + the proposed action’s exact-context effective evidence). Other actions retain their own outcome evidence. It is not a calibrated model-confidence score, persisted observation or autonomy evidence. The receipt records the actual mixed distribution; outcomes can overturn the proposal. It does not guarantee better early or overall performance.

V3 also attenuates proposal strength using completed outcomes where that same proposed action was actually selected, in the same context and contract. Untested proposals retain the caller's bounded strength; observed underperformance reduces it. Outcomes for actions not executed are never invented. This is selection-biased descriptive reliability, not calibrated proposer accuracy or a causal comparison. Transient priors have not met the existing early/overall performance qualification; evaluate them independently on your workload.

Weekly learning report and webhooks

GET /v1/learning/policies/{key}/report?days=7 and the authenticated Learning report dashboard show exact-scope observed leaders, successes, failures, unevaluated decisions and recorded readiness transitions. Supply the same collection/user scope as writes; blank scope is unscoped, not an all-user aggregate. History is bounded to 2,000 rows and 50 contexts; truncation and the UTC window are explicit.

Uplift is shown only when the separate evaluator identifies its supported retrospective conservative-policy diagnostic. New adaptive-policy uplift remains not_identified_for_current_policy; raw action averages are not a causal comparison, and normalized reward differences are not automatically percentages of tickets resolved. Missing outcomes remain missing.

Subscribe to learning.autonomy_promoted, learning.autonomy_demoted and learning.change_alert. V2/v3 outcome writes transactionally record new readiness/alert transitions and stage delivery through the existing durable webhook system. Event IDs support deduplication; delivery can be retried. These events describe outcome readiness only, not current rule clearance or execution authority. No past transitions are fabricated, and configuration/time changes without a new outcome do not emit events.

Advisor evidence card

GET /v1/learning/policies/{key}/advice accepts URL-encoded JSON context, collection_id and user_id. It returns ranked actions, approximate 90% intervals, observed counts, configured priors, change diagnostics and an exploration candidate among eligible low-risk opt-ins. An LLM can read evidence_card; the suggestion is neither a new decision receipt nor permission. Obtain a fresh decision and independently authorize execution.

Caller-controlled logging
{
  "policy_key": "support.reply", "user_id": "alice",
  "candidates": [{"action_key":"concise"},{"action_key":"detailed"}],
  "mode": "observe", "chosen_action_key": "detailed",
  "action_probability": 0.5,
  "behavior_probabilities": {"concise":0.5,"detailed":0.5},
  "context": {"segment":"premium"},
  "idempotency_key": "decision-before-action-001"
}

behavior_probabilities must cover exactly all candidates, sum to 1, and match the chosen probability. A chosen probability alone cannot establish support for unchosen actions. Caller-reported randomization is not independently verified. Evaluation uses a chronological 70/30 split with point-in-time training, support, missing-outcome, effective-sample and metric-contract checks. ready and evaluation_ready concern evaluability; recommendation_ready is separate. Inspect exclusion_counts when estimates are null. Retrospective estimates never automatically permit promotion.

Declare relevant context explicitly

Without a schema, the full context hash can fragment on unique ticket IDs and fall back to globally pooled action history within the same owner/user scope. Receipts warn about this. Hebbrix does not automatically discover which fields matter.

PUT /v1/learning/policies/support.reply/context-schema
{
  "user_id":"alice",
  "context_schema":{
    "schema_version":"outcome-context-v1", "version":"segments-v1",
    "fields":{
      "segment":{"values":["premium","standard"],"required":true},
      "channel":{"values":["chat","email"],"required":false}
    },
    "backoff":[["segment"]], "unknown_fields":"ignore"
  }
}

Use 1–12 categorical fields, each with 1–32 distinct string, boolean or integer values. There is no type field. required defaults to true and at least one field must be required. Backoff is a maximum of three strictly narrowing lists of field names; every level retains all required fields and the final level is exactly the required set. unknown_fields controls undeclared keys, not unseen category values.

Unknown categorical values remain a validation error: silently pooling an unseen required segment would break the safety boundary. Schema contracts are immutable; plan a separately qualified policy/version for new categories. There is no automatic schema extension or default cross-segment fallback. Per-user isolation also means no implicit population prior; deliberate shared policies require a separate data/consent design.

Metrics and two distinct guardrail contracts

Maximize metrics map the configured range linearly to −1…1; for a 0…100 metric, 50 is neutral and 90 becomes 0.8. Minimize reverses the scale. These are reward utilities, not probabilities. Definitions are frozen into each decision, so later edits do not regrade old receipts.

is_guardrail, guardrail_operator and guardrail_threshold alone define a raw-unit, per-decision penalty. A violation forces that decision’s composite reward to −1; it does not promise a maximum population complaint rate.

For an explicit action-rate constraint also configure max_violation_rate. Example: a binary complaint metric with lte threshold 0.1 and maximum violation rate 0.1 treats complaint=1 as a violation, then requires the action’s conservative violation-rate upper bound to be at most 10%. This is separate from the revenue reward.

The aggregate gate uses at least 20 same-context, same-metric-contract decisions from the most recent 2,000, a conservative simultaneous bound (one-sided Hoeffding) across candidates and guardrails, and conservative treatment of missing, immature and low-confidence feedback. Twenty observations will often be insufficient for a strict cap. Unknown evidence fails closed with 409 rather than falling back to an unsafe baseline. Exploration is restricted to eligible actions. observe can record independently collected outcomes but does not authorize data collection. Bounds assume independent stationary outcomes; those assumptions and caller reports are not independently certified. Protected episodes and retrospective constrained-policy evaluation are not supported by this new opt-in gate.

Finals, procedure feedback and confidence

A conflicting final for the same decision metric returns 409. Revise it explicitly with an observation using source: "correction"; prior evidence remains auditable. Use the Idempotency-Key header for atomic request replay and per-observation keys where needed. Missing outcomes remain unknown.

Procedure execution completion now leaves the outcome pending until feedback. Success rate counts explicit feedback only, and confidence is the Beta(1,1) smoothed success estimate, not a guarantee. Exact structured-condition matches rank outcome reliability before wording. Legacy execution-only records are not relabeled as successful feedback.

/confidence semantically ranks bounded decision history and preserves distinguishing action identifiers and time qualifiers. It exposes matched decision IDs and separate no_evidence, mixed, success and failure evidence states. Retrieval remains fallible and does not prove causal transfer; sparse histories cannot bypass the conservative action gate. Its advisory result never grants execution permission.

ASK → REVIEW → ACT is advisory

Memories alone cannot earn ACT. memory_support describes memory evidence; action_confidence is the eligible action’s outcome lower bound (or zero when blocked), not the old text score. The legacy confidence/answer_confidence fields remain groundedness signals and must not be thresholded into permission.

For configured action advice, send policy_key, action_key, JSON context and query to GET /v1/confidence. These structured fields bind the configured action and target; query text is checked for conflicts, including different targets, operations and parameters. matched_action explains the binding and conflicts; its match score is not a calibrated semantic probability. The endpoint accepts canonical user_id and the older aliases end_user_id/enduser_id; do not send conflicting values. The default low-risk gate requires at least eight final full-confidence binary outcomes and a 95% Wilson lower bound of at least 0.65. Eight successes give about 0.676. Only matching frozen action/target, exact context and current metric contract qualify; priors, unbound legacy history and protected episodes do not. A latest failure immediately demotes; independent rules, incomplete scans and failed aggregate guards prevent ACT. Query-conflict detection is bounded, not universal language understanding. ACT never inherits or grants execution permission.

An unspecified environment remains ASK with needs_scope: ["environment"]. Ask the caller to supply that scope, then request fresh advice; do not silently choose a default or treat the hint as permission. Explicit incident clauses such as ; error rate is 37% are descriptive measurements, not action parameters. This finite syntax does not interpret every natural-language observation; operational amounts, limits and quantities remain constrained.

Tool proposals never imply execution

With tool_advice, the non-streaming proxy returns deterministic proposal-status text for each choice. No-call replies say that no external action was executed; annotated calls are proposals only; hold mode withholds every call, even ACT advice. Read memory_context.tool_advice.response_status and per-call verdicts. The same status text is stored in history, preventing unchecked completion prose from becoming a later execution claim. This opt-in mode deliberately replaces free-form generated text; it does not certify execution results supplied by callers.

The model is instructed to propose a supplied tool when explicitly requested and its required arguments are known, while still respecting tool_choice. Automatic tool selection remains model-dependent. For an application that requires a proposal, use OpenAI-compatible tool_choice: {"type":"function","function":{"name":"your_tool"}} or "required"; this requests a proposal, never authorizes execution or bypasses advice.

Inspect each choice's selection and completion contracts rather than inferring success from prose. Auto permits no call; required asks the model to choose among the supplied tools. None/named selection violations and explicit length/filter termination withhold calls even in annotate mode. Unknown termination remains unverified. These engineering guards preserve contracts; they do not qualify automatic-proposal reliability or hybrid performance.

Complete named-tool request — proposals remain held
{
  "model": "gpt-5-nano",
  "messages": [{"role":"user", "content":"Use flush_cache for the sandbox Redis cache."}],
  "features": {"memory":false, "user_profile":false, "personalization":false, "learning":false},
  "tools": [{"type":"function", "function":{
    "name":"flush_cache", "description":"Propose a separately authorized sandbox cache flush.",
    "parameters":{"type":"object", "properties":{"cache":{"type":"string"}},
                  "required":["cache"], "additionalProperties":false}
  }}],
  "tool_choice": {"type":"function", "function":{"name":"flush_cache"}},
  "tool_advice": {
    "mode":"hold",
    "bindings":{"flush_cache":{
      "policy_key":"sandbox.cache.v1", "action_key":"flush",
      "context":{"alert":"error_spike"},
      "target_argument":"cache", "fixed_arguments":{}
    }}
  }
}

Set up the referenced policy, action, target and context first. The required target_argument names the tool parameter bound to that target; any other parameters must match exact fixed_arguments. This selection contract asks for a proposal only: held calls are not executed, and ACT advice is not permission. Model-dependent automatic no-calls are not fixed by forcing calls from ambiguous wording.

Procedure creation uses objects, not strings

POST /v1/procedures — complete structured review example
{
  "name": "Review a sandbox cache incident",
  "description": "Store a review procedure, not permission for a production action.",
  "condition": {"expression": "sandbox cache error spike"},
  "action": {"steps": ["Inspect current cache metrics", "Request approval before a cache flush"]},
  "category": "sandbox-review", "parameters": {}
}

condition and action are object-valued HTTP fields. SDK convenience fields such as trigger_condition and action_sequence map to those objects. Creating or completing a procedure does not fabricate successful feedback or authorize its external steps.

Legacy decision outcomes and ordinary learning receipts both inform scoped recall and failure warnings. A learning correction replaces the current signal rather than adding a second trial. Arbitrary composite rewards, pending/provisional records and partial-confidence signals are not binary success trials. Evidence remains caller-reported; independence, stationarity and transfer are not verified.

Failure-aware recall

Link supporting memories using evidence_manifest.references with kind: "memory", reference_id and role: "supporting". Search uses outcomes as a final ordering input without rewriting relevance scores. Read rank, outcome_boost and metadata.outcome_evidence, including attempt IDs and coverage. Relevance votes are a separate signal, not successful executions. Cached results re-read current outcome evidence.

The chat proxy includes linked outcome counts and attempts by default in memory_context.outcome_evidence and its model context. It asks the model to warn about failures and consider supported alternatives. This cannot guarantee that a model will never repeat a mistake. Unavailable outcome scans are disclosed, not treated as evidence that an approach has never failed.

Write completion and honest search scores

For extraction, wait_for_index: true with omitted async_dispatch waits through the synchronous path and bounded indexing check. Explicit async_dispatch: true conflicts with that flag and returns 422 before writing. Background callers should poll the returned canonical job URL; a 202 receipt is acceptance, not searchable completion. Indexing timeouts remain explicit rather than claiming success.

Search scores are ranking signals, not calibrated correctness probabilities. Prefer top-k with min_score: 0, then inspect grounding and evidence. A useful first-ranked paraphrase can have a low numeric score; no universal 0.3 or 0.5 cutoff is promised. Explicit “summarize this user” Reason queries return bounded source quotations across the exact user/agent/run scope; memory_limit is 1–50 (default 20), with truncation disclosed and quotations marked not independently verified.

Decision creation follows the configured plan request limit: defaults are free 60, starter 300, pro 1,200, scale 2,000 and enterprise 3,000 per minute. Other expensive endpoints retain separate limits. Use bounded concurrency, backoff and idempotency. Batch routes retain per-item guards and tier admission; batching is not an unlimited bypass. If your installed SDK has no helper for a new field yet, send it over HTTP.

The raw_rerank_score, when available, is an unrounded provider signal or local logit, not a probability or a universal threshold. Unsupported providers may return null. Compact search never drops the grounding/safety envelope merely to reduce optional diagnostics.

Edge limits per IP address are separate, as listed in Errors and rate limits: 20,000 requests per minute for requests carrying a Hebbrix API key and 400 per minute without one, with a separate signup-path limit. A rate rejection uses JSON 429 with X-RateLimit-Scope (ip_api_key or ip) and Retry-After; eligible GET health paths are excluded from that general rate rule, not from managed security checks. Account limits still apply, and a security-rule 403 is not a rate-limit response. Back off with jitter; do not probe limits with a production burst.

Read the latency guide for end-to-end measurements versus objectives. No sub-50ms end-to-end search guarantee is made. See experiences, reviewed lessons and constrained permits for the separate beta execution workflow.

Explicit causal loop. Outcome Memory does not claim to infer success from ordinary traffic. Your agent records the candidate set and selected action, then reports a delayed result. Hebbrix keeps propensity, uncertainty, correction, and idempotency evidence tenant-scoped.

How Outcome Memory Learns

A reliable learning loop separates the decision-time record from the later observation. Missing outcomes remain censored; they are not silently converted into failures or synthetic rewards.

  1. Decision Receipt. Before acting, record the policy key, authorized candidates, context, collection, and idempotency key.
  2. Propensity Evidence. Store the selected action and its probability so later evaluation can distinguish policy evidence from cherry-picked successful examples.
  3. Delayed Outcome. Report success, reward, or typed business metrics after the real-world result is known.
  4. Correction Semantics. A corrected outcome revises the evidence for the original decision instead of creating another decision.
  5. Posterior Uncertainty. Policy insights expose sample counts, posterior probability, and uncertainty rather than one opaque score.
  6. Conservative Evaluation. Promotion evaluation can refuse weak or non-randomized evidence instead of declaring a winner.

Agent Autonomy Features

Confidence, corrections, and Outcome Memory help agents decide when to act, when to abstain, and how to learn from results:

  • Confidence Scoring. Agents fetch confidence scores from GET /v1/confidence before acting to check "do I know enough to act without asking the user?" Returns a score and recommendation, including a hard do_not_act result when operational constraints conflict with the proposed action.
  • Correction Memory. When a user corrects an agent, it calls POST /v1/corrections. The correction is stored as versioned evidence. Agents still need to retrieve and apply relevant corrections; no system can guarantee that a mistake never repeats. You can also submit explicit user feedback via POST /v1/feedback/relevance (see the API Reference below for the full feedback, decisions, and confidence schemas).
  • Decision Receipts & Delayed Outcomes. Use POST /v1/learning/decisions before acting, then report the observed result to /v1/learning/decisions/{id}/outcomes. The older /v1/decisions route remains a decision log, not an automatic policy-training guarantee.

What Happens Behind the Scenes

  1. Your application supplies the actions it is actually allowed to take
  2. Hebbrix records the candidates, mode, choice, and action probability
  3. The agent performs the external action under your authorization rules
  4. Your application reports the delayed outcome or business metric
  5. Hebbrix updates policy evidence idempotently, including corrections
  6. You inspect insights and evaluate evidence before changing behavior

Safety & Quality Controls

  • Caller Authorization. Outcome Memory ranks only the candidate actions your application supplies. It does not grant tool, data, or side-effect permissions.
  • Bounded Exploration. Default epsilon exploration is capped at 0.2. Explicit low-risk posterior sampling uses its separately recorded finite distribution. Neither grants action authority.
  • Censored Missing Feedback. A missing or late outcome is not interpreted as failure. Final observations and corrections remain attached to the original decision.
  • Isolation & Idempotency. Collection and user scope prevent cross-tenant evidence leakage, while idempotency keys make decision and outcome retries safe.

Outcome Memory API

The causal learning surface is explicit and inspectable:

  • POST /v1/learning/decisions: choose or record an action receipt
  • GET /v1/learning/decisions/{id}: inspect the immutable decision context
  • POST /v1/learning/decisions/{id}/outcomes: report delayed or corrected outcomes
  • GET/POST /v1/learning/metrics: define and inspect typed business metrics
  • GET /v1/learning/policies/{key}/insights: inspect posterior evidence
  • POST /v1/learning/policies/{key}/evaluate: evaluate whether evidence is sufficient
The Bottom Line. Outcome learning is powerful only when your integration closes the loop. Record the decision before acting, report the real result afterward, and use the returned uncertainty when deciding whether evidence is strong enough to change policy.

API Reference

These established confidence, correction, decision-log, and relevance endpoints complement the Outcome Memory API above. They do not by themselves train or promote a policy. All require authentication (Authorization: Bearer <api_key>).

Schemas & Scoping

Two rules trip agents up most often: the strict enums on the create schemas, and the difference between the create body and the read endpoint's query parameter.

  • decisions.outcome normalizes to an enum. POST /v1/decisions stores one of success, failure, partial, or unknown (default unknown), but accepts common synonyms and maps them, e.g. positive/good/ok/pass → success, negative/bad/fail/error → failure, mixed → partial, neutral/na → unknown. Only a genuinely-unrecognized value, for example safe_block, returns HTTP 422. decision_type is a free string up to 50 chars; description is required.
  • corrections.correction_type is an optional enum. POST /v1/corrections requires only corrected_content; correction_type is optional and defaults to preference. When supplied it must be one of preference, factual, or procedural — any other value returns HTTP 422.
query is a read parameter, not a create field. query belongs to the GET read endpoints, /v1/corrections/relevant and /v1/decisions/similar, where it describes the agent's current task. The create schemas reject unknown fields, so sending query in a POST body to /v1/corrections or /v1/decisions returns HTTP 422.

Tenant isolation via collection_id. Both corrections and decisions are tenant-isolatable. Pass collection_id when creating to scope a record to one collection. On the read endpoints, collection_id enforces strict isolation (only that collection's records), and include_global additionally folds in account-wide records. Omitting collection_id keeps everything account-wide, fully backward compatible.

Compatibility and deprecation

Pin the installed SDK version in production and read its changelog before upgrading. Stable SDK packages use semantic versioning; additive optional fields/methods are distinct from incompatible contract changes. Versioned policy contracts preserve their stored context/action/outcome meanings and do not regrade old receipts. Experimental features are labeled separately; their presence in local source is not a published support commitment.

Security and correctness guards may tighten immediately. Incompatible changes require a documented replacement and migration guidance, but no fixed 90-day support or deprecation window is promised here. Check GET /v1/release, canonical OpenAPI, and GET /v1/users/me/capabilities for the actual deployed artifact and account matrix. Release cadence, private fixtures and source changes do not establish adoption, compliance, calibrated safety, real-world reliability or learning superiority.

curl
# Create a correction scoped to one tenant/collection
curl -X POST https://api.hebbrix.com/v1/corrections \
  -H "Authorization: Bearer $HEBBRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "corrected_content": "Refund approvals above $500 require human review",
    "correction_type": "procedural",
    "original_content": "above $250 require human review",
    "collection_id": "YOUR_TENANT_COLLECTION_ID"
  }'

# Read corrections for that tenant only (strict isolation)
curl "https://api.hebbrix.com/v1/corrections/relevant?query=approve+a+refund&collection_id=YOUR_TENANT_COLLECTION_ID" \
  -H "Authorization: Bearer $HEBBRIX_API_KEY"

# ...or include account-wide corrections alongside the tenant's
curl "https://api.hebbrix.com/v1/corrections/relevant?query=approve+a+refund&collection_id=YOUR_TENANT_COLLECTION_ID&include_global=true" \
  -H "Authorization: Bearer $HEBBRIX_API_KEY"

# Log a decision (outcome normalizes to success|failure|partial|unknown, synonyms accepted; query is NOT a body field)
curl -X POST https://api.hebbrix.com/v1/decisions \
  -H "Authorization: Bearer $HEBBRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "decision_type": "refund_approval",
    "description": "Auto-approved a $120 refund",
    "outcome": "success",
    "agent_confidence": 0.82,
    "collection_id": "YOUR_TENANT_COLLECTION_ID"
  }'
Ask the docs
reading · this page

Hi! I'm the Hebbrix docs assistant. Ask me anything about this page: setup, code examples, endpoints, pricing, or integrations.