docs(presentation): simplify system architecture diagram

This commit is contained in:
amirhosein mazaheri
2026-10-14 15:20:13 +03:30
parent 5337031d80
commit 7017024d3b
4 changed files with 64 additions and 118 deletions
+9 -18
View File
@@ -1,18 +1,9 @@
flowchart LR flowchart TB
U[User / Admin] --> UI[Angular frontend] UI[Angular frontend: uploads + voice] <-->|REST / browser WebSocket| API[FastAPI: auth + lifecycle + VoiceRuntime + SearchService]
UI -->|REST + session cookie + CSRF| API[FastAPI API] API <-->|Provider WebSocket| OAI[OpenAI Realtime]
UI <-->|WebSocket: PCM + JSON events| API API <-->|State + eligible retrieval| DB[(PostgreSQL + pgvector)]
API --> AUTH[Authentication / role / organization] W[Independent ingestion worker] <-->|Claim / lease / publication| DB
API -->|Upload: independent document + job| DB[(PostgreSQL + pgvector)] W <-->|Originals / extraction artifacts| FS[(Immutable file storage)]
API --> FS[(Immutable originals / extraction artifacts)] W <-->|Vision transcription| V[OpenRouter / Gemini Flash]
W[Separate ingestion worker] -->|Claim job + lease + heartbeat| DB API -->|Query vector| E[Local Ollama / bge-m3]
W -->|Read original / retain extraction| FS W -.->|Document vectors; shared embedding service| E
W --> OCR[OpenRouter vision / Gemini Flash]
W --> EMB[Local Ollama / bge-m3]
W -->|Atomic chunks + vectors publication| DB
API --> RT[OpenAI Realtime adapter]
RT <-->|Provider WebSocket| OAI[OpenAI gpt-realtime-2.1 / Marin]
RT -->|Validated tools| SEARCH[Shared backend SearchService]
SEARCH --> EMB
SEARCH -->|Eligible document chunks| DB
API -->|Selection / revision invalidation| DB
Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 103 KiB

