Memory
What an avatar remembers about each of your end users, and how to read, correct, pin and forget it.
Memory is what an avatar knows about a person from earlier conversations. After each conversation ends, the avatar learns from it: facts about the person, a summary of what was said, and — as conversations add up — a timeline of weeks and months and a rolling summary of older history. Alongside that are pinned memories, facts you write yourself from your own records.
The next conversation in the same scope starts with all of it in the avatar's prompt, which is how an avatar picks up where it left off.
Scope
Memory is kept per account, per avatar, per end_user_id — the ID you pass when you
create a conversation. Two avatars
never share memory, and neither do two of your end users.
| Scope | Where it comes from |
|---|---|
cust-42 | Conversations created with "end_user_id": "cust-42" |
anon:<conversation_id> | A conversation created without an end_user_id. Nothing is ever learned in it |
| Empty string | Your own scope: sessions you start from the dashboard |
When memory is written
Learning happens in the background, after a conversation ends — never during it. The write
is queued when you close the conversation with PATCH /v1/conversations/{id} or when the
session disconnects, and a background sweep catches any conversation that has been quiet
for about 15 minutes. It usually lands a few seconds after the end.
Each session loads memory once, when it starts, so a conversation that begins seconds
after the previous one ended may not see it yet. To check, read the end user's memory:
pending_conversations counts conversations whose memory is still being written.
Nothing is learned from a conversation when:
- it is in an
anon:scope; - it has fewer than two messages; or
- the person said fewer than four words of substance — greetings and filler such as "hi", "okay" or "thanks" do not count — unless they introduced themselves ("Hi, I'm Ada").
Learned memory can be read and deleted, but not edited. To correct something, delete it and, if the avatar should still know it, pin the right version.
Reading memory
- cURL
- Python
- Node.js
curl -s "https://backend.goldenengine.ai/v1/avatars/$AVATAR_ID/memory?end_user_id=cust-42" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY"
import os
import requests
BASE = "https://backend.goldenengine.ai"
HEADERS = {"X-Api-Key": os.environ["GOLDENENGINE_API_KEY"]}
memory = requests.get(
f"{BASE}/v1/avatars/{avatar_id}/memory",
headers=HEADERS,
params={"end_user_id": "cust-42"},
).json()
const BASE = "https://backend.goldenengine.ai";
const headers = { "X-Api-Key": process.env.GOLDENENGINE_API_KEY };
const params = new URLSearchParams({ end_user_id: "cust-42" });
const memory = await (
await fetch(`${BASE}/v1/avatars/${avatarId}/memory?${params}`, { headers })
).json();
{
"avatar_id": "5b2e7c10-...",
"end_user_id": "cust-42",
"pinned": [
{ "id": "a41f...", "end_user_id": "cust-42", "memory": "Premium plan since 2024", "created_at": "...", "updated_at": "..." }
],
"facts": [
{ "key": "pet", "value": "Rocky", "updated_at": "2026-09-20T14:03:11Z", "conversation_id": "9c4e8d21-..." }
],
"timeline": {
"aggregate": null,
"months": [],
"weeks": [],
"summaries": [
{ "id": "e07c...", "conversation_id": "9c4e8d21-...", "summary": "Asked how to reset a password...", "created_at": "...", "in_aggregate": false }
]
},
"pending_conversations": 0
}
end_user_id is a required query parameter, because it can contain characters that do not
belong in a path. Send it empty (?end_user_id=) to read your own scope. Add
type=facts or type=timeline to return only one half; pinned is always included. The
request is 404 when the scope holds nothing and nothing is pending, and when the avatar
is neither yours nor a stock avatar.
GET /v1/avatars/{avatar_id}/memory/scopes lists every end user the avatar remembers,
most recently updated first, with counts of facts, summaries and pins. It pages with skip
and limit (default 10, at most 100), takes search to match part of an end_user_id,
and leaves anon: scopes out unless you pass include_anonymous=true.
Forgetting
Every delete takes the same end_user_id query parameter. None of them delete
conversations, transcripts or recordings.
| Request | What it forgets |
|---|---|
DELETE /v1/avatars/{avatar_id}/memory | Everything about the end user: facts, summaries, timeline, the rolling summary and pinned memories |
DELETE …/memory/facts/{key} | One fact. A later conversation can learn it again if the person says it again |
DELETE …/memory/summaries/{summary_id} | One conversation's summary |
DELETE …/memory/timeline/{entry_id} | One week or month, together with the summaries it was built from |
DELETE …/memory/aggregate | The rolling summary of older conversations, which is then rebuilt from the summaries that remain |
Deleting a summary that is already folded into the rolling summary (in_aggregate: true)
removes that too and rebuilds it without the deleted conversation. Those two requests
return aggregate_rebuild: queued, not_needed, or unavailable when the rebuild could
not be queued — it then happens after the end user's next conversation.
- cURL
- Python
- Node.js
curl -s -X DELETE "https://backend.goldenengine.ai/v1/avatars/$AVATAR_ID/memory?end_user_id=cust-42" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY"
requests.delete(
f"{BASE}/v1/avatars/{avatar_id}/memory",
headers=HEADERS,
params={"end_user_id": "cust-42"},
)
await fetch(`${BASE}/v1/avatars/${avatarId}/memory?${params}`, {
method: "DELETE",
headers,
});
A conversation that ended moments ago can still land its memory after you forget an end
user. Check that pending_conversations is 0 first if that matters.
Pinned memories
A pinned memory is a statement about an end user that you supply — from your CRM, a sign-up form, a support ticket. The avatar sees pinned memories ahead of what it learned, as background from you; if the person later says something newer about themselves, the avatar goes with the person. Learning never changes or removes a pin.
Pins are stored immediately and are read at the start of the next session. You can add them before a person's first conversation.
- cURL
- Python
- Node.js
curl -s "https://backend.goldenengine.ai/v1/avatars/$AVATAR_ID/memory/pinned" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"end_user_id": "cust-42",
"memory": "Prefers short, direct answers"
}'
pin = requests.post(
f"{BASE}/v1/avatars/{avatar_id}/memory/pinned",
headers=HEADERS,
json={"end_user_id": "cust-42", "memory": "Prefers short, direct answers"},
).json()
const pin = await (
await fetch(`${BASE}/v1/avatars/${avatarId}/memory/pinned`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({
end_user_id: "cust-42",
memory: "Prefers short, direct answers",
}),
})
).json();
| Request | Purpose |
|---|---|
POST …/memory/pinned | Pin one memory. Body: end_user_id and memory |
POST …/memory/pinned/batch | Pin several at once. Body: end_user_id and a memories list. All or nothing |
GET …/memory/pinned?end_user_id=… | List an end user's pins, oldest first — the order the avatar sees them in. Default limit 30, at most 100 |
PATCH …/memory/pinned/{pinned_id} | Replace a pin's text, keeping its ID. Body: memory |
DELETE …/memory/pinned/{pinned_id} | Remove a pin |
Each pin is one plain statement on a single line, up to 500 characters; a pasted transcript
or notes block is rejected with 422. An end user can have at most 30 pins, and a create
that would go past that fails with 400 — for a batch, none of it is added. In the body,
end_user_id is required: send "" for your own scope. The anon: prefix is reserved.
Every endpoint, with its full request and response schema, is in the API reference.