Skip to main content
The Channel Connector system provides the infrastructure for Palyra to communicate with external messaging platforms. It handles the translation between platform-specific protocols (like Discord’s Gateway or Slack’s Webhooks) and Palyra’s internal message format, ensuring reliable delivery, rate limiting, and secure routing to the appropriate agentic sessions.

Connector Framework and Supervisor

The core of the integration layer is managed by the palyra-connectors and palyra-connector-core crates. Central to this is the ConnectorSupervisor, which manages the lifecycle of various ConnectorAdapter implementations crates/palyra-connector-core/src/supervisor.rs#194-199. The supervisor handles: For details on the supervisor lifecycle and the internal Echo connector used for testing, see Connector Framework and Supervisor.

Connector Architecture

The following diagram illustrates how the ConnectorSupervisor bridges external platform events to the internal ChannelRouter. Diagram: Connector to Router Flow Sources: crates/palyra-connector-core/src/supervisor.rs#128-134, crates/palyra-daemon/src/channels.rs#125-132

Message Routing and Policies

Incoming messages are dispatched via the ChannelRouter crates/palyra-daemon/src/channel_router.rs#161-192. This component is responsible for enforcing governance policies before a message ever reaches an LLM or Agent. Key routing features include:
PolicyRoleImplementation
DirectMessagePolicyControls DM access (Deny, Pairing, Allow)crates/palyra-daemon/src/channel_router.rs#57-61
BroadcastStrategyControls mass mentions (@everyone)crates/palyra-daemon/src/channel_router.rs#28-32
ChannelRoutingRulePer-channel overrides for mentions/filterscrates/palyra-daemon/src/channel_router.rs#161-175
Sources: crates/palyra-daemon/src/channel_router.rs#1-212

Discord Integration

The Discord integration is the most mature connector in Palyra, utilizing a dedicated adapter in palyra-connector-discord. It supports real-time interaction via the Discord Gateway and complex permission management. The daemon provides specialized handlers for onboarding Discord bots crates/palyra-daemon/src/transport/http/handlers/console/channels/connectors/discord.rs#126-129, verifying permissions, and managing account-specific token storage in the Vault crates/palyra-daemon/src/transport/http/handlers/console/channels/connectors/discord.rs#142-149. For details on setting up Discord bots and permission normalization, see Discord Integration. Sources: crates/palyra-daemon/src/transport/http/handlers/console/channels/connectors/discord.rs#1-165, crates/palyra-daemon/src/channels.rs#160-179

Webhook Ingestion

For platforms that do not use persistent connections (like Slack or GitHub), Palyra provides a robust Webhook system. The WebhookRegistry manages integration secrets and configuration crates/palyra-daemon/src/webhooks.rs#107-111. Security features for webhooks include: The CLI provides a webhooks command group for managing these integrations, including a test command to simulate incoming payloads crates/palyra-cli/src/commands/webhooks.rs#100-132. For details on schema and verification, see Webhooks. Sources: crates/palyra-daemon/src/webhooks.rs#1-175, crates/palyra-cli/src/commands/webhooks.rs#1-132

Child Pages