

```mermaid
---
config:
  layout: elk
  theme: base
  look: classic
---
flowchart TB
 subgraph s1["Artiklid vektoriteks"]
        PDF["PDF kujul teadusartiklid"]
        EKSTRAKT["Teksti ekstraktimine:<br> - markdown"]
        MARKER["Marker PDF"]
        OSAD["Tekst osadeks:<br> osa suurus ca 1500, ülekate 300"]
        CHUNKS["Loob embeddingud"]
        VB["Salvestamine vektorbaasi"]
  end
 subgraph Vektorbaas["Vektorbaas"]
        WEAVIATE["Weaviate"]
        QUADRANT["Quadrant"]
        PGVECTOR["PostgreSQL"]
  end
 subgraph s2["Küsimused"]
        QUESTION["Küsimus"]
        QCHUNK["Loob embeddingu"]
        REQ["Päring vektorbaasisty"]
  end
 subgraph Vastused["Vastused"]
        ANSW["Baasi vastused"]
        LLM["LLM"]
        LLMANSW["Vastus"]
  end
    PDF --> EKSTRAKT
    EKSTRAKT --> MARKER
    MARKER --> OSAD
    OSAD --> CHUNKS
    CHUNKS --> VB
    VB --> WEAVIATE & QUADRANT & PGVECTOR
    QUADRANT & WEAVIATE --> PGVECTOR
    QUESTION --> QCHUNK
    QCHUNK --> REQ
    REQ --> WEAVIATE & QUADRANT & PGVECTOR
    WEAVIATE --> ANSW
    QUADRANT --> ANSW
    PGVECTOR --> ANSW
    ANSW --> LLM
    LLM --> LLMANSW
    ST["Sentence transformer"] --> CHUNKS & QCHUNK
```
