123AIChat logo
123AIChat

Architecture

Reliable by design, auditable by default.

123AIChat architecture is optimized for internal reliability, deterministic delivery boundaries, and practical operational control when AI collaboration moves from pilot to production.

Runtime Layer

Rust + Axum + Tokio handles concurrent connections and keeps WebSocket task failures isolated from the core service loop.

Operational outcome: Stable messaging service even when individual client sessions fail.

Data Layer

Embedded SurrealDB (RocksDB) persists users, channels, and messages with support for full-text and semantic retrieval.

Operational outcome: Durable collaboration history and replay-friendly audit trails.

AI Layer

Ollama-backed jobs run under semaphore governance to prevent runaway concurrency from degrading core chat responsiveness.

Operational outcome: Predictable model throughput without blocking collaboration traffic.

Delivery Layer

Single-binary deployment with embedded frontend assets simplifies LAN and on-prem rollouts across environments.

Operational outcome: Faster deployment and fewer moving parts in operations.

Performance boundaries

  • Connection design targets high concurrency with isolated per-connection tasks.
  • Message flow is write-first then broadcast, improving consistency under reconnect pressure.
  • AI concurrency is intentionally bounded to protect collaboration baseline responsiveness.
  • Channel scoping prevents global fanout amplification across unrelated teams.

Failure isolation paths

Single WebSocket client disconnects unexpectedly

Only that connection task exits; channel service continues for remaining participants.

AI inference stalls or fails

Queue state degrades gracefully while base communication remains available.

Transient model routing misconfiguration

Core messaging path remains functional, allowing operators to correct routing without total outage.

Security control matrixAdmin runbookBook architecture review