Skip to main content
The gateway now ships in the praisonai-bot package. praisonai serve gateway still works exactly as documented here; for a standalone install see praisonai-bot Migration.
reliability is a single posture switch on BotOS, gateway YAML, or the CLI that maps a profile name onto drain window, concurrency ceiling, and admission queue — without touching individual settings. The user deploys with a reliability preset; retries, timeouts, and drain behaviour apply automatically.

Quick Start

1

Python — pass reliability= to BotOS

2

YAML — set reliability: at the top level

Run with:
3

CLI flag — override any YAML value

The CLI flag takes the highest precedence and overrides whatever is in the YAML file.
4

Override individual settings after the preset

Explicit kwargs on BotOS always win over the preset:

Profiles

Three built-in profiles cover the most common deployment scenarios. The production preset enables strict per-conversation FIFO delivery on the outbox — see Outbound Ordering.

How It Works

The resolver _reliability.py converts the profile string into concrete values for drain_timeout, max_concurrent_runs, and admission_policy. Those values are passed directly to the underlying WebSocketGateway build step. Precedence (highest → lowest):
  1. Explicit kwargs on BotOS.__init__ — e.g. drain_timeout=30, outbound_ordering="strict"
  2. reliability= preset — e.g. "production"
  3. SDK defaults
outbound_ordering= is also an explicit kwarg that overrides the preset. Passing outbound_ordering="strict" (or "best_effort") always wins over the profile’s choice; unknown values raise ValueError at resolve time.

Configuration Surfaces

Python

YAML

Both placements are accepted:

CLI


Common Patterns

Production deployment

Extend the drain window for slow agents

Production preset with per-thread ordering

The production preset enables strict ordering; pass a custom lane_key to order sends within a shared channel:

Disable all backpressure for development


Best Practices

production composes drain + admission control together. Enabling them separately is error-prone — the preset guarantees a coherent configuration.
Explicit YAML keys like gateway.drain_timeout override the preset. That is correct behaviour when you need to tune a single value, but it can surprise you if you forget the preset was set.
An unrecognised profile (e.g. reliability: "fast") raises at startup, not at first request. This fail-fast behaviour is intentional — silent fallback to default would hide misconfiguration.
Deploying a new preset to a single pod via the CLI flag lets you validate behaviour before updating the shared gateway.yaml.

Gateway Overview

Bot gateway architecture and core concepts

Gateway Graceful Drain

In-flight turn drain on shutdown or reload

Gateway Admission Control

Cap concurrent runs and queue overflow requests

Gateway Flow Control

Back-pressure and send-policy options

Outbound Ordering

Per-conversation FIFO delivery the production preset turns on