Mindmap API for people, scripts and AI agents

← Back to the editor · Plain-text version (llms.txt) · Source

How it works

Mindmap is a static site. Maps are stored in your browser (IndexedDB) and never leave it unless you export them. There is no server, so there is no HTTP endpoint; instead the page itself is the API. Everything the editor does goes through one set of operations, and anything that can reach those operations has the same editing power as you. Three transports exist:

TransportWho it is forSetup
PasteAny AI, including chat assistants that cannot browseNone
LinksAny AI that can write a URL, bookmarks, other appsNone
window.mindmapBrowser-driving agents (Claude in Chrome, Playwright, extensions), the devtools consoleNone; the object is always present

Every change records an author. Nodes added by someone other than you get a small badge, and the Log tab shows who did what, so AI edits are visible and reversible (undo works on them too). Notes are comments attached to a node or the map, kept separate from node text so an agent can annotate without rewriting your words.

1. Paste round trip

  1. In the editor choose Export ▾ Copy JSON (complete) or Copy outline (compact markdown) and give it to the AI.
  2. Ask for a change. The AI replies with an outline, an operations array, or an edited map JSON.
  3. Select the node the material belongs under, then press Ctrl+V on the canvas, or paste into the AI / API panel and click Apply (there you can also set the author name).

Pasted outlines are added under the selected node (or the root). Operation arrays are applied to the open map. A full map JSON is imported as a new map.

Open a URL of the form https://odoluca.github.io/mindmap/#command=value. One command per link. The value is either URL-encoded text/JSON or base64url prefixed with b64: (use mindmap.encodeForUrl(value) or mindmap.linkFor('ops', ops) to build one). The hash never reaches a server. After running, the command is removed from the address bar.

CommandEffect
#ops=[…]Apply an operations array to the open map (the last-used map is opened first).
#outline=…Create a new map from a markdown outline (its first heading or item becomes the name).
#import={…}Import a full map JSON as a new map and open it.
#open=<id>Open the map with that id.
#cmd={…}General form: {"ops":[…], "author":"claude"}, {"outline":"…", "parent":"Node text", "append":true}, {"open":"id"}, {"map":{…}}. Keys can be combined; open runs first.
https://odoluca.github.io/mindmap/#ops=[{"op":"addNode","text":"Ideas from today","color":"green"}]
https://odoluca.github.io/mindmap/#outline=%23%20Trip%0A-%20Pack%0A%20%20-%20Passport%0A-%20Book%20hotel

3. window.mindmap

A global object on the editor page. Node references (parent, from, to, id, target) accept a node id or a node text when that text is unique. Results are plain JSON copies. Call mindmap.help() for a short reminder.

CallReturnsNotes
listMaps()Promise of [{id, name, kind, nodes, updatedAt}]Newest first.
getMap()The open map (JSON)Synchronous.
getMapById(id)Promise of a mapDoes not open it.
openMap(id), createMap({name, kind, root}), importMap(json), deleteMap(id)Promiseskind is mindmap or flowchart.
apply(ops, {author}){ok:true, results:[…]} or {ok:false, error, index}Atomic. One undo step.
addNode(text, parent, extra)new idextra: shape, color, notes, tags, index, author…
addTree(parent, nodes)idsnodes: [{text, children:[…]}] or strings.
updateNode(id, fields), deleteNode(id, cascade)id / ids
link(from, to, label, extra)edge idextra: directed, style, color.
note(text, target)note idtarget null = map note.
getNode(ref), find(query), children(ref), roots(), notes(ref), log(limit)JSONfind searches text, notes and tags.
outline(), addOutline(markdown, parent)markdown / ids
describe()one-line summary
select(ids), selection(), centerOn(id), fit(), undo(), redo()—View helpers.
on(event, fn)unsubscribe functionEvents: change ({id, ops, author}), open, select.
authorstring propertyDefault author for calls without one (initially assistant). Set it to your name, for example mindmap.author = 'claude'.
encodeForUrl(value), linkFor(command, value)stringBuild link commands.
ops, shapes, colors, layouts, edgeStylesarraysThe allowed values.
mindmap.author = 'claude';
const map = mindmap.getMap();
const ids = mindmap.addTree('Research', [
  { text: 'Read papers', children: ['Survey A', 'Survey B'] },
  { text: 'Run experiment', shape: 'diamond', color: 'orange', notes: 'needs the GPU box' },
]);
mindmap.link(ids[0], 'Run experiment', 'then');
mindmap.note('Outline drafted from the meeting notes.', 'Research');
mindmap.fit();

Map JSON

