Skip to main content
Plug custom auth, pairing stores, or session binding into your gateway via runtime-checkable Protocols.
The user pairs through the gateway; custom Protocol implementations back auth, pairing codes, and session binding.

Quick Start

1

Import Protocols

2

Implement Custom Store


Protocol Specifications

AuthProtocol

Authentication implementations for gateway requests.

PairingProtocol

Channel pairing and authorization management.

SessionBindingProtocol

Session to principal mapping for state tracking.
These are @runtime_checkable typing.Protocol classes — any object whose method shapes match (duck typing) satisfies them. No inheritance required.
Importing the Protocol classes is via from praisonaiagents.gateway.protocols import AuthProtocol, PairingProtocol, SessionBindingProtocol.

Custom Implementation Example


How It Works

Protocol implementations allow you to plug custom backends into the PraisonAI gateway without modifying core code.

Configuration Options

Protocol implementations are injected when you start the gateway:

Common Patterns

Best for: Multi-instance deployments, high throughput.

Best Practices

Protocol compliance requires implementing all methods, even if some return empty results for your use case.
Wrap database operations in try-catch blocks and return safe defaults.
For database backends, use connection pools to avoid connection overhead.
Always validate and sanitize inputs, especially for database queries.

Bot Pairing

Complete pairing system documentation

Unknown User Pairing

Owner-DM inline-button approval flow