<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 880 680" xmlns="http://www.w3.org/2000/svg" style="max-width: 100%; height: auto;">
  <defs>
    <!-- Arrow markers -->
    <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="#2563EB">
    </marker>

    <!-- Drop shadow for depth -->
    <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="2">
      <feOffset dx="1" dy="1" result="offsetblur">
      <feComponentTransfer>
        <feFuncA type="linear" slope="0.2">
      </feComponentTransfer>
      <feMerge>
        <feMergeNode/>
        <feMergeNode in="SourceGraphic">
      </feMerge>
    </filter>
  </defs>



  <!-- Beautiful gradient definitions for depth -->
  

  <!-- White background with subtle border -->
  <rect x="0" y="0" width="880" height="680" fill="#F9FAFB" stroke="#9CA3AF" stroke-width="2" rx="8">

  <!-- Content container with proper margins -->
  <g transform="translate(40, 40)">
  <!-- Define gradients and filters -->
  

  <!-- Background -->
  <rect x="0" y="0" width="800" height="600" fill="#1F2937" rx="8" filter="url(#shadow)">

  <!-- Title -->
  <text x="400" y="30" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="24" font-weight="600" fill="#4B5563">
    Knowledge Base Architecture Pipeline
  </text>

  <!-- Document Ingestion Layer -->
  <rect x="100" y="60" width="600" height="60" fill="url(#inputGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="85" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Document Ingestion Layer
  </text>
  <text x="400" y="105" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    PDF • Word • Excel • Text • HTML • Markdown
  </text>

  <!-- Arrow -->
  <path d="M 400 120 L 400 140" stroke="#2563EB" stroke-width="3" fill="none" marker-end="url(#arrowhead)" opacity="0.6">

  <!-- Preprocessing Pipeline -->
  <rect x="100" y="140" width="600" height="60" fill="url(#processGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="165" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Preprocessing Pipeline
  </text>
  <text x="400" y="185" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Extraction • Cleaning • Normalization • Validation
  </text>

  <!-- Arrow -->
  <path d="M 400 200 L 400 220" stroke="#2563EB" stroke-width="3" fill="none" marker-end="url(#arrowhead)" opacity="0.6">

  <!-- Chunking Engine -->
  <rect x="100" y="220" width="600" height="60" fill="url(#processGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="245" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Intelligent Chunking Engine
  </text>
  <text x="400" y="265" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Semantic Segmentation • Overlap Management • Metadata Preservation
  </text>

  <!-- Arrow -->
  <path d="M 400 280 L 400 300" stroke="#2563EB" stroke-width="3" fill="none" marker-end="url(#arrowhead)" opacity="0.6">

  <!-- Embedding Generation -->
  <rect x="100" y="300" width="600" height="60" fill="url(#embedGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="325" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Embedding Generation
  </text>
  <text x="400" y="345" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    BGE Models • Transformer Architecture • Dimensionality: 384/768
  </text>

  <!-- Arrow -->
  <path d="M 400 360 L 400 380" stroke="#2563EB" stroke-width="3" fill="none" marker-end="url(#arrowhead)" opacity="0.6">

  <!-- Vector Index Layer -->
  <rect x="100" y="380" width="600" height="60" fill="url(#indexGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="405" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Vector Index Layer
  </text>
  <text x="400" y="425" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    HNSW Algorithm • Quantization • Distributed Sharding
  </text>

  <!-- Arrow -->
  <path d="M 400 440 L 400 460" stroke="#2563EB" stroke-width="3" fill="none" marker-end="url(#arrowhead)" opacity="0.6">

  <!-- Retrieval Engine -->
  <rect x="100" y="460" width="600" height="60" fill="url(#retrievalGrad)" stroke="#2563EB" stroke-width="2" rx="8" filter="url(#shadow)">
  <text x="400" y="485" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="16" font-weight="600" fill="#4B5563">
    Semantic Retrieval Engine
  </text>
  <text x="400" y="505" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563">
    Cosine Similarity • Hybrid Search • Re-ranking • Context Injection
  </text>

  <!-- Side labels -->
  <g transform="translate(50, 290)">
    <text x="0" y="0" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" transform="rotate(-90)">
      Data Flow Direction
    </text>
  </g>

  <!-- Stage indicators on the right -->
  <text x="730" y="95" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Raw Docs</text>
  <text x="730" y="175" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Clean Text</text>
  <text x="730" y="255" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Chunks</text>
  <text x="730" y="335" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Vectors</text>
  <text x="730" y="415" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Index</text>
  <text x="730" y="495" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" filter="url(#textShadow)">Results</text>

  <!-- Performance metrics -->
  <rect x="100" y="540" width="600" height="40" fill="#4B5563" stroke="#2563EB" stroke-width="2" stroke-dasharray="5,5" rx="4" filter="url(#shadow)">
  <text x="400" y="565" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="#4B5563" font-style="italic">
    Pipeline processes ~1000 documents/minute • Query latency &lt;50ms (p99) • 95% semantic accuracy
  </text>


  </g>

</svg>