A board where the AI works beside you as a cursor. It moves to a spot, adds notes, connectors and frames one by one, and the whole run is a single undo step. Controlled: you pass the document and the async plans, and get the new document back.
On this page
- Brainstorming boards
- Planning and roadmaps
- Mind maps
- Workshops with an AI helper
- Tidying a messy board
Examples
On a phone
Math tutor
A prompt box and an empty board. Ask builds a problem: the statement, what is given, a diagram with labelled sides, hints and an empty Solution frame. Show next step reveals the solution one worked line at a time, and Explain writes a note beside the note you select. Formulas are a board object of their own, drawn with KaTeX and edited as LaTeX. The plans here are scripted; the code below is the server half you would swap in.
Ask on the board
No prompt box: the question is a text box on the board. Select it and a small bar offers Explain, Answer, Hint and Steps. The AI cursor then builds guide panels in a column beside the question (under it on a narrow board), each a frame with a line of text and a formula, linked to the question by labelled connectors. Hint shows one more each time; Steps reveals the worked lines one by one. Type your own question with the Text tool: anything that ends with a question mark gets the bar. Your app supplies the panel content; the layout and the run are the block's.
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- useAiCollaborator({ board, planners })
hook- Runs an action. Returns state, cursor, run, stop, keep, undo and dismiss.
- board
AiBoard- What the AI edits. handleBoard(() => ref.current, () => doc) connects it to the Whiteboard handle.
- planners
Partial<Record<AiActionId, AiPlanner>>- Your async calls. A planner gets the action, the prompt, the selection, the document and an abort signal, and returns steps or an async stream of steps.
- AiStep
{ say?, at?, ops, pace? }- One move: what the AI says, where the cursor goes (default the first object it touches) and the edit operations to apply there.
- choreography
"tools"|"quick"- Default
quick - An option of useAiCollaborator. quick places each object where it belongs. tools works like a person: it presses on the top left and drags a growing outline to the bottom right for a frame, shape or note (the cursor shows the tool), clicks tiny things, shows a caret while text types, holds a pulsing placeholder with a spinner badge while a formula or an image renders, and drags a connector from the source edge to the target. A drag takes 160 to 600ms, so a long board stays quick. Reduced motion is instant in both.
- AiCursor
{ cursor, viewport?, name?, color? }- Default
name AI - Put it in the board's renderOverlay. Pass the overlay's viewport so the outline and line the AI draws in tools mode sit in the same space as the cursor. It is decorative; the run bar says the same in words.
- AiPromptBar
{ onRun, selectedCount, running, actions? }- One line to ask, and Extend, Cluster, Summarise and Tidy beside it. A button that needs a selection says so.
- AiRunBar
{ state, onStop, onKeep, onUndo, onDismiss }- Shows progress with Stop, then Keep or Undo. Renders nothing while idle.
- boardToContext(doc, opts)
string- The board as text for a model. format outline (frames as sections, bullets with ids, connections as A -> B, relations instead of coordinates) or json (a compact graph). opts: selection, viewport (only what is in view), maxText. The same board always gives the same string, so a prompt that starts with it can be cached.
- math object
{ type: "math", x, y, w, h, src }- A formula. src is LaTeX, drawn with KaTeX as MathML (no stylesheet needed) and shown as plain text until KaTeX has loaded or when the source does not parse.
- AskBar
{ doc, selection, viewport, size, onAction, onPlace?, actions?, labels?, running?, noMore? }- The bar for a selected question. Put it in renderOverlay with its viewport and size. It sits under the question when that spot is free, else above or beside it, never on another object, and hides while a run builds. onAction(action, question) starts the run; onPlace reports its board box for askPlanners' avoid. A one-off action that already built its panels says so.
- askPlanners(content)
Partial<Record<"explain" | "answer" | "hint" | "steps", AiPlanner>>- Planners for the question actions; opts.avoid returns board boxes new panels keep clear of (the bar). Each content call gets { action, question, text, shown, doc, view, signal } and returns panels { title, text, math?, link? }; Hint takes one panel per click and [] means no more.
- question object
{ type: "text", ask: true, ... }- A text box flagged as a question. Any text or note ending in a question mark counts too; markQuestion(q) flags it. boardToContext lists it as a question.
- actions
AiActionId[]- Default
ask, extend, cluster, summarise, tidy - On AiPromptBar. Two more can be switched on: explain (writes next to the selected object) and reveal (shows the next step of something the AI holds back).
| Prop | Type | Default | Description |
|---|---|---|---|
| useAiCollaborator({ board, planners }) | hook | - | Runs an action. Returns state, cursor, run, stop, keep, undo and dismiss. |
| board | AiBoard | - | What the AI edits. handleBoard(() => ref.current, () => doc) connects it to the Whiteboard handle. |
| planners | Partial<Record<AiActionId, AiPlanner>> | - | Your async calls. A planner gets the action, the prompt, the selection, the document and an abort signal, and returns steps or an async stream of steps. |
| AiStep | { say?, at?, ops, pace? } | - | One move: what the AI says, where the cursor goes (default the first object it touches) and the edit operations to apply there. |
| choreography | "tools" | "quick" | quick | An option of useAiCollaborator. quick places each object where it belongs. tools works like a person: it presses on the top left and drags a growing outline to the bottom right for a frame, shape or note (the cursor shows the tool), clicks tiny things, shows a caret while text types, holds a pulsing placeholder with a spinner badge while a formula or an image renders, and drags a connector from the source edge to the target. A drag takes 160 to 600ms, so a long board stays quick. Reduced motion is instant in both. |
| AiCursor | { cursor, viewport?, name?, color? } | name AI | Put it in the board's renderOverlay. Pass the overlay's viewport so the outline and line the AI draws in tools mode sit in the same space as the cursor. It is decorative; the run bar says the same in words. |
| AiPromptBar | { onRun, selectedCount, running, actions? } | - | One line to ask, and Extend, Cluster, Summarise and Tidy beside it. A button that needs a selection says so. |
| AiRunBar | { state, onStop, onKeep, onUndo, onDismiss } | - | Shows progress with Stop, then Keep or Undo. Renders nothing while idle. |
| boardToContext(doc, opts) | string | - | The board as text for a model. format outline (frames as sections, bullets with ids, connections as A -> B, relations instead of coordinates) or json (a compact graph). opts: selection, viewport (only what is in view), maxText. The same board always gives the same string, so a prompt that starts with it can be cached. |
| math object | { type: "math", x, y, w, h, src } | - | A formula. src is LaTeX, drawn with KaTeX as MathML (no stylesheet needed) and shown as plain text until KaTeX has loaded or when the source does not parse. |
| AskBar | { doc, selection, viewport, size, onAction, onPlace?, actions?, labels?, running?, noMore? } | - | The bar for a selected question. Put it in renderOverlay with its viewport and size. It sits under the question when that spot is free, else above or beside it, never on another object, and hides while a run builds. onAction(action, question) starts the run; onPlace reports its board box for askPlanners' avoid. A one-off action that already built its panels says so. |
| askPlanners(content) | Partial<Record<"explain" | "answer" | "hint" | "steps", AiPlanner>> | - | Planners for the question actions; opts.avoid returns board boxes new panels keep clear of (the bar). Each content call gets { action, question, text, shown, doc, view, signal } and returns panels { title, text, math?, link? }; Hint takes one panel per click and [] means no more. |
| question object | { type: "text", ask: true, ... } | - | A text box flagged as a question. Any text or note ending in a question mark counts too; markQuestion(q) flags it. boardToContext lists it as a question. |
| actions | AiActionId[] | ask, extend, cluster, summarise, tidy | On AiPromptBar. Two more can be switched on: explain (writes next to the selected object) and reveal (shows the next step of something the AI holds back). |
Keyboard and accessibility
- The cursor is hidden from assistive technology. The run bar is a polite status that names the step and counts what was added.
- Stop, Keep and Undo are buttons in the tab order, and a button that needs a selection says why it is off.
- The AI badge on an object is labelled "Made by AI", so it does not depend on colour.
What it handles
- 01Shows the AI as a cursor on the board. It moves to each spot and adds the notes, connectors and frames one at a time, so a person can follow what it does.
- 02Takes a plan from your app as a stream of steps, and applies each one through the board's own edit operations with the author set to ai.
- 03Offers Ask, Extend, Cluster, Summarise and Tidy. Your app supplies each one as an async callback; the demo uses scripted stand-ins.
- 04Lets the person keep working while the AI works. Stop halts it at once, and what it already added stays.
- 05Records the whole run as one undo group, and marks everything the AI added with a small AI badge until the person edits it or keeps it.
- 06Ends with a bar that asks Keep or Undo. Reduced motion makes the cursor jump and each step land together.
States
- First render
- Nothing. The board and the bars paint as they are
- none
- AI starts
- The cursor appears at the first spot and says what it is doing
- 120ms, ease out
- AI moves to the next spot
- The cursor crosses the board
- 180 to 600ms by distance, ease in out
- AI adds an object
- The object appears with an AI badge
- none
- Stop
- The cursor stops and the run bar shows what was added
- none
- Finished
- The run bar asks Keep or Undo
- none
- Reduced motion
- The cursor jumps and each step lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The board and the bars paint as they are | none |
| AI starts | The cursor appears at the first spot and says what it is doing | 120ms, ease out |
| AI moves to the next spot | The cursor crosses the board | 180 to 600ms by distance, ease in out |
| AI adds an object | The object appears with an AI badge | none |
| Stop | The cursor stops and the run bar shows what was added | none |
| Finished | The run bar asks Keep or Undo | none |
| Reduced motion | The cursor jumps and each step lands at once | 0ms |
Works with
When to use
When to use
- A board where an AI adds notes, connectors and frames while the person watches and keeps working.
- Brainstorm, cluster, summarise or tidy on request, with one Undo for the whole run.
When not to use
- Other people's or agents' pointers on a document, without a board: use Agent Cursors.
- The board alone, with no AI: use AI Whiteboard.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI AI Collaborator to my app and wire it to my own data.
- I need a board where an AI adds notes, connectors and frames while the person watches and keeps working. Set that up with the Knowns UI AI Collaborator.
- Which AI Collaborator props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "ai-collaborator" }) and search_docs({ query: "ai collaborator" }). Pro props, full examples and source come back once your license key is in the MCP config.