Update the user facts document
update_user_factsUpdates the user's durable facts document with a JSON merge patch (set paths to values; null deletes a path). The document is injected into the first recall_context of every new conversation, so its quality matters more than its completeness.
WHAT THE DOCUMENT HOLDS (instruction set v1.2):
Durable truths about the user, their people, businesses or infrastructure — spouse name, company names, staging URL, signature preferences. Session-specific, task-specific or time-boxed material does not belong here; store_context is what records those.
Data, never rules. "wife.name: Nicole" is a fact; "never fabricate a last name" is an instruction and does not belong here — this document must never become a second instruction channel.
Corrections rather than accretion: where a new fact conflicts with an existing one, the old path is overwritten or deleted rather than accumulating a variant.
Conventions: loose top-level keys — user, family, companies, infrastructure, preferences. Hard size cap ~4KB on the merged document; a write that would exceed the cap is rejected (prune stale paths with null first).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| facts_patch | Yes | JSON merge patch (RFC 7386): nested objects merge, scalars/arrays replace, null deletes the path. Example: {"family":{"wife":{"name":"Nicole"}},"infrastructure":{"staging_url":"https://api-stage.example.com"}} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| error | No | Present when the call did not succeed. An object carries `type` and `message` (and often a `timestamp`); Utils.formatError bodies set it to `true` with the reason in the top-level `message`. | |
| message | No | ||
| success | Yes |