Guides
Personalization
Use durable, user-approved preferences to adapt tone, format, recommendations, or interface behavior without replaying full interaction histories.
Separate preference from behavior
| Data | Example | System of record |
|---|---|---|
| Durable preference | “Use concise answers.” | MemorySync can supply retrieval context. |
| Account setting | Locale or accessibility setting | Your application database remains authoritative. |
| Temporary intent | “Show options for this trip.” | Current request or session context. |
| Sensitive decision | Eligibility or account access | Your governed business system. |
Capture an explicit preference
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",)memory = client.add("The user prefers concise answers.",source="preference",metadata={'channel':'settings'},)
Apply only when relevant
Query for the preference needed by the current task. Your application should decide whether the result is current, appropriate, and allowed before changing the experience.
Handle preference changes
- 1Treat the user’s latest explicit choice in your application as authoritative.
- 2Forget the superseded record and add the confirmed replacement instead of keeping competing statements.
- 3Preserve enough source context to explain where the preference came from.
- 4Provide a visible way for users to review or reset personalization when appropriate.
Privacy defaults
- Collect the minimum information needed for the feature.
- Avoid direct personal information in external identifiers.
- Do not infer sensitive traits for personalization.
- Honor export and deletion requirements throughout your application.
Was this page helpful?