Identify the user: memory and conversations that continue
Tell the SDK who is signed in, let the agent remember them across chats, calls and devices, pick up the conversation where it left off, show and erase what is remembered, start a new conversation, and sign out — on every platform.
With one identifier — the trait your Who is the user? setting names — the agent knows the signed-in user on every surface: it remembers them across conversations and devices, the chat opens where they left it, and calls can be booked for them. Without one, every conversation is anonymous: nothing is kept, and nothing is shared between people.
What it needs in the dashboard
| Where | Setting | Value |
|---|---|---|
| Agent → Memory → Settings | Remembers people across chats and calls | On |
| Agent → Memory → Settings | Who is the user? | User ID (user_id, the default), Email, Phone number, or Custom field with your trait's name (for example customer_id). The same on every agent the user talks to |
| Agent → Memory → Settings | Devices per user | 1 to 10 (2 by default): how many installs can act as one person |
| Agent → Memory → Settings | Shared with, Keep memories for, What to remember | This agent only, or the agents in your workspace set to share; how long (365 days by default); what to keep and what never to |
Memory → People is where your team later finds a person, by the identifier your app sends or a caller's phone number, sees what is remembered, forgets it and resets their devices.
What to do, in order
- After sign-in, call
identifywith the identifier under the field's name, plus any traits the prompt can use (name,plan). Pass the user's memory choice if your app asks for one. It applies to the next conversation. - Talk or chat. → The agent knows the user's name (a prompt variable) and, with memory on, what it learnt before: read at the start of each chat, Talk session or call — after the prompt for a prompt agent, after the flow's Briefing for a flow agent — and looked up again only when the user refers to an earlier conversation. New facts are ready about a minute after a conversation ends (how memory works).
- Come back later — the same day, on another of their devices. → The chat opens on the earlier messages (the last 50 with that agent, kept 7 days after the latest) and the agent carries on; a call starts with its greeting but knows what was said.
- Show what is remembered with
memories(); erase it withforgetMemory(), which also clears the chat on screen. - Start over with
newConversation()(or New conversation in the chat's header): a fresh thread; the memories stay. - On sign-out, call
identify(null). The device is released from the user and later conversations are anonymous.
The identifier is never a prompt variable. Graine stores the identifier your app sends so your team can see who each conversation was with — Call History shows User ID · u_8812 — and the memory service only ever receives a one-way key derived from it. Every other trait is masked on the device before it leaves it.
The code, platform by platform
1. After sign-in:
→ graine.memoryChoice is the user's stored choice (true unless they turned it
off). memory: nil keeps the stored one.
4. What is remembered, and erasing it:
5. A new conversation:
Turn memory off for this user (a privacy screen):
GraineInApp.shared.setMemory(false).
6. On sign-out:
What you'll see
| Moment | In your app | In the dashboard |
|---|---|---|
The first conversation after identify | The agent uses the name you sent | Call History shows User ID · u_8812 (or your field's name) |
| The user comes back within 7 days | The chat opens on the earlier messages, a date line where the day changes, an earlier call as one Voice call row; no second welcome | — |
forgetMemory() succeeds | The chat on screen empties | Memory → People → Find a person shows nothing remembered and no notes for them; their conversations stay in Call History |
| A device past Devices per user | It works, anonymously: no memory, no booking for the person | Memory → People → Find a person → Settings → Reset devices frees the slots |
Troubleshooting
| What you see | Why | Fix |
|---|---|---|
| The agent does not remember | Memory is off on the agent, the user turned it off, or identify used another field | Turn it on; check memoryChoice / memoryEnabled; send the field Who is the user? names |
identity_required | No identifier — or a placeholder such as guest, 0, unknown | identify with a real identifier first |
device_limit | This install is not one of the user's allowed devices | Sign out on another device, raise Devices per user, or reset the user's devices |
| The website and the app are two people | A different field or value on each | The same Who is the user? field, and the same value, on both agents |
| The chat does not show earlier messages | Anonymous, memory off, more than 7 days, or the Garage hides Earlier messages | Identify the user; Chat window → Earlier messages on |
| A fact from a moment ago is not known in a new chat | New facts are ready about a minute after a conversation ends | Wait a minute, then start a new conversation |
| The agent knows a fact but does not act on it | The prompt or the flow does not say to | Add the lines in Make the agent use what it remembers |
The rules in full: Identity and users · Memory · the variables the traits become: Variables · the user's details under the prompt's own names: Send your user's details to the agent.

