<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="atlas-primary-runtime-flow-d86a06d2" name="Atlas — primary runtime flow">
    <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <object id="1" label="Atlas — primary runtime flow" schemaVersion="1" diagramId="atlas-primary-runtime-flow-d86a06d2" canonicalAppearanceKey="tsx:src/app/(docs)/docs/modules/atlas/page.tsx:atlasRuntimeFlowChart#1" sourceSha256="d86a06d2e6529e931fbdcb7b5b062c24d68e035b452833bb7fbd4d3b4399e95e" metadataPayloadSha256="66abd2fc85eedf19353dc44c4553886d52f95578edf0d194a6a17d4d2381cd1e" generationKey="adfe2a319969f953add373d2e38719763d270e60bf7408701b31364d2d242da2" concepts="[&quot;Atlas runtime flow&quot;,&quot;Modules&quot;,&quot;Atlas&quot;]" keywords="[&quot;API consumer (SDK or curl)&quot;,&quot;GET :id/neighborhood (API)&quot;,&quot;canonical_relations (store)&quot;,&quot;entities + entity_aliases (store)&quot;,&quot;requireApiKey + content ACL (service)&quot;,&quot;mentions + documents (store)&quot;,&quot;workspace plus content-ACL context&quot;,&quot;entityCard resolves the seed&quot;,&quot;canonicalize a merged id to its head&quot;,&quot;expandFrontier from the canonical seed&quot;,&quot;hydrate full cards for every reached node&quot;,&quot;nodes, edges, truncated flag&quot;,&quot;getEntityNeighborhood with depth, perHopCap, totalCap&quot;,&quot;check kb:read (runs:read accepted) and graph:read&quot;,&quot;read both edge directions, highest mentionCount first&quot;,&quot;admit nodes under perHopCap and totalCap, set truncated&quot;,&quot;graph/query.ts&quot;,&quot;/api/v1/entities&quot;,&quot;service&quot;,&quot;roll up mentionCount, docIds, topRelations under the document ACL&quot;]" application="{&quot;name&quot;:&quot;eli-ai&quot;,&quot;version&quot;:&quot;0.1.0&quot;}" packages="{&quot;mermaid&quot;:&quot;11.16.0&quot;,&quot;mermaidCli&quot;:&quot;11.16.0&quot;,&quot;playwright&quot;:&quot;1.62.1&quot;,&quot;playwrightCore&quot;:&quot;1.62.1&quot;,&quot;puppeteer&quot;:&quot;25.6.0&quot;,&quot;puppeteerCore&quot;:&quot;25.6.0&quot;}" environment="{&quot;architecture&quot;:&quot;x64&quot;,&quot;containerImage&quot;:&quot;playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109&quot;,&quot;node&quot;:&quot;v26.3.1&quot;,&quot;platform&quot;:&quot;linux&quot;,&quot;yarn&quot;:&quot;4.17.1&quot;}" renderer="{&quot;browser&quot;:{&quot;executableSha256&quot;:&quot;0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71&quot;,&quot;name&quot;:&quot;chromium&quot;,&quot;revision&quot;:&quot;1234&quot;,&quot;version&quot;:&quot;151.0.7922.34&quot;},&quot;font&quot;:{&quot;family&quot;:&quot;Eli Diagram Inter Variable&quot;,&quot;fileSha256&quot;:&quot;3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62&quot;,&quot;licenseSha256&quot;:&quot;3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345&quot;},&quot;mermaidConfigSha256&quot;:&quot;68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101&quot;,&quot;themeCssSha256&quot;:&quot;c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033&quot;}" adapterVersions="{&quot;diagramGenerator&quot;:&quot;2&quot;,&quot;drawioFlowchart&quot;:&quot;1&quot;,&quot;drawioGantt&quot;:&quot;1&quot;,&quot;drawioSequence&quot;:&quot;1&quot;,&quot;drawioState&quot;:&quot;1&quot;}" mermaidType="sequence" generatedAt="2026-08-17T18:31:08.402Z" mermaidSource="sequenceDiagram&#10;  autonumber&#10;  participant CALLER as API consumer (SDK or curl)&#10;  participant ROUTE as GET /api/v1/entities/:id/neighborhood (API)&#10;  participant GUARD as requireApiKey + content ACL (service)&#10;  participant QUERY as graph/query.ts (service)&#10;  participant CANON as canonical_relations (store)&#10;  participant ENT as entities + entity_aliases (store)&#10;  participant PROV as mentions + documents (store)&#10;&#10;  CALLER-&gt;&gt;ROUTE: getEntityNeighborhood with depth, perHopCap, totalCap&#10;  ROUTE-&gt;&gt;GUARD: check kb:read (runs:read accepted) and graph:read&#10;  GUARD--&gt;&gt;ROUTE: workspace plus content-ACL context&#10;  ROUTE-&gt;&gt;QUERY: entityCard resolves the seed&#10;  QUERY-&gt;&gt;ENT: canonicalize a merged id to its head&#10;  ROUTE-&gt;&gt;QUERY: expandFrontier from the canonical seed&#10;  loop Each hop up to depth&#10;    QUERY-&gt;&gt;CANON: read both edge directions, highest mentionCount first&#10;    QUERY-&gt;&gt;QUERY: admit nodes under perHopCap and totalCap, set truncated&#10;  end&#10;  QUERY-&gt;&gt;ENT: hydrate full cards for every reached node&#10;  QUERY-&gt;&gt;PROV: roll up mentionCount, docIds, topRelations under the document ACL&#10;  QUERY--&gt;&gt;ROUTE: nodes, edges, truncated flag&#10;  ROUTE--&gt;&gt;CALLER: 200 neighborhood payload">
          <mxCell parent="0"/>
        </object>
        <object id="c:i10" label="loop [Each hop up to depth]" mermaidId="i10" mermaidShape="frame">
          <mxCell parent="1" vertex="1" style="collapsible=0;container=1;dashed=1;fillColor=none;fontColor=#333333;html=1;recursiveResize=0;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1150" y="375" width="715.5" height="205" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:PROV" label="mentions + documents (store)" mermaidId="PROV" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2313" y="0" width="248" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ENT" label="entities + entity_aliases (store)" mermaidId="ENT" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2014" y="0" width="249" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CANON" label="canonical_relations (store)" mermaidId="CANON" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1745" y="0" width="219" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:QUERY" label="graph/query.ts (service)" mermaidId="QUERY" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1279" y="0" width="203" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:GUARD" label="requireApiKey + content ACL (service)" mermaidId="GUARD" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="919" y="0" width="310" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ROUTE" label="GET /api/v1/entities/:id/neighborhood (API)" mermaidId="ROUTE" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="441" y="0" width="344" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CALLER" label="API consumer (SDK or curl)" mermaidId="CALLER" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="0" y="0" width="228" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:lifeline:PROV" label="" mermaidId="lifeline:PROV" mermaidKind="lifeline">
          <mxCell parent="1" source="n:PROV" target="n:PROV" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2437" y="65" as="sourcePoint"/>
              <mxPoint x="2437" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ENT" label="" mermaidId="lifeline:ENT" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ENT" target="n:ENT" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2138.5" y="65" as="sourcePoint"/>
              <mxPoint x="2138.5" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CANON" label="" mermaidId="lifeline:CANON" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CANON" target="n:CANON" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1854.5" y="65" as="sourcePoint"/>
              <mxPoint x="1854.5" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:QUERY" label="" mermaidId="lifeline:QUERY" mermaidKind="lifeline">
          <mxCell parent="1" source="n:QUERY" target="n:QUERY" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1380.5" y="65" as="sourcePoint"/>
              <mxPoint x="1380.5" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:GUARD" label="" mermaidId="lifeline:GUARD" mermaidKind="lifeline">
          <mxCell parent="1" source="n:GUARD" target="n:GUARD" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1074" y="65" as="sourcePoint"/>
              <mxPoint x="1074" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ROUTE" label="" mermaidId="lifeline:ROUTE" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ROUTE" target="n:ROUTE" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="613" y="65" as="sourcePoint"/>
              <mxPoint x="613" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CALLER" label="" mermaidId="lifeline:CALLER" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CALLER" target="n:CALLER" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="114" y="65" as="sourcePoint"/>
              <mxPoint x="114" y="800" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i1" label="getEntityNeighborhood with depth, perHopCap, totalCap" mermaidId="i1" mermaidKind="message">
          <mxCell parent="1" source="n:CALLER" target="n:ROUTE" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="121" y="115" as="sourcePoint"/>
              <mxPoint x="609" y="115" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i2" label="check kb:read (runs:read accepted) and graph:read" mermaidId="i2" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:GUARD" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="620" y="165" as="sourcePoint"/>
              <mxPoint x="1070" y="165" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i3" label="workspace plus content-ACL context" mermaidId="i3" mermaidKind="message">
          <mxCell parent="1" source="n:GUARD" target="n:ROUTE" edge="1" style="dashed=1;dashPattern=3  3;edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1079" y="215" as="sourcePoint"/>
              <mxPoint x="617" y="215" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i4" label="entityCard resolves the seed" mermaidId="i4" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:QUERY" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="620" y="265" as="sourcePoint"/>
              <mxPoint x="1376.5" y="265" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i5" label="canonicalize a merged id to its head" mermaidId="i5" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:ENT" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1387.5" y="315" as="sourcePoint"/>
              <mxPoint x="2134.5" y="315" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i6" label="expandFrontier from the canonical seed" mermaidId="i6" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:QUERY" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="620" y="365" as="sourcePoint"/>
              <mxPoint x="1376.5" y="365" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i8" label="read both edge directions, highest mentionCount first" mermaidId="i8" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:CANON" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1387.5" y="460" as="sourcePoint"/>
              <mxPoint x="1850.5" y="460" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i9" label="admit nodes under perHopCap and totalCap, set truncated" mermaidId="i9" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:QUERY" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1381.5" y="510" as="sourcePoint"/>
              <mxPoint x="1381.5" y="530" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1441.5" y="500"/>
                <mxPoint x="1441.5" y="540"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i11" label="hydrate full cards for every reached node" mermaidId="i11" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:ENT" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1387.5" y="630" as="sourcePoint"/>
              <mxPoint x="2134.5" y="630" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i12" label="roll up mentionCount, docIds, topRelations under the document ACL" mermaidId="i12" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:PROV" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1387.5" y="680" as="sourcePoint"/>
              <mxPoint x="2433" y="680" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i13" label="nodes, edges, truncated flag" mermaidId="i13" mermaidKind="message">
          <mxCell parent="1" source="n:QUERY" target="n:ROUTE" edge="1" style="dashed=1;dashPattern=3  3;edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1385.5" y="730" as="sourcePoint"/>
              <mxPoint x="617" y="730" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i14" label="200 neighborhood payload" mermaidId="i14" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:CALLER" edge="1" style="dashed=1;dashPattern=3  3;edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="618" y="780" as="sourcePoint"/>
              <mxPoint x="118" y="780" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