+55 -100
View File
@@ -1,102 +1,57 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1000" viewBox="0 0 1600 1000" role="img"> <svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1000" viewBox="0 0 1600 1000" role="img">
<title>System architecture</title> <title>System architecture</title><desc>Frontend, API, independent ingestion worker, providers and persistent storage. Principal connections only.</desc>
<desc>Deployed application boundaries and shared storage</desc> <defs><marker id="a" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto-start-reverse"><path d="M0,0 L8,4 L0,8" fill="#64748b"/></marker></defs>
<defs><marker id="arrow" markerWidth="9" markerHeight="9" refX="8" refY="4.5" orient="auto"><path d="M0,0 L9,4.5 L0,9" fill="#64748b"/></marker></defs> <rect width="1600" height="1000" fill="white"/>
<rect width="1600" height="1000" fill="#ffffff"/> <style>text{font-family:Segoe UI,Arial,sans-serif}.title{font-size:38px;font-weight:700;fill:#0f172a}.sub{font-size:20px;fill:#475569}.head{font-size:24px;font-weight:650;fill:#0f172a}.body{font-size:19px;fill:#475569}.label{font-size:16px;fill:#475569}</style>
<style>text{font-family:Segoe UI,Arial,sans-serif}.title{font-size:38px;font-weight:700;fill:#0f172a}.sub{font-size:21px;fill:#475569}.node{font-size:21px;font-weight:650;fill:#0f172a}.detail{font-size:17px;fill:#475569}.edge{font-size:14px;fill:#475569}</style> <text x="80" y="65" class="title">System architecture</text>
<text x="75" y="75" class="title">System architecture</text> <text x="80" y="105" class="sub">One API, one ingestion worker, shared knowledge storage</text>
<text x="75" y="115" class="sub">Deployed application boundaries and shared storage</text> <rect x="600" y="345" width="400" height="550" rx="24" fill="#f8fafc"/>
<path d="M395,262.5 L450,262.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M800,270 L800,365" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<text x="825" y="315" class="label">REST / WebSocket</text>
<path d="M770,262.5 L825,262.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M980,435 L1160,435" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<text x="1015" y="415" class="label">Provider WS</text>
<path d="M1145,262.5 L1200,262.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M800,515 L800,735" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<text x="825" y="610" class="label">State + retrieval</text>
<path d="M610.0,335 L610.0,435" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M430,435 L520,435 L520,805 L620,805" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<text x="455" y="550" class="label">Claim / publish</text>
<path d="M610.0,335 L610.0,385.0 L235.0,385.0 L235.0,435" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M255,515 L255,555" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<path d="M80,435 L40,435 L40,805 L80,805" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<path d="M596.0,580 L596.0,680" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <path d="M980,485 L1070,485 L1070,805 L1160,805" fill="none" stroke="#94a3b8" stroke-width="2.4" marker-end="url(#a)" marker-start="url(#a)"/>
<text x="1090" y="640" class="label">Query vector</text>
<path d="M610.0,680 L610.0,618 L235.0,618 L235.0,580" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <rect x="620" y="155" width="360" height="115" rx="16" fill="#e8f0fe" stroke="#2563eb" stroke-width="2"/>
<text x="642" y="193" class="head">Angular frontend</text>
<path d="M770,752.5 L825,752.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <text x="642" y="226" class="body">Admin uploads / user voice</text>
<text x="642" y="253" class="body">REST + browser WebSocket</text>
<path d="M610.0,680 L610.0,644 L1360.0,644 L1360.0,580" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <rect x="620" y="365" width="360" height="150" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="2"/>
<text x="642" y="403" class="head">FastAPI API</text>
<path d="M624.0,680 L624.0,580" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <text x="642" y="436" class="body">Auth + session lifecycle</text>
<text x="642" y="463" class="body">VoiceRuntime + SearchService</text>
<path d="M985.0,335 L985.0,435" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <text x="642" y="490" class="body">Trusted tools and audio relay</text>
<rect x="80" y="365" width="350" height="150" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="2"/>
<path d="M825,507.5 L770,507.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <text x="102" y="403" class="head">Ingestion worker</text>
<text x="102" y="436" class="body">Claim + lease + heartbeat</text>
<path d="M1145,507.5 L1200,507.5" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <text x="102" y="463" class="body">Extract / chunk / embed</text>
<text x="102" y="490" class="body">Atomic fenced publication</text>
<path d="M235.0,680 L235.0,605 L610.0,605 L610.0,580" fill="none" stroke="#94a3b8" stroke-width="2.2" marker-end="url(#arrow)"/> <rect x="1160" y="365" width="350" height="150" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="2"/>
<text x="1182" y="403" class="head">OpenAI Realtime</text>
<rect x="75" y="190" width="320" height="145" rx="16" fill="#e8f0fe" stroke="#2563eb" stroke-width="1.8"/> <text x="1182" y="436" class="body">gpt-realtime-2.1 / Marin</text>
<rect x="75" y="212" width="5" height="101" rx="2" fill="#2563eb"/> <text x="1182" y="463" class="body">Audio + transcripts + tool calls</text>
<text x="95" y="230" class="node">Browser / Angular</text> <rect x="80" y="555" width="350" height="110" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="2"/>
<text x="95" y="268" class="detail">Admin uploads; user voice</text> <text x="102" y="593" class="head">Vision extraction</text>
<text x="95" y="298" class="detail">REST and browser WebSocket</text> <text x="102" y="626" class="body">OpenRouter / Gemini Flash</text>
<rect x="450" y="190" width="320" height="145" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="1.8"/> <text x="102" y="653" class="body">Images and affected PDF pages</text>
<rect x="450" y="212" width="5" height="101" rx="2" fill="#0f766e"/> <rect x="620" y="735" width="360" height="140" rx="16" fill="#f2eaff" stroke="#7c3aed" stroke-width="2"/>
<text x="470" y="230" class="node">FastAPI API</text> <text x="642" y="773" class="head">PostgreSQL + pgvector</text>
<text x="470" y="268" class="detail">Auth, lifecycle, selection</text> <text x="642" y="806" class="body">Jobs / documents / chunks</text>
<text x="470" y="298" class="detail">Server-derived organization</text> <text x="642" y="833" class="body">Vectors / sessions / tool results</text>
<rect x="825" y="190" width="320" height="145" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="1.8"/> <rect x="80" y="735" width="350" height="140" rx="16" fill="#f2eaff" stroke="#7c3aed" stroke-width="2"/>
<rect x="825" y="212" width="5" height="101" rx="2" fill="#0f766e"/> <text x="102" y="773" class="head">Immutable file storage</text>
<text x="845" y="230" class="node">VoiceRuntime + adapter</text> <text x="102" y="806" class="body">Originals + extraction artifacts</text>
<text x="845" y="268" class="detail">Audio relay and trusted tools</text> <text x="102" y="833" class="body">SHA256 and source provenance</text>
<text x="845" y="298" class="detail">OpenAI Realtime protocol</text> <rect x="1160" y="735" width="350" height="140" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="2"/>
<rect x="1200" y="190" width="320" height="145" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="1.8"/> <text x="1182" y="773" class="head">Local embeddings</text>
<rect x="1200" y="212" width="5" height="101" rx="2" fill="#c56a08"/> <text x="1182" y="806" class="body">Ollama / bge-m3</text>
<text x="1220" y="230" class="node">OpenAI Realtime</text> <text x="1182" y="833" class="body">Shared by API and worker</text>
<text x="1220" y="268" class="detail">gpt-realtime-2.1 / Marin</text> <text x="80" y="930" class="sub">Voice: browser → API → OpenAI. Ingestion: worker → extraction → embeddings → atomic publication.</text>
<text x="1220" y="298" class="detail">Audio, transcripts, tool calls</text> <text x="80" y="963" class="label">Principal connections only. Detailed job, evidence, activation and interruption flows are shown in the other three diagrams.</text>
<rect x="75" y="435" width="320" height="145" rx="16" fill="#f2eaff" stroke="#7c3aed" stroke-width="1.8"/>
<rect x="75" y="457" width="5" height="101" rx="2" fill="#7c3aed"/>
<text x="95" y="475" class="node">Immutable file storage</text>
<text x="95" y="513" class="detail">Originals and extraction artifacts</text>
<text x="95" y="543" class="detail">Checksums and frozen profiles</text>
<rect x="450" y="435" width="320" height="145" rx="16" fill="#f2eaff" stroke="#7c3aed" stroke-width="1.8"/>
<rect x="450" y="457" width="5" height="101" rx="2" fill="#7c3aed"/>
<text x="470" y="475" class="node">PostgreSQL + pgvector</text>
<text x="470" y="513" class="detail">Documents, jobs, chunks, sessions</text>
<text x="470" y="543" class="detail">Evidence and audit records</text>
<rect x="825" y="435" width="320" height="145" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="1.8"/>
<rect x="825" y="457" width="5" height="101" rx="2" fill="#0f766e"/>
<text x="845" y="475" class="node">Backend SearchService</text>
<text x="845" y="513" class="detail">Shared bounded retrieval</text>
<text x="845" y="543" class="detail">Eligibility and revision checks</text>
<rect x="1200" y="435" width="320" height="145" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="1.8"/>
<rect x="1200" y="457" width="5" height="101" rx="2" fill="#c56a08"/>
<text x="1220" y="475" class="node">Local embedding service</text>
<text x="1220" y="513" class="detail">Ollama / bge-m3</text>
<text x="1220" y="543" class="detail">Document and query vectors</text>
<rect x="75" y="680" width="320" height="145" rx="16" fill="#e8f0fe" stroke="#2563eb" stroke-width="1.8"/>
<rect x="75" y="702" width="5" height="101" rx="2" fill="#2563eb"/>
<text x="95" y="720" class="node">Admin knowledge selection</text>
<text x="95" y="758" class="detail">Ready is not yet searchable</text>
<text x="95" y="788" class="detail">Explicit active selection</text>
<rect x="450" y="680" width="320" height="145" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="1.8"/>
<rect x="450" y="702" width="5" height="101" rx="2" fill="#0f766e"/>
<text x="470" y="720" class="node">Separate ingestion worker</text>
<text x="470" y="758" class="detail">Claim, extract, chunk, embed</text>
<text x="470" y="788" class="detail">Lease-fenced atomic publication</text>
<rect x="825" y="680" width="320" height="145" rx="16" fill="#fff2dd" stroke="#c56a08" stroke-width="1.8"/>
<rect x="825" y="702" width="5" height="101" rx="2" fill="#c56a08"/>
<text x="845" y="720" class="node">Vision extraction adapter</text>
<text x="845" y="758" class="detail">OpenRouter / Gemini 2.5 Flash</text>
<text x="845" y="788" class="detail">Affected PDF pages and images</text>
<rect x="1200" y="680" width="320" height="145" rx="16" fill="#e6f7f2" stroke="#0f766e" stroke-width="1.8"/>
<rect x="1200" y="702" width="5" height="101" rx="2" fill="#0f766e"/>
<text x="1220" y="720" class="node">Operational control</text>
<text x="1220" y="758" class="detail">Health, structured diagnostics</text>
<text x="1220" y="788" class="detail">Original API retained for rollback</text>
<text x="75" y="890" class="detail">Scope: current voice MVP. Full text chat/history and production multi-API recovery are not presented as complete.</text>
<circle cx="83" cy="962" r="7" fill="#2563eb"/><text x="100" y="968" class="detail">Frontend / admin</text>
<circle cx="458" cy="962" r="7" fill="#0f766e"/><text x="475" y="968" class="detail">Backend logic</text>
<circle cx="833" cy="962" r="7" fill="#7c3aed"/><text x="850" y="968" class="detail">Persistent state</text>
<circle cx="1208" cy="962" r="7" fill="#c56a08"/><text x="1225" y="968" class="detail">AI / embedding provider</text>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.