Skip to main content
The route is /graph for historical reasons. It is not the entity graph, which lists the entities a space has extracted. In the dashboard this is the /draw command; see Charts, diagrams and artifacts.
Ask for a chart in plain language and get back a validated chart spec, the same chart as Mermaid source, and any short note the model added. Ask about a process or a structure instead (“how does signup work”, “flow chart of our release process”) and you get a Mermaid diagram rather than a chart. Either one is drawn from this space’s memories and its curated summaries (memory models) only: every number in it has to come from what the space holds. When the memories do not contain the numbers, you get no chart and a sentence saying so, rather than a plausible guess.

Request

Unknown fields are rejected with 422 validation_error. Response 200 OK

The chart spec

The same spec is what the dashboard’s Ask tab draws for /draw, so a chart looks the same wherever it was asked for.

Mermaid mapping

The value axis is labelled with unit, or with the first y key when unit is absent or empty. An empty title leaves the title line out. Labels are quoted; a double quote inside one becomes a single quote, and runs of whitespace become one space, because Mermaid has no escape inside a quoted label.

Diagrams

A diagram is Mermaid source written by the model from this space’s memories. Every node, step and label has to come from what the space holds; when the memories do not describe what you asked for, you get no diagram and a sentence saying so. The first line must name one of these diagram types, spelled exactly as Mermaid spells it: flowchart, graph, sequenceDiagram, stateDiagram, stateDiagram-v2, mindmap, timeline. A diagram is refused whole, never edited, when it (node shapes in mind maps and label quoting in flowcharts are normalised, so labels are neither clipped nor rejected for containing parentheses; nothing else is ever edited):
  • uses any other diagram type
  • is longer than 8,000 characters or 200 lines
  • contains a %%{ init or directive block
  • has a line starting with click
  • contains href, javascript:, <script, <iframe, url( or @import (in any letter case)
  • contains a call callback such as call doThing()
A refused diagram comes back as diagram: null and mermaid: null, with text holding the model’s note, or “The diagram could not be drawn from that answer.” when it wrote none.

What it costs

A chart or diagram is billed as one chat turn on the model that drew it, to the organization making the request (on a shared space, that is you, not the space’s owner). Nothing is written back into the space, so a read-only member of a space can ask for charts and diagrams too.

Errors

Next steps

Charts, diagrams and artifacts

Use /draw and /artifact in the dashboard.

Artifacts API

Build a shareable page about a space.