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 — ALL PATHS (forward-only), REAL warm-miss (core 5.111 / backend 5.16, 2026-07-06)
trace 17f93bcc · PLAIN wall 19321 ms · core=forwarder, backend=pipeline · CE 3 passes ≈ 15.2 s = 79% · fast=1.5s landscape=2.2s
total ≈ 19.321 s";
  subgraph "cluster_core" {
    label="Core (--cpus 1) — tool.recall FORWARDER: validate + POST /recall + return; SESSION side-effects stay here";
    style=filled;
    bgcolor="#eef4fb";
    color="#4a72a8";
    fontcolor="#26456b";
    fontname="Helvetica-Bold";
    "entry" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="recall() entry (FORWARDER)\ntool.recall: validate + detect dir/branch\ntools.recall._forward_to_backend (traceparent)\n105 ms"];
    "sess" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="SESSION side-effects (CORE)\ntools.recall._record_recall_sr_transition\nSR/cognitive-map transition\n97 ms"];
    "results" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="ranked results returned to caller\n1 ms"];
  }
  subgraph "cluster_backend" {
    label="Backend (--cpus 2) — backend.recall runs the ENTIRE pipeline (SurrealDB + GTE reranker + embed); DB side-effects moved here";
    style=filled;
    bgcolor="#fbf0ea";
    color="#b5744a";
    fontcolor="#7a4620";
    fontname="Helvetica-Bold";
    "recvfwd" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="POST /recall received\nbackend.recall entry\n2 ms"];
    "qanalysis" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="query analysis + routing\nretrieval.analyze_query / resolve_query_and_candidate_k\n1 ms"];
    "fts" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="FTS BM25 (memory + wiki + profiles)\nretrieval.fts (branch clause injected)\n47 ms"];
    "embed" [shape="box", style="filled", fillcolor="#f5e1f5", label="query embed\nretrieval.vector.encode_query (warm model)\n15 ms"];
    "vector" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="vector KNN search\nretrieval.vector (HNSW ANN)\n55 ms"];
    "ppr" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="personalized PageRank\nretrieval.ppr (entity seeds + graph walk)\n234 ms"];
    "spread" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="spreading activation BFS\nretrieval.spreading (per-neighbour DB, uncached)\n1.475 s"];
    "entities" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="entity extraction\nretrieval.graph.find_entities_in_content\n372 ms"];
    "fusion" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="convex / WRRF fusion\nretrieval.fusion (merge signals)\n273 ms"];
    "build" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="build_results final-fetch\nretrieval.build_results (WHERE id IN, batched)\n866 ms"];
    "ce1" [shape="box", style="filled", fillcolor="#f5e1f5", label="CE PASS 1 — cross_encoder\nretrieval.rerank.cross_encoder\nLocalMLClient._try_gte_reranker (GTE-ModernBERT)\n7.937 s"];
    "mp" [shape="box", style="filled", fillcolor="#f5e1f5", label="CE PASS 2 — multi_passage\nretrieval.rerank.multi_passage (per-passage rescore)\n1.479 s"];
    "engram" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="engram_links rerank\nretrieval.rerank.engram_links (graph IO)\n375 ms"];
    "wiki" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="wiki_candidates fan-out\nretrieval.provider.wiki_candidates (wiki.query: FTS+vector+tags)\n319 ms"];
    "cefuse" [shape="box", style="filled", fillcolor="#f5e1f5", label="CE PASS 3 — wiki crossfuse\nretrieval.crossfuse.score_candidates_ce (memory∪wiki CE)\n5.803 s"];
    "sideeff" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="DB side-effects\ntools.recall._apply_recall_db_side_effects\nheat-boost + record_access (BACKEND)\n225 ms"];
    "fastp" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="profile=\"fast\" (trace 00cfc87e)\nNO CE, NO spreading, NO ppr\nengram_links 580 ms = the tail\nwall 1471 ms\n1.471 s"];
    "landscape" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="mode=\"landscape\" (trace eef6e95b)\nbackend.recall.landscape → astrocyte.consensus_retrieve\n93 domain-vote similarity calls; NO CE\nwall 2176 ms\n2.176 s"];
  }
  "entry" -> "recvfwd" [color="#333333", style="solid", label="POST /recall"];
  "recvfwd" -> "qanalysis" [color="#333333", style="solid", label="2"];
  "qanalysis" -> "fts" [color="#333333", style="solid", label="3"];
  "fts" -> "embed" [color="#333333", style="solid", label="4"];
  "embed" -> "vector" [color="#333333", style="solid", label="query vector"];
  "vector" -> "ppr" [color="#333333", style="solid", label="6"];
  "ppr" -> "spread" [color="#333333", style="solid", label="7"];
  "spread" -> "entities" [color="#333333", style="solid", label="8"];
  "entities" -> "fusion" [color="#333333", style="solid", label="signals"];
  "fusion" -> "build" [color="#333333", style="solid", label="top ids"];
  "build" -> "ce1" [color="#333333", style="solid", label="hydrated rows"];
  "ce1" -> "mp" [color="#333333", style="solid", label="12"];
  "mp" -> "engram" [color="#333333", style="solid", label="13"];
  "engram" -> "wiki" [color="#333333", style="solid", label="memory arm done"];
  "wiki" -> "cefuse" [color="#333333", style="solid", label="15"];
  "cefuse" -> "sideeff" [color="#333333", style="solid", label="16"];
  "sideeff" -> "sess" [color="#333333", style="solid", label="return to core"];
  "sess" -> "results" [color="#333333", style="solid", label="18"];
  "recvfwd" -> "fastp" [color="#999999", style="dashed", label="profile=fast"];
  "recvfwd" -> "landscape" [color="#999999", style="dashed", label="mode=landscape"];
}
