Outbound Delivery Protocol • AI Agent SDK

OutboundDeliveryProtocol: Protocol for durable outbound message delivery.

OutboundDeliveryProtocol

Defined in the protocols module.

AI Agent

Protocol for durable outbound message delivery.

Ensures messages sent to external channels (Telegram, Slack, Discord, etc.) are persisted before sending and can be retried on failure. This provides crash-safe at-least-once delivery for channel replies.

Example usage (implementation in praisonai_bot.gateway): from praisonai.bots import OutboundQueue

outbox = OutboundQueue(path=”~/.praisonai/state/outbox.sqlite”)

# Enqueue before sending key = await outbox.enqueue( idempotency_key=”msg-123″, target_channel=”telegram:12345″, payload={”text”: “Hello”, “metadata”: {…}} )

# Attempt delivery success = await deliver_with_retry(adapter, channel_id, payload)

# Mark as sent only if successful if success: await outbox.mark_sent(key)

# On restart, drain pending messages await outbox.drain(delivery_handler)

Methods

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 2008