Core Concepts
Add, Update & Delete
A memory moves through a small set of customer-visible operations: add it, inspect it, update its editable fields, summarize related records, or delete it.
Handle add outcomes
A successful add can create a memory or return a completed no-storage result. Branch on the response instead of assuming an ID exists.
CREATED
Memory exists
Use the returned ID and object.
SKIPPED
Nothing stored
Read the reason and do not retry unchanged input.
REJECTED
Bulk item failed
Inspect and correct that item before retrying.
Bulk add accepts at most 50 items. Inspect every per-item outcome because one response can contain a mix.
Update editable fields
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",project_id=os.environ["MEMORYSYNC_PROJECT_ID"],end_user_id="user-123",)updated = client.update(123,tags=["preference", "verified"],importance=0.8,metadata={"reviewed": True},)
Delete memories you no longer need
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",project_id=os.environ["MEMORYSYNC_PROJECT_ID"],end_user_id="user-123",)deleted_ids = client.forget([123], reason="user_request")
Use expiry for temporary context
Set ttl_minutes when the memory should stop applying after a known period. Use importance for weighting; do not use expiry as a ranking control.
Related operations
Was this page helpful?