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

# A briefing that keeps itself current

> Ask a standing question once. It rewrites its own answer as new memories arrive, and tells you when it is stale.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py">memory\_basics.py</a></div>

## The scenario

There is a question you ask every week. What is this customer's situation. Where
is the migration up to. What do we know about this account.

Asking it every week costs a call every week and gives you a slightly different
answer each time. Writing the answer down costs nothing and is wrong within
days.

## Step 1 — Define the standing question

```python theme={null}
model = client.create_memory_model(
    space_id="accounts",
    name="Acme situation",
    query="What is the current state of the Acme account — blockers, owners, and commitments?",
    trigger={"mode": "delta", "refresh_on_new_memories": True},
)
```

A memory model is a question plus its maintained answer. `refresh_on_new_memories`
is what makes it standing rather than a snapshot: new memories in the space
cause it to rewrite itself.

## Step 2 — Read the answer, not the search

```python theme={null}
current = client.get_memory_model(space_id="accounts", model_id=model["model_id"])
print(current["content"])
print("stale:", current["is_stale"])
```

`is_stale` is the honest bit. It tells you the underlying memories have moved
since this text was written, so you know whether you are reading a current
answer or a recent one.

## Step 3 — Force a rewrite when you need it fresh

```python theme={null}
client.refresh_memory_model(space_id="accounts", model_id=model["model_id"])
```

Refresh is asynchronous and billed, so trigger it on the cadence you actually
need rather than before every read.

## Step 4 — See how the answer changed

```python theme={null}
for entry in client.get_memory_model_history(space_id="accounts", model_id=model["model_id"])["entries"]:
    print(entry["changed_at"], entry["previous_content"][:120])
```

The history is often more useful than the current text: it is a record of when
your understanding of the account changed, which nobody was writing down.

## Evals

1. Create a model, record three relevant memories, refresh, read it.
2. Record a memory that contradicts the briefing. Check `is_stale` flips.
3. Refresh and confirm the new text reflects the contradiction rather than
   averaging it away.
4. Read the history and check the previous version is preserved verbatim.

## Guardrails

<Warning>
  **A briefing is a summary, and summaries lose the exception.** Do not make an
  irreversible decision from the model text alone — retrieve the underlying
  memories when it matters. The model is for orientation, not evidence.
</Warning>

* **Creating and refreshing cost credits; reading is free.** A model refreshed
  on every write to a busy space is an expensive way to be slightly more current.
* **A brand-new model briefly has no content.** It is generated on the first
  refresh, and until then there is genuinely nothing to show — render that state
  rather than an empty string that reads like an answer.
* **Editing a model's text does not refresh it**, deliberately: a typo fix
  should not cost a full rewrite.

## Built from

Every call above belongs to this runnable script's territory —
[`memory_basics.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py)
— and the model surface is documented in full at
[Memory models](/api-reference/models).
