digraph flow {
  rankdir="TB";
  newrank=true;
  compound=true;
  nodesep=0.35;
  ranksep=0.55;
  graph [fontname="Helvetica", fontsize=11, labelloc="t"];
  node  [fontname="Helvetica", fontsize=10];
  edge  [fontname="Helvetica", fontsize=9];
  label="Recall (warm) — cache HIT (post v5.99)
EMBED_CACHE+CE_CACHE hit + spreading-BFS batched -> warm floor ~1.6s; cold CE bottleneck
total ≈ 597 ms";
  subgraph "cluster_core" {
    label="Core process (--cpus 1)";
    style=filled;
    bgcolor="#eef4fb";
    color="#4a72a8";
    fontcolor="#26456b";
    fontname="Helvetica-Bold";
    "entry" [shape="circle", style="filled", fillcolor="#d6d6d6", label="recall() entry\nvalidate + detect branch/dir\n2 ms"];
    "qanalysis" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="query analysis\nentities + routing\n3 ms"];
    "ppr" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="personalized PageRank\n[v5.99 adj batched; warm 0-300ms; cold see spread]\n300 ms"];
    "fusion" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="WRRF / convex fusion\nmerge signals\n2 ms"];
    "dedup" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="dedup + MMR diversity\n3 ms"];
    "results" [shape="doublecircle", style="filled", fillcolor="#d6d6d6", label="ranked results"];
  }
  subgraph "cluster_backend" {
    label="Backend (--cpus 2): SurrealDB + rerank server";
    style=filled;
    bgcolor="#fbf0ea";
    color="#b5744a";
    fontcolor="#7a4620";
    fontname="Helvetica-Bold";
    "embed" [shape="box", style="filled", fillcolor="#f5e1f5", label="query embed\n[EMBED_CACHE HIT -> ~0]\n0 ms"];
    "knn" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="vector KNN search\nHNSW index\n25 ms"];
    "fts" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="FTS BM25 search\nbranch clause injected\n22 ms"];
    "priors" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="graph+cofire priors\n[v5.96 BATCHED: 2 queries]\n150 ms"];
    "spread" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="spreading-BFS activation\n[v5.99 BATCHED: 1 q/BFS-depth; cold ~40-50s->~7-9s core w/PPR]\n0 ms"];
    "fetch" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="fusion final-fetch\n[v5.97 BATCHED: 1 query WHERE id IN]\n40 ms"];
    "cererank" [shape="box", style="filled", fillcolor="#f5e1f5", label="CE rerank (GTE-ModernBERT)\n[CE_CACHE HIT -> cached; cold: ~9s first /rerank]\n50 ms"];
    "heat" [shape="cylinder", style="filled", fillcolor="#fce3d6", label="heat-boost\n(async, off critical path)\n0 ms"];
  }
  "entry" -> "qanalysis" [color="#333333", style="solid", label="1"];
  "qanalysis" -> "embed" [color="#333333", style="solid", label="2"];
  "embed" -> "knn" [color="#333333", style="solid", label="query vector"];
  "knn" -> "fts" [color="#333333", style="solid", label="4"];
  "fts" -> "priors" [color="#333333", style="solid", label="5"];
  "priors" -> "spread" [color="#333333", style="solid", label="6"];
  "spread" -> "ppr" [color="#333333", style="solid", label="7"];
  "ppr" -> "fusion" [color="#333333", style="solid", label="signals"];
  "fusion" -> "fetch" [color="#333333", style="solid", label="top candidates"];
  "fetch" -> "cererank" [color="#333333", style="solid", label="hydrated rows"];
  "cererank" -> "dedup" [color="#333333", style="solid", label="11"];
  "dedup" -> "heat" [color="#333333", style="solid", label="12"];
  "heat" -> "results" [color="#333333", style="solid", label="13"];
}
