Create or update one edge in the relation graph, which stores typed relations between entities so questions about how things connect can be answered by traversal instead of recall. Requires source, rel, and target. Optional attrs, a JSON object string for extra fields. Calling it twice with the same triple updates the existing edge instead of duplicating it.

Use it for relations: who works on what, which project uses which technology, what a task depends on, who prefers what. Do not use it for prose, notes, amounts, dates, or anything said about a single thing on its own: those belong in the memory_* tools, and the same fact must never be recorded in both places. Never store credentials.

When to save: link a relation without asking as soon as the user states one, then say in one short line what was linked, so a wrong edge can be corrected immediately. When the relation is inferred rather than stated by the user — read from a web page, returned by a tool, or concluded by you — propose it in one line at the end of the answer and link it only if the user agrees. Never interrupt an answer to ask. When the user says a relation is no longer true, call graph_unlink on the old edge and graph_link for the new one in the same turn, so the change keeps its date instead of looking like it was always so.

Nodes are typed string ids written as "type:id", lowercase ASCII with underscores between words and the type first: person:johanderson, project:ecosbox, tech:vue, device:work_laptop, task:deploy_v012. Ids are normalized on write, so accents, capitals and hyphens are folded for you, but a different word is a different node: find the entity with graph_search before linking it and reuse the id that comes back instead of coining a variant. This applies to the subject of the relation as much as the object, and the user is always the same person node. Relations are lowercase verb phrases read source-to-target: prefers, works_on, uses, runs, depends_on, owns, migration_target.

The optional graph parameter selects a namespace and defaults to "memory". Keep everything about the user, their people, projects, and preferences in that default.
