diagram
Document a routine start to end as a graph, storing each step with its own notes and links to make process flows the source of truth.
Instructions
Document what a routine does, start to end, as a graph. Stored as type='diagram'.
For a PROCESS, not a fact: note() records what is true, checkpoint() where the work stands, this one how a routine runs. Every step is a separate object that can carry its own explanation and its own links to other memories, which is what makes a diagram the source of truth for its domain instead of one more wall of prose.
Keep every label objective -- what happens at that step, nothing
more. The reasoning, caveats and history belong in that node's
note, where they explain without cluttering the flow.
nodes: [{"key": "load", "label": "Read the export window", "shape": "step", "note": "optional long explanation"}] edges: [{"from": "load", "to": "check", "label": "optional branch"}]
key: stable id the edges refer to; letters, digits, '_' or '-'. shape: start|step|decision|io|end. Exactly one 'start' is required and every node must be reachable from it. Cycles are allowed -- a retry loop is a real flow, not a mistake.
also: other domain paths this flow belongs to, comma-separated. domain
is the routine's own place in the tree; also is for the flows that run
ACROSS routines -- several of them can be steps of one end-to-end
process without any of them being the parent of the others. Cross-list
each into that process's path and asking about it returns all of them,
instead of hoping one search phrasing reaches every one.
review_after and source_ref behave as in note(), and a flow is
exactly the kind of memory they are for: it describes code, and the
code moves.
Returns {"uid": ...}, or {"ok": False, "errors": [...]} with nothing written at all. Node positions are computed and stored server-side, so the flow renders identically for every reader -- see get_diagram().
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| also | No | ||
| kind | No | flowchart | |
| tags | No | ||
| edges | Yes | ||
| nodes | Yes | ||
| title | Yes | ||
| domain | No | ||
| session | No | ||
| summary | No | ||
| source_ref | No | ||
| review_after | No |