Fixed flow diagram
This commit is contained in:
@@ -111,35 +111,35 @@ Configure via environment variables.
|
|||||||
└────────────────┬────────────────────────────────────┘
|
└────────────────┬────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
┌────────────────▼────────────────────────────────────┐
|
┌────────────────▼────────────────────────────────────┐
|
||||||
│ SearXNG + Plugin │
|
│ SearXNG + Plugin │
|
||||||
│ │
|
│ │
|
||||||
│ post_search() │
|
│ post_search() │
|
||||||
│ → _enrich_results() ← ThreadPoolExecutor │
|
│ → _enrich_results() ← ThreadPoolExecutor │
|
||||||
│ → _fetch_page_text() × 5 parallel │
|
│ → _fetch_page_text() × 5 parallel │
|
||||||
│ → _chunk_text() + _tfidf_score() │
|
│ → _chunk_text() + _tfidf_score() │
|
||||||
│ → rerank by score │
|
│ → rerank by score │
|
||||||
│ → _assemble_context() │
|
│ → _assemble_context() │
|
||||||
│ → inject AI Overview HTML + JS │
|
│ → inject AI Overview HTML + JS │
|
||||||
│ │
|
│ │
|
||||||
│ /ai-stream │
|
│ /ai-stream │
|
||||||
│ → validate token │
|
│ → validate token │
|
||||||
│ → _detect_intent() → select system prompt │
|
│ → _detect_intent() → select system prompt │
|
||||||
│ → _load_conversation() from Valkey │
|
│ → _load_conversation() from Valkey │
|
||||||
│ → launch stream_to_valkey() thread │
|
│ → launch stream_to_valkey() thread │
|
||||||
│ → return {job_id} immediately │
|
│ → return {job_id} immediately │
|
||||||
│ │
|
│ │
|
||||||
│ stream_to_valkey() [background thread] │
|
│ stream_to_valkey() [background thread] │
|
||||||
│ → Ollama stream=True │
|
│ → Ollama stream=True │
|
||||||
│ → RPUSH tokens to Valkey │
|
│ → RPUSH tokens to Valkey │
|
||||||
│ → RPUSH __DONE__ when complete │
|
│ → RPUSH __DONE__ when complete │
|
||||||
│ │
|
│ │
|
||||||
│ /ai-status/{job_id} │
|
│ /ai-status/{job_id} │
|
||||||
│ → LRANGE chunks from offset │
|
│ → LRANGE chunks from offset │
|
||||||
│ → return {chunks, done} │
|
│ → return {chunks, done} │
|
||||||
└────────────────┬────────────────────────────────────┘
|
└────────────────┬────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
┌────────────────▼────────────────────────────────────┐
|
┌────────────────▼────────────────────────────────────┐
|
||||||
│ Valkey │
|
│ Valkey │
|
||||||
│ ai:job:{id}:chunks (list, TTL 120s) │
|
│ ai:job:{id}:chunks (list, TTL 120s) │
|
||||||
│ ai:job:{id}:status (string, TTL 120s) │
|
│ ai:job:{id}:status (string, TTL 120s) │
|
||||||
│ ai:conv:{session} (JSON, TTL 1800s) │
|
│ ai:conv:{session} (JSON, TTL 1800s) │
|
||||||
|
|||||||
Reference in New Issue
Block a user