Message Workflow

The production message lifecycle, animated — a Telegram or Discord message in, through the factory-hub's 10-stage middleware over NATS JetStream, back out as a streamed reply. Hover any node to isolate its edges; pick a use case to watch the round-trip step by step.

Production message lifecycle — source-verified @ staging · hub-spoke · NATS JetStream · Python 3.12 · asyncio · Podman Quadlet

M₁ · roxabituwer
192.168.1.16 · RTX 3080 · 24/7
roles: factory-hub · voice-worker
M₂ · roxabitower
192.168.1.14 · RTX 5070 Ti · on-demand
roles: llm-worker · image-worker
flux: message NATS conditional store/context
message conditional store
use case: ① text message ② voice STT ③ persist turn
factory.network — M₁ hub · M₂ GPU on-demand · tailnet
Adapters · M₁
factory-hub · 10-stage middleware
Workers / Services · M₁
M₂ · GPU on-demand
Stores · Infra
Message Planes

① NATS Message

factory.inbound.* · factory.outbound.* · JetStream

Telegram/Discord → NATS inbound → factory-hub (10-stage middleware: trace→trust-resolve→binding→pool→dispatch) → clipool (spawn/resume claude CLI) → outbound subject → adapter → Bot API.
Turns persisted via factory-turn-writer (JetStream durable consumer).

② Conditional

dashed edges · opt-in services

if audio: hub → voice-stt → transcript inline.
if TTS: hub → voice-tts → audio blob → adapter.
if backend=llm: hub → llm-worker M₂ (GPU Qwen3).
if image tool: hub → image-worker M₂ (FLUX/SD3.5).
gh-helper: mint_failure → hub.

③ Context / Stores

dotted ghost reads · session resume

hub reads auth.db (trust), config.db (agent registry), roxabi-vault (L3 semantic).
clipool reads turns.db for session resume.
Adapters watch NATS KV factory-state (hub.ready).
turn-writer = sole writer → turns.db.
Source of truth: ~/projects/roxabi-factory · hosts.toml · deploy/quadlet.toml · *.container · docs/architecture/
Generated 2026-06-04 · hover = edge isolation · use cases animated · source-verified @ staging.