Skip to content
Panel(opens in a new tab)

append_memory

The append_memory tool appends a batch of items to a conversation’s memory log and returns the sequence numbers the batch got. It is the only memory tool that writes. Use recall_memory or replay_memory to read the items back. It requires site credentials.

Field Type Required Description
conversation_id string Yes The conversation to append to. Your agent creates the ID and follows the conversation ID rule.
items object[] Yes The items to store, in order: 1 to 250 JSON objects. Each item can be at most 256 KiB and the whole batch at most 1 MiB, both as serialized JSON. The batch is stored completely or not at all.
Field Type Always Present Description
first_seq integer Yes The sequence number of the batch’s first item.
last_seq integer Yes The sequence number of the batch’s last item. The batch holds every number from first_seq to last_seq.

Request:

{
"conversation_id": "c7Hk2mPq9xWz",
"items": [
{ "role": "shopper", "text": "I need waterproof hiking boots" },
{ "role": "agent", "tool": "text_search", "result_ids": ["120857", "120902"] }
]
}

Response:

{ "first_seq": 14, "last_seq": 15 }

An append fails without storing anything when the conversation ID is malformed, the batch is empty or too large, an item is too large, or the conversation would go over 100000 items. Don’t retry these. A rate-limit error (429 with Retry-After) and temporary storage errors are safe to retry with the same batch. The Retries and Errors table lists every case.