Skip to main content
The Palyra transport layer provides the multi-protocol communication backbone for the daemon, exposing management interfaces, agentic APIs, and high-performance data streams. It integrates an Axum-based HTTP stack for web and CLI interaction, Tonic for gRPC-based service-to-service communication, and an optional QUIC transport for low-latency, encrypted binary streams crates/palyra-daemon/src/lib.rs#1-10.

Multi-Transport Architecture

The palyrad daemon acts as a unified gateway hub, multiplexing multiple protocols over configured network interfaces crates/palyra-daemon/src/lib.rs#1-10. The architecture is centered around a shared GatewayRuntimeState, which acts as the source of truth for all transport handlers crates/palyra-daemon/src/gateway/runtime.rs#1-12.

Transport Topology

The following diagram illustrates how external clients interact with the daemon’s internal subsystems through various transport protocols. Transport to Code Entity Mapping Sources: crates/palyra-daemon/src/lib.rs#1-33, crates/palyra-daemon/src/transport/http/router.rs#1-25, crates/palyra-daemon/src/gateway/runtime.rs#1-12.

HTTP Surface (Axum)

The HTTP surface is implemented using the axum framework and is partitioned into several functional namespaces crates/palyra-daemon/src/transport/http/router.rs#24-25.

API Routing Table

NamespacePath PrefixPrimary PurposeKey Handlers
Console API/console/v1Powers the React web dashboard.console_diagnostics_handler, console_models_discover_handler
Admin API/admin/v1Low-level daemon management and state repair.admin_status_handler, admin_state_repair_handler
Compat API/v1OpenAI-compatible completions and models endpoints.compat::completions_handler
Realtime/realtime/v1WebSocket/SSE streams for live agent updates.realtime::stream_handler
Canvas/canvas/v1State management for the interactive A2UI canvas.canvas::patch_handler
Sources: crates/palyra-daemon/src/transport/http/router.rs#26-170, crates/palyra-daemon/src/transport/http/handlers/console/diagnostics.rs#70-74, crates/palyra-daemon/src/transport/http/handlers/console/models.rs#125-137.

HTTP Middleware

Palyra employs a layered middleware stack to enforce security and observability invariants crates/palyra-daemon/src/transport/http/router.rs#19-21:

gRPC Services

The daemon exposes structured services via Protobuf definitions located in schemas/proto/palyra/v1/. These are served using the tonic library crates/palyra-daemon/src/lib.rs#1-4.

Key gRPC Service Definitions

  1. Gateway Service (gateway.v1): The primary interface for session management, run execution, and agent interaction.
  2. Memory Service (memory.v1): Provides high-performance access to the RAG (Retrieval-Augmented Generation) index and memory lifecycle operations crates/palyra-daemon/src/gateway/runtime.rs#105-110.
  3. Browser Service (browser.v1): Used by the palyra-browserd sidecar to report page snapshots, logs, and element captures back to the daemon schemas/generated/rust/protocol_stubs.rs#61-88.
  4. Auth Service (auth.v1): Manages the AuthProfile lifecycle, including credential rotation and health checks schemas/generated/rust/protocol_stubs.rs#7-26.
Sources: schemas/generated/rust/protocol_stubs.rs#5-60, crates/palyra-daemon/src/gateway/runtime.rs#1-12.

QUIC Transport

The QUIC transport is used primarily for node-to-node communication and high-throughput worker telemetry crates/palyra-daemon/src/lib.rs#25-27. It is implemented in crates/palyra-transport-quic and integrated via the quic_runtime.rs in the daemon crates/palyra-daemon/src/quic_runtime.rs.
  • Identity & Security: QUIC connections require mTLS using certificates managed by the palyra-identity crate.
  • Multiplexing: Leverages QUIC streams to prevent head-of-line blocking between concurrent tool execution logs and agent state updates.

Data Flow: Inbound Request Lifecycle

The following diagram traces a request from the Web Console to the underlying Journal store. Request Execution Flow Sources: crates/palyra-daemon/src/transport/http/handlers/console/diagnostics.rs#70-92, crates/palyra-daemon/src/gateway/runtime.rs#15-19, crates/palyra-daemon/src/journal.rs#1-20.