{
  "app": "mindmap", "version": 1,
  "id": "m3k1…", "name": "Project plan", "kind": "mindmap",
  "createdAt": "2026-11-09T10:00:00.000Z", "updatedAt": "…",
  "settings": { "layout": "mindmap", "edgeStyle": "curved", "showAuthors": true },
  "view": { "x": 0, "y": 0, "scale": 1 },
  "nodes": [
    { "id": "n1", "text": "Project plan", "notes": "", "shape": "rounded", "color": "default",
      "parent": null, "x": 0, "y": 0, "w": null, "h": null, "collapsed": false, "tags": [],
      "author": "user", "createdAt": "…", "updatedAt": "…" },
    { "id": "n2", "text": "Phase 1", "parent": "n1", "color": "blue", … }
  ],
  "edges": [ { "id": "e1", "from": "n2", "to": "n5", "label": "blocks", "directed": true, "style": null, "color": "default", "author": "user", "createdAt": "…" } ],
  "notes": [ { "id": "c1", "target": "n2", "text": "Agreed on Monday", "author": "claude", "createdAt": "…" } ],
  "log":   [ { "at": "…", "author": "claude", "op": "addNote", "id": "c1", "summary": "Note on \"Phase 1\": Agreed on Monday" } ]
}

Operations

An operation is an object with an op key. Lists are applied in order and atomically: if one fails, nothing changes and the error names the failing index. Each operation records a log entry with the author.

OperationFieldsResult
addNodetext, parent?, shape?, color?, notes?, tags?, index?, x?, y?, collapsed?, id?
Omit parent for the root (mind maps) or a floating node (flowcharts); null forces floating. index is the position among siblings.
{id}
addTreeparent?, nodes: array of {text, notes?, shape?, color?, tags?, children?:[…]} or plain strings{ids} in depth-first order
updateNodeid plus any of text notes shape color tags collapsed parent index x y w h{id}
moveNodeid, parent (null = top level), index?{id}
deleteNodeid, cascade? (default true; false re-attaches children to the grandparent){ids} removed
addEdgefrom, to, label?, directed? (default true), style?, color?{id}
updateEdgeid plus any of label directed style color from to{id}
deleteEdgeid{id}
addNotetext, target? (node or null for the map){id}
updateNote / deleteNoteid, text{id}
setMapname?, kind?, settings? (layout, edgeStyle, showAuthors, grid: snap-to-grid size in px for free placement, 0 = off), view?{id}
layoutmode, once? (apply to coordinates but keep the free mode){relayout}
replaceMapmap: a full map JSON whose content replaces the open map's nodes, edges, notes and settings (the id stays){id}

Outline format

The compact text form, used by Export ▾ Copy outline, by #outline= and by paste. It is ordinary markdown.

# Map name

- Root idea
  - First branch {color=blue}
    - Leaf with notes
      > Notes can span
      > several lines
    - Decision {shape=diamond tags=risk,todo}
  - Second branch

## Links

- Leaf with notes -> Second branch: see also
- First branch -- Second branch

## Notes

- A note on the whole map

Examples

Ask an AI to extend a branch (paste)

Here is my mind map as an outline: … (paste)
Add five sub-points under "Marketing" as a markdown outline, nothing else.

Select "Marketing", press Ctrl+V.

Operations array (paste or #ops=)

[
  { "op": "addTree", "parent": "Marketing", "nodes": [
      { "text": "Launch post", "children": ["Draft", "Review", "Publish"] },
      { "text": "Newsletter", "color": "teal" } ] },
  { "op": "addNote", "target": "Marketing", "text": "Suggested by Claude on request; adjust dates." },
  { "op": "updateNode", "id": "Old item", "color": "gray", "notes": "superseded by the launch post" }
]

A flowchart from scratch (window.mindmap)

await mindmap.createMap({ name: 'Login flow', kind: 'flowchart' });
mindmap.apply([
  { op: 'addNode', id: 'start', text: 'Start', shape: 'stadium' },
  { op: 'addNode', id: 'creds', text: 'Enter credentials', shape: 'parallelogram' },
  { op: 'addNode', id: 'ok', text: 'Valid?', shape: 'diamond', color: 'yellow' },
  { op: 'addNode', id: 'home', text: 'Show home', shape: 'rect' },
  { op: 'addNode', id: 'end', text: 'End', shape: 'stadium' },
  { op: 'addEdge', from: 'start', to: 'creds' },
  { op: 'addEdge', from: 'creds', to: 'ok' },
  { op: 'addEdge', from: 'ok', to: 'home', label: 'yes' },
  { op: 'addEdge', from: 'ok', to: 'creds', label: 'no' },
  { op: 'addEdge', from: 'home', to: 'end' },
  { op: 'layout', mode: 'layered-down', once: true },
], { author: 'claude' });

Watch for changes

mindmap.on('change', ({ author, ops }) => console.log(author, 'applied', ops.length, 'operations'));