Skip to main content
This page documents the gRPC service definitions and message schemas that form the contract between the Palyra daemon (palyrad), CLI, and sidecar services. These definitions are located in schemas/proto/palyra/v1/ and are used to generate stubs for Rust, Kotlin, and Swift. The protocol version is managed by a major version constant schemas/generated/rust/protocol_stubs.rs#5-5.

Service Architecture Overview

The communication between Palyra components is primarily driven by gRPC over mTLS or QUIC. The GatewayService acts as the central orchestrator, while specialized services handle domain-specific logic like browser automation, secret management, and node-to-node communication.

Data Flow Diagram: Service Interactions

Title: Service Communication and Data Flow Sources: schemas/proto/palyra/v1/gateway.proto#7-51, crates/palyra-cli/src/lib.rs#151-163

1. Gateway Service (gateway.proto)

The GatewayService is the primary entry point for agent orchestration and session management. It handles the execution of “Runs” and the routing of messages between users and agents.

Key Methods

Supporting Services in gateway.proto

ServicePurposeKey Entity
ApprovalsServiceManages human-in-the-loop (HITL) authorization records schemas/proto/palyra/v1/gateway.proto#31-35.ApprovalRecord
VaultServiceSecure storage for sensitive credentials and API keys schemas/proto/palyra/v1/gateway.proto#37-42.VaultSecretMetadata
CanvasServiceManages interactive UI bundles and state for agent-user collaboration schemas/proto/palyra/v1/gateway.proto#44-51.CanvasBundle
Sources: schemas/proto/palyra/v1/gateway.proto#1-51

2. Browser Service (browser.proto)

The BrowserService (implemented by palyra-browserd) provides a gRPC interface over headless Chromium via CDP. It allows agents to perform complex web automation.

Implementation Mapping

Title: Browser Service Entity Mapping Sources: schemas/generated/rust/protocol_stubs.rs#61-172, schemas/generated/kotlin/ProtocolStubs.kt#36-126

Key Functions


3. Auth Service (auth.proto)

The AuthService manages authentication profiles, including OpenAI-compatible API keys and OAuth2 refresh flows.

Data Structures

Service Methods

Sources: schemas/generated/rust/protocol_stubs.rs#7-59, schemas/generated/swift/ProtocolStubs.swift#3-77

4. Common and Infrastructure Definitions

common.proto

Contains shared types used across all services:

Specialized Services


5. Cross-Language Stub Generation

The schemas are compiled into language-specific stubs using scripts/protocol/generate-stubs.sh.
LanguageGenerated FileUsage
Rustprotocol_stubs.rsUsed by palyrad and palyra CLI crates/palyra-cli/src/lib.rs#16-60.
KotlinProtocolStubs.ktUsed by the Android mobile app schemas/generated/kotlin/ProtocolStubs.kt#1-4.
SwiftProtocolStubs.swiftUsed by the iOS/macOS desktop clients schemas/generated/swift/ProtocolStubs.swift#1-3.
Sources: schemas/generated/rust/protocol_stubs.rs#1-1, schemas/generated/kotlin/ProtocolStubs.kt#1-1, schemas/generated/swift/ProtocolStubs.swift#1-1