MemorySync
Advanced / Payload builder

Importance & Ranking

The fields you send with a write decide how findable and maintainable the memory is later. Build the payload deliberately instead of sending bare text.

Builder

Build the write payload

POST /memory/add
{
  "text": "The user prefers concise answers and dark mode.",
  "source": "chat",
  "tags": ["preference","ui"],
  "importance": 0.80,
  "metadata": { "conversation_id": "conv-42" }
}

Scope headers travel separately: the API key identifies the organization, and X-Project-ID plus X-End-User-ID select the scope this memory belongs to.

Reference

What each field buys you

text
The fact itself. Short, self-contained statements survive better than transcripts.
source
Where it came from. Useful for auditing and for cleaning up one integration later.
tags
The one field you can filter on at query time, so choose a small controlled vocabulary.
importance
A 0–1 hint you supply. Treat it as your own priority signal, and keep the scale consistent.
metadata
Your own identifiers for joining a memory back to your data. Never put secrets here.
session_id
Groups related writes and reads for one conversation.
Copy and run

Copy a working example

ms.add(
"The user prefers concise answers and dark mode.",
source="chat",
tags=["preference", "ui"],
importance=0.8,
session_id="conv-42",
metadata={"conversation_id": "conv-42"},
)
Was this page helpful?