> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqwish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Feedback and continual learning

> Record reviewed outcomes and turn them into the next model version.

Ask a deployed named model to store a decision for later feedback:

```bash theme={null}
curl --fail-with-body https://console.sqwish.ai/v1/decide \
  -H "Authorization: Bearer $D1_API_KEY" -H 'Content-Type: application/json' \
  -d '{"model":"support-router","store":true,"metadata":{"workflow":"refunds"},
    "context":"Please refund the duplicate charge.","decisions":[{
      "id":"refund","kind":"binary","question":"Is a refund requested?"}]}'
```

Keep the returned decision `id`. After a reviewer establishes the correct outcome, set `D1_DECISION_ID` to that ID:

```bash theme={null}
curl --fail-with-body https://console.sqwish.ai/v1/feedback \
  -H "Authorization: Bearer $D1_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"decision_id\":\"$D1_DECISION_ID\",\"outcomes\":{\"refund\":\"yes\"}}"
```

The receipt lists the decision IDs recorded. Resubmitting an outcome corrects the feedback for that decision. It does not rewrite an already created immutable dataset; the corrected feedback can be used in later data.

## Store intentionally

`store` defaults to false. When enabled, the service retains the request context, decision wording and probabilities for the feedback workflow. The current configured default retention is 90 days for stored decisions and feedback; datasets already built from feedback are retained separately. Storage is not an idempotency receipt or a way to retrieve a lost inference response.

Supply only data appropriate to retain. Optional string metadata can identify an application workflow for later selection. Account usage history is separate and does not expose contexts or answers.

Feedback on a named request is associated with the requested model even if a fallback answered. Check fallback in your evaluation and label the true outcome rather than simply copying the prediction. Feedback supplies supervised targets, not rewards for unchosen alternatives.

## Make a feedback dataset

Once you have enough new labelled decisions from distinct contexts:

```bash theme={null}
curl --fail-with-body https://console.sqwish.ai/v1/models/support-router/feedback-dataset \
  -H "Authorization: Bearer $D1_API_KEY" -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: refund-feedback-batch-1' \
  -d '{"metadata":{"workflow":"refunds"}}'
```

This consumes eligible new feedback into a dataset. Use the same key to recover that dataset after a lost response. Review its rows and start a continuation fine-tune with the named model as `parent`.

## Enable continual learning

After the manual loop works, enable automatic rounds explicitly:

```bash theme={null}
curl --fail-with-body https://console.sqwish.ai/v1/models/support-router/learning \
  -H "Authorization: Bearer $D1_API_KEY" -H 'Content-Type: application/json' \
  -d '{"enabled":true,"after":200,"auto_promote":false}'
```

New labelled decisions trigger a round when the threshold and other conditions are met. `after` is at least 150; the default is 200. Inspect the model's `learning` state for progress, waiting reasons and the next eligible round time. Credit and training availability still apply.

With `auto_promote: false`, the resulting version waits for review. Enabling auto-promotion lets a passing candidate become production if production is still the version the round started from. Each round uses the ordinary dataset, training and promotion flow.

Send `{"enabled":false}` to stop future rounds. A running round can finish, but disabling learning prevents its automatic promotion. If you also need to stop training already in progress, cancel that job explicitly. See [versions and rollback](/guides/model-versions) when recovering from an unwanted production change.
