Skip to main content
The Connectors & Channel Platform provides the infrastructure for Palyra to communicate with external chat ecosystems such as Discord, Slack, and Telegram. This system bridges the gap between the internal gRPC-based agent run loop and the varied protocols of third-party messaging services. The architecture is built on a provider-agnostic core that handles message queuing, retries, and state persistence, while delegating platform-specific logic to specialized adapters.

Architecture Overview

The integration between the daemon and external platforms is managed by the ChannelPlatform crates/palyra-daemon/src/channels.rs#148-152. It encapsulates a ConnectorSupervisor which manages the lifecycle of individual connector instances.

Key Components

ComponentRoleLocation
ChannelPlatformTop-level daemon sub-system for channel management.palyra-daemon
ConnectorSupervisorManages connector state, outbox queuing, and retries.palyra-connector-core
ConnectorStoreSQLite-backed persistence for connector configuration and message history.palyra-connector-core
ConnectorAdapterTrait-based interface implemented by specific platforms (e.g., Discord).palyra-connector-core
ChannelRouterRoutes inbound messages from connectors into the agent gateway.palyra-daemon

Data Flow: External to Internal

The following diagram illustrates how a message from an external platform (like Discord) reaches the Palyra Agent Gateway. Message Ingress Flow Sources: crates/palyra-daemon/src/channels.rs#167-174, crates/palyra-connector-discord/src/adapter.rs#77-118, crates/palyra-connector-core/tests/simulator_harness.rs#41-71

Connector Framework

The palyra-connector-core crate defines the standard interface for all integrations. It uses a trait-based approach to ensure that the daemon can interact with any platform without knowing its internal implementation details. For details, see Connector Framework.

Discord Integration

The Discord connector is the primary reference implementation of the ConnectorAdapter. It supports: For details, see Discord Connector & Webhooks.

Governance & Approvals

Because connectors can perform destructive actions (like deleting messages), the ChannelPlatform implements a governance layer. Before a mutation is executed, it is classified by risk level: High-risk operations trigger an ApprovalRecord in the JournalStore, requiring human intervention via the Web Console before the ConnectorSupervisor releases the message from the outbox crates/palyra-daemon/src/transport/http/handlers/admin/channels/mod.rs#20-22. Entity Mapping: Governance to Code Sources: crates/palyra-daemon/src/channels/discord.rs#61-66, crates/palyra-daemon/src/transport/http/handlers/admin/channels/mod.rs#1-18

Management API

The daemon exposes administrative endpoints for monitoring channel health and managing the connector inventory: Sources: crates/palyra-daemon/src/channels.rs#1-20, crates/palyra-daemon/src/transport/http/handlers/admin/channels/mod.rs#39-64, crates/palyra-connectors/src/lib.rs#1-18

Child Pages