> ## 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.

# Select a useful memory

> Choose which retrieved memory, if any, belongs in the next prompt.

Use this after your own memory search returns candidates. Supply the current request and candidate memories with stable IDs.

[Open this recipe in the playground](https://console.sqwish.ai/#playground?recipe=memory-recall), or set `D1_API_KEY` as in the [quickstart](/quickstart) and run the same request:

```bash theme={null}
curl --fail-with-body --silent --show-error https://console.sqwish.ai/v1/decide \
  -H "Authorization: Bearer $D1_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "sqwish-d1-core",
  "context": {
    "message": "What kind of films might I enjoy this weekend?",
    "memories": {
      "m1": "01 October 2026. User: I really love The Godfather; the storytelling is incredible.",
      "m2": "03 October 2026. User: Can you give me a quick pasta recipe for tonight?",
      "m3": "05 October 2026. User: Horror films give me nightmares, so I avoid them.",
      "m4": "08 October 2026. User: My brother Ethan turns 28 next week.",
      "m5": "10 October 2026. User: I watched Casablanca again and cried at the ending.",
      "m6": "12 October 2026. User: My flight to Lisbon leaves at 7am on Saturday."
    }
  },
  "decisions": [
    {
      "id": "recall",
      "kind": "single",
      "question": "Which memory would most help answer this message?",
      "outcomes": {
        "m1": null,
        "m2": null,
        "m3": null,
        "m4": null,
        "m5": null,
        "m6": null,
        "none": "No memory helps; answer from the message alone."
      }
    }
  ]
}
JSON
```

## Use the result

Read `decisions.recall.action` and map it back to the selected memory. If it is `none`, omit the candidates. This is a single-choice recipe; if the turn needs multiple memories, design and evaluate a separate selection procedure.

The model selects only among the memories you provide. It cannot retrieve a missing memory, establish that a memory is current, or decide who is authorized to see it. Filter access and expiry before scoring and keep the source IDs for inspection.

Test both useful memories left out and stale or irrelevant memories included. Those errors affect the eventual reply differently. Evaluate the reply with and without selection, including requests where no memory is helpful.

## What was evaluated

The historical benchmark uses its own candidate construction and labels. Its accuracy does not transfer automatically to your search index, candidate count or memory format.

<Note>
  Historical evaluation on **2026-09-28**, using **sqwish-d1-core**. These measurements describe that checkpoint and dataset, not current production performance or an accuracy guarantee.
</Note>

* Dataset: [MemBench (single-hop, multi-hop and preference questions)](https://huggingface.co/datasets/mteb/MemBench) (MIT).
* Split: test (the only split), users whose hash falls below 0.5.
* Sample: 600 rows, 600 measured decisions.
* Measured decision IDs: `recall`.
* Wording: hand-written.
* Checkpoint SHA-256: `dd420ca652cfaa10279eabb54d15afd50fe9d24d357498c4dbc512b1c3d73bb2`.

| Metric | Value | Recorded interval |
| - | -: | - |
| accuracy | 0.8633 | 0.835 to 0.89 |
| log loss | 1.1844 | 1.1163 to 1.251 |
| brier | 0.2384 | 0.2118 to 0.2666 |
| ece | 0.2372 | 0.2086 to 0.2678 |

The majority-class baseline has accuracy **0.3333**; the class-prior baseline has log loss **1.9279**.

Only the decision IDs listed above were measured. Dataset labels, class balance and wording affect these results. The intervals do not measure distribution shift. Re-evaluate with your own cases, including ambiguous and out-of-scope inputs.

## Improve it for your application

Keep the decision IDs and outcome order stable while evaluating changes. [Review a dataset](/guides/datasets), [tune the wording](/guides/prompt-tuning), and compare the result against your current policy before changing production. Check [fallback](/guides/models-and-fallback) so you know which model actually answered.
