Docs / How it works

The client map

One Mermaid diagram per client: the top-level picture of what the client wants, what is still open and what we did. The agent redraws it after each draft (Mail or a messenger), after an owner-sent reply it sees and after a message with a new fact; the Hub keeps it with its evidence, shows it, and copies it to the client's Notion page.

Where it lives

The shape (what client_map accepts)

@hub/diagram/map checks the text before it is saved; a refusal (map_invalid) names the line and the old map stays. It is a strict subset of Mermaid's flowchart (Mermaid's own parser needs a DOM and cannot run on the server; @mermaid-js/parser has no flowchart grammar), so what passes is valid Mermaid:

Example:

offeredAcme LtdLaunch the shop in MayLower card feesPick a templateImport 400 productsImport service (Pro plan)Their bank's answer awaited
Mermaid source
flowchart TD
  c["Acme Ltd"] --> p1[Launch the shop in May]
  c --> p2[Lower card fees]
  p1 --> p1a[Pick a template]:::done
  p1 --> p1b[Import 400 products]
  p1b -->|offered| p1b1["Import service (Pro plan)"]:::open
  p2 --> p2a[Their bank's answer awaited]:::waiting
  %% src p1: <CAF1x@mail.example>
  %% src p2: 2026-11-18 telegram
  %% src p1a: <CAF1x@mail.example>
  %% src p1b: <CAF2y@mail.example>
  %% src p1b1: <CAF2y@mail.example>
  %% src p2a: 2026-11-19 call

Code

packages/diagram (./map the check, the sources, the diff, the outline and the Notion copy; ./map-status the counts, the stuck nodes and the next step; ./render the browser renderer, also Help's scheme), packages/db/src/repos/client-maps.ts, packages/agent/src/mcp/tools/client-map.ts, apps/server/src/mail/client-map-routes.ts (GET /api/projects/:slug/clients/:id/map, GET /api/projects/:slug/client-maps/stuck), apps/admin/src/components/conversation/client-map*.tsx, apps/admin/src/features/overview/stuck.tsx, packages/notion/src/client-map.ts, the installer step notion.client-map, the skill skills/review-maps. hub client map <address> prints the source.

Update this page when the architecture changes.

Source: @docs/core/29-client-map.md