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

# Everything you know about one user

> Two calls turn scoped writes into a profile, and a question you can ask about that person alone.

[← All use cases](https://docs.memory.anonalabs.com/use-cases/overview.md)

[user\_profiles.py](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/user_profiles.py)

## The scenario

Once writes are scoped per user, the scope is worth more than isolation. It is a
profile — and two calls turn it into product features without you assembling
anything.

## Step 1 — The profile, as data

```python theme={null}
profile = client.get_user_profile(space_id=space, user_id="priya")
print(profile["memory_count"], "things known")
for m in profile["memories"]:
    print(m["text"])
```

## Step 2 — The same profile, as a prompt block

```python theme={null}
block = client.get_user_profile(
    space_id=space, user_id="priya", format="block", context_max_tokens=300
)
print(block["context"])
```

Budgeted server-side, so a heavy user cannot quietly blow your prompt.

## Step 3 — Ask a question about that person

```python theme={null}
answer = client.ask_about_user(
    space_id=space, user_id="priya", query="How should we schedule a call with her?"
)
print(answer["insights"])
print("answered by:", answer["model"])
```

The response names the model that answered — which is what the call's credits
were billed at, so it is worth logging rather than discarding.

## Evals

1. Record three facts about one user, then read the profile. All three present.
2. Request the block form with a small budget and confirm it truncates by
   dropping whole memories, not mid-sentence.
3. Ask about a user nobody has written about. `memory_count` is 0 and that is
   **not an error** — a user is a scope tag, not a resource you register.

## Guardrails

> [!WARNING]
>
> **`memory_count` is non-monotonic.** Consolidation merges related memories, so
> the number can fall while the system knows strictly more. Never show it to an
> end user as "things we know about you", and never alert on it dropping.

* **A profile is personal data.** Whatever goes in is retrievable, exportable
  and — when someone asks — [deletable](https://docs.memory.anonalabs.com/use-cases/delete-a-users-memories.md).
* **An unknown user returns an empty profile, not a 404.** Handle the empty
  case; do not treat it as a failure.

## The script

Complete and runnable:
[`user_profiles.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/user_profiles.py).

Prerequisite: [Support agent that knows each customer](https://docs.memory.anonalabs.com/use-cases/support-agent-per-customer.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.