<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="retrieval-and-grounded-generation-0c2d5983" name="Retrieval and grounded generation">
    <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="Retrieval and grounded generation" schemaVersion="1" diagramId="retrieval-and-grounded-generation-0c2d5983" canonicalAppearanceKey="tsx:src/app/(docs)/docs/architecture/page.tsx:RETRIEVAL_CHART#1" sourceSha256="0c2d598391dbbb05557c4e32c1f7143c349dbc9a88193ab022041c4097e64fd5" metadataPayloadSha256="dba0807943492bed88bf04609f8cbfd8cd0984edbc6ea4c23e3ecbd3fb48d04a" generationKey="8d96332940e1126b6c4d3fa1a8658c432be4aadeaed846e9d880d9b9cae0bfe7" concepts="[&quot;Public overview diagrams&quot;,&quot;Retrieval and grounded generation&quot;,&quot;Retrieval&quot;]" keywords="[&quot;query understanding&quot;,&quot;rewrite + constraints&quot;,&quot;FTS channel&quot;,&quot;reciprocal-rank fusion&quot;,&quot;graph expansion&quot;,&quot;optional rerank&quot;,&quot;answer policy&quot;,&quot;answer / caveat&quot;,&quot;clarify / abstain&quot;,&quot;question + actor principals&quot;,&quot;retrieve() with ACL predicates&quot;,&quot;vector channel (pgvector)&quot;,&quot;from visible seed concepts&quot;,&quot;grounded generation + citations&quot;,&quot;clarification or pointers&quot;,&quot;groundedness + conflict checks&quot;,&quot;Sn&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="flowchart" direction="LR" generatedAt="2026-08-12T23:41:19.419Z" mermaidSource="flowchart LR&#10;  Qy[&quot;question + actor principals&quot;] --&gt; QU[&quot;query understanding&lt;br/&gt;rewrite + constraints&quot;]&#10;  QU --&gt; R[&quot;retrieve() with ACL predicates&quot;]&#10;  R --&gt; FTSc[&quot;FTS channel (BM25-ish)&quot;]&#10;  R --&gt; Vec[&quot;vector channel (pgvector)&quot;]&#10;  FTSc --&gt; Fuse[&quot;reciprocal-rank fusion&quot;]&#10;  Vec --&gt; Fuse&#10;  Fuse --&gt; Graph[&quot;graph expansion&lt;br/&gt;from visible seed concepts&quot;]&#10;  Graph --&gt; Rank[&quot;optional rerank&quot;]&#10;  Rank --&gt; Ctx[&quot;context assembly&lt;br/&gt;[Sn] sources · dedup · token budget&quot;]&#10;  Ctx --&gt; Policy{&quot;answer policy&quot;}&#10;  Policy --&gt;|answer / caveat| Gen[&quot;grounded generation + citations&quot;]&#10;  Policy --&gt;|clarify / abstain| Stop[&quot;clarification or pointers&quot;]&#10;  Gen --&gt; Badge[&quot;groundedness + conflict checks&quot;]">
          <mxCell parent="0"/>
        </object>
        <object id="n:Qy" label="question + actor principals" mermaidId="Qy" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="8" y="65" width="256" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:QU" label="query understandingrewrite + constraints" mermaidId="QU" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="314" y="65" width="213.546875" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:R" label="retrieve() with ACL predicates" mermaidId="R" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="577.546875" y="65" width="256" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:FTSc" label="FTS channel (BM25-ish)" mermaidId="FTSc" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="889.523438" y="26" width="239.71875" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Vec" label="vector channel (pgvector)" mermaidId="Vec" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="883.546875" y="128" width="251.671875" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Fuse" label="reciprocal-rank fusion" mermaidId="Fuse" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1185.21875" y="77" width="223.265625" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Graph" label="graph expansionfrom visible seed concepts" mermaidId="Graph" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1458.484375" y="53" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Rank" label="optional rerank" mermaidId="Rank" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1764.484375" y="77" width="169.234375" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Ctx" label="context assembly[Sn] sources · dedup · token budget" mermaidId="Ctx" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1983.71875" y="53" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Policy" label="answer policy" mermaidId="Policy" mermaidShape="diamond">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;perimeter=rhombusPerimeter;shape=rhombus;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2290.21875" y="24.75" width="156.5" height="156.5" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Gen" label="grounded generation + citations" mermaidId="Gen" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2616.453125" y="8" width="256" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Stop" label="clarification or pointers" mermaidId="Stop" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2629.203125" y="134" width="230.5" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Badge" label="groundedness + conflict checks" mermaidId="Badge" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2922.453125" y="8" width="256" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:L_Qy_QU_0" label="" mermaidId="L_Qy_QU_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Qy" target="n:QU" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="264" y="103" as="sourcePoint"/>
              <mxPoint x="314" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="289" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_QU_R_0" label="" mermaidId="L_QU_R_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:QU" target="n:R" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="527.546875" y="103" as="sourcePoint"/>
              <mxPoint x="577.546875" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="552.546875" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_R_FTSc_0" label="" mermaidId="L_R_FTSc_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:R" target="n:FTSc" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="819.546875" y="65" as="sourcePoint"/>
              <mxPoint x="889.523438" y="52" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="858.546875" y="52"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_R_Vec_0" label="" mermaidId="L_R_Vec_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:R" target="n:Vec" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="819.546875" y="141" as="sourcePoint"/>
              <mxPoint x="883.546875" y="154" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="858.546875" y="154"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_FTSc_Fuse_0" label="" mermaidId="L_FTSc_Fuse_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:FTSc" target="n:Fuse" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1129.242188" y="52" as="sourcePoint"/>
              <mxPoint x="1227.195619" y="77" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1160.21875" y="52"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Vec_Fuse_0" label="" mermaidId="L_Vec_Fuse_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Vec" target="n:Fuse" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1135.21875" y="154" as="sourcePoint"/>
              <mxPoint x="1227.195619" y="129" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1160.21875" y="154"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Fuse_Graph_0" label="" mermaidId="L_Fuse_Graph_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Fuse" target="n:Graph" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1408.484375" y="103" as="sourcePoint"/>
              <mxPoint x="1458.484375" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1433.484375" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Graph_Rank_0" label="" mermaidId="L_Graph_Rank_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Graph" target="n:Rank" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1714.484375" y="103" as="sourcePoint"/>
              <mxPoint x="1764.484375" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1739.484375" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Rank_Ctx_0" label="" mermaidId="L_Rank_Ctx_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Rank" target="n:Ctx" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1933.71875" y="103" as="sourcePoint"/>
              <mxPoint x="1983.71875" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1958.71875" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Ctx_Policy_0" label="" mermaidId="L_Ctx_Policy_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Ctx" target="n:Policy" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2239.71875" y="103" as="sourcePoint"/>
              <mxPoint x="2289.71875" y="103" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="2264.71875" y="103"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Policy_Gen_0" label="answer / caveat" mermaidId="L_Policy_Gen_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Policy" target="n:Gen" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2425.978668" y="82.759918" as="sourcePoint"/>
              <mxPoint x="2616.453125" y="46" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="2531.335938" y="46"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Policy_Stop_0" label="clarify / abstain" mermaidId="L_Policy_Stop_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Policy" target="n:Stop" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2425.978668" y="123.240082" as="sourcePoint"/>
              <mxPoint x="2629.203125" y="160" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="2531.335938" y="160"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Gen_Badge_0" label="" mermaidId="L_Gen_Badge_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Gen" target="n:Badge" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2872.453125" y="46" as="sourcePoint"/>
              <mxPoint x="2922.453125" y="46" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="2897.453125" y="46"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
