botserver/docs/src/appendix-i/assets/kb-access.svg

101 lines
5.6 KiB
XML
Raw Normal View History

2025-11-23 17:02:22 -03:00
<svg width="800" height="400" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#888"/>
</marker>
<marker id="arrow-ref" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#999"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#CBD5E0">Knowledge Base Access</text>
<!-- user_sessions -->
<rect x="50" y="80" width="200" height="120" fill="none" stroke="#FBBF24" stroke-width="2" rx="8"/>
<rect x="50" y="80" width="200" height="30" fill="none" stroke="#FBBF24" stroke-width="2" rx="8 8 0 0"/>
<text x="150" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#FCD34D">user_sessions</text>
<g font-family="monospace" font-size="11" fill="#A0AEC0">
<text x="60" y="130">• id</text>
<text x="60" y="145">• user_id</text>
<text x="60" y="160">• bot_id</text>
<text x="60" y="175">• session_token</text>
</g>
<!-- Arrow to user_kb_associations -->
<line x1="250" y1="140" x2="320" y2="140" stroke="#888" stroke-width="2" marker-end="url(#arrow)"/>
<text x="285" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#718096">Has Access</text>
<!-- user_kb_associations -->
<rect x="320" y="80" width="200" height="120" fill="none" stroke="#4FD1C5" stroke-width="2" rx="8"/>
<rect x="320" y="80" width="200" height="30" fill="none" stroke="#4FD1C5" stroke-width="2" rx="8 8 0 0"/>
<text x="420" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#81E6D9">user_kb_associations</text>
<g font-family="monospace" font-size="11" fill="#A0AEC0">
<text x="330" y="130">• id</text>
<text x="330" y="145">• session_id</text>
<text x="330" y="160">• kb_id</text>
<text x="330" y="175">• created_at</text>
</g>
<!-- Reference arrow down -->
<line x1="420" y1="200" x2="420" y2="240" stroke="#999" stroke-width="2" stroke-dasharray="5,5" marker-end="url(#arrow-ref)"/>
<text x="435" y="220" text-anchor="start" font-family="Arial, sans-serif" font-size="10" fill="#718096">References</text>
<!-- kb_collections -->
<rect x="50" y="240" width="200" height="140" fill="none" stroke="#48BB78" stroke-width="2" rx="8"/>
<rect x="50" y="240" width="200" height="30" fill="none" stroke="#48BB78" stroke-width="2" rx="8 8 0 0"/>
<text x="150" y="260" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#68D391">kb_collections</text>
<g font-family="monospace" font-size="11" fill="#A0AEC0">
<text x="60" y="290">• id</text>
<text x="60" y="305">• bot_id</text>
<text x="60" y="320">• name</text>
<text x="60" y="335">• created_at</text>
<text x="60" y="350">• metadata</text>
</g>
<!-- Arrow to kb_documents -->
<line x1="250" y1="310" x2="320" y2="310" stroke="#888" stroke-width="2" marker-end="url(#arrow)"/>
<text x="285" y="300" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#718096">Contains</text>
<text x="285" y="320" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#718096">1:N</text>
<!-- kb_documents -->
<rect x="320" y="240" width="200" height="140" fill="none" stroke="#68D391" stroke-width="2" rx="8"/>
<rect x="320" y="240" width="200" height="30" fill="none" stroke="#68D391" stroke-width="2" rx="8 8 0 0"/>
<text x="420" y="260" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#9AE6B4">kb_documents</text>
<g font-family="monospace" font-size="11" fill="#A0AEC0">
<text x="330" y="290">• id</text>
<text x="330" y="305">• collection_id</text>
<text x="330" y="320">• content</text>
<text x="330" y="335">• embeddings</text>
<text x="330" y="350">• metadata</text>
</g>
<!-- Vector indicator -->
<g id="vector-indicator" transform="translate(550, 280)">
<rect x="0" y="0" width="180" height="80" fill="none" stroke="#B794F4" stroke-width="1" rx="5" stroke-dasharray="3,3" opacity="0.7"/>
<text x="90" y="25" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#D6BCFA">Vector Storage</text>
<text x="90" y="45" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#A0AEC0">Embeddings stored</text>
<text x="90" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#A0AEC0">for semantic search</text>
</g>
<!-- Connection from kb_documents to vector indicator -->
<line x1="520" y1="335" x2="550" y2="320" stroke="#B794F4" stroke-width="1" stroke-dasharray="3,3" opacity="0.7"/>
<!-- Access flow description -->
<g id="access-flow" transform="translate(550, 100)">
<rect x="0" y="0" width="200" height="100" fill="none" stroke="#4A5568" stroke-width="1" rx="5" stroke-dasharray="2,2" opacity="0.5"/>
<text x="100" y="20" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#CBD5E0">Access Pattern</text>
<g font-family="Arial, sans-serif" font-size="10" fill="#A0AEC0">
<text x="10" y="40">1. Session requests KB</text>
<text x="10" y="55">2. Association created</text>
<text x="10" y="70">3. KB documents available</text>
<text x="10" y="85">4. Vector search enabled</text>
</g>
</g>
</svg>