palyrad), the browser automation engine (palyra-browserd), the CLI (palyra), and various client SDKs. These definitions are located in schemas/proto/palyra/v1/ and are used to generate stubs for Rust, Kotlin, and Swift schemas/generated/rust/protocol_stubs.rs#1-5, schemas/generated/kotlin/ProtocolStubs.kt#1-5, schemas/generated/swift/ProtocolStubs.swift#1-5.
Core Service Architecture
The system is partitioned into specialized services, each responsible for a specific domain of the Palyra ecosystem. Thepalyra-daemon implements most of these services as a gRPC server, while palyra-browserd specifically implements the BrowserService crates/palyra-daemon/build.rs#24-35, crates/palyra-cli/build.rs#24-35.
Service Map: Code to Protocol
The following diagram maps the high-level system components to their corresponding Protobuf service definitions and key RPC methods. Diagram: Protocol Service Mapping Sources: schemas/proto/palyra/v1/gateway.proto#7-51, schemas/proto/palyra/v1/browser.proto#7-42, crates/palyra-daemon/build.rs#8-14Gateway, Approvals, and Vault (gateway.proto)
Thegateway.proto file defines the primary entry points for agent orchestration and security management.
GatewayService
The central interface for managing agent execution and session lifecycles.RunStream: A bidirectional stream for executing agent runs. It consumesRunStreamRequestand yieldsRunStreamEventschemas/proto/palyra/v1/gateway.proto#9-10.RouteMessage: Dispatches incoming messages to the appropriate agent based on context schemas/proto/palyra/v1/gateway.proto#16.ListAgents/CreateAgent: CRUD operations for agent configurations schemas/proto/palyra/v1/gateway.proto#17-19.
ApprovalsService
Manages the human-in-the-loop (HITL) security flow. It tracksApprovalRecord entities which represent pending or resolved requests for sensitive actions schemas/proto/palyra/v1/gateway.proto#31-35.
ApprovalSubjectType: Categorizes what is being approved (e.g.,TOOL,SECRET_ACCESS,BROWSER_ACTION) schemas/proto/palyra/v1/gateway.proto#53-61.ApprovalDecision: Represents the outcome (ALLOW,DENY,TIMEOUT) schemas/proto/palyra/v1/gateway.proto#63-69.
VaultService
Provides encrypted storage for secrets. Secrets are scoped to prevent cross-agent data leakage schemas/proto/palyra/v1/gateway.proto#37-42.PutSecret: Stores a byte array identified by ascopeandkeyschemas/proto/palyra/v1/gateway.proto#177-184.
Browser Automation (browser.proto)
TheBrowserService defines the interface for the palyra-browserd sidecar. It abstracts complex browser interactions into discrete RPC calls.
Session and Tab Management
CreateSession: Initializes a new Chromium instance with a specificSessionBudgetschemas/proto/palyra/v1/browser.proto#76-91.OpenTab/SwitchTab: Controls multiple tabs within a session schemas/proto/palyra/v1/browser.proto#35-36.
Interaction Methods
The service provides high-level primitives that map toheadless_chrome actions:
Navigate,Click,Type,Press,Scrollschemas/proto/palyra/v1/browser.proto#19-25.Observe: Captures DOM snapshots and visible text for LLM consumption schemas/proto/palyra/v1/browser.proto#29.
Security and Budgeting
TheSessionBudget message enforces strict limits on browser resource usage, including max_navigation_timeout_ms, max_screenshot_bytes, and max_actions_per_session schemas/proto/palyra/v1/browser.proto#57-74.
Sources: schemas/proto/palyra/v1/browser.proto#7-168
Shared Types (common.proto)
Thecommon.proto file contains primitive types used across all services to ensure consistency in identification and event handling.
Identification
CanonicalId: A standard wrapper for ULIDs or UUIDs used to identify sessions, runs, and agents.RunStreamEvent: The core union type for all events emitted during an agent execution, including log messages, tool calls, and status changes.
Entity Interaction Flow
The following diagram demonstrates how a request flows through the generated code entities. Diagram: Code Entity Data Flow Sources: schemas/generated/rust/protocol_stubs.rs#315-325, schemas/proto/palyra/v1/gateway.proto#9-10Specialized Services
AuthService (auth.proto)
ManagesAuthProfile entities and credential health. It supports OAuthCredential and ApiKeyCredential types schemas/generated/rust/protocol_stubs.rs#7-58.
GetHealth: Returns anAuthHealthSummaryto detect expired tokens schemas/generated/rust/protocol_stubs.rs#31-33.
NodeService (node.proto)
Handles distributed node registration and heartbeat.RegisterNode: Used by remote executors to join the daemon’s control plane.Heartbeat: Maintains mTLS session liveness.
Memory and Cron (memory.proto, cron.proto)
MemoryService: Provides vector-searchable long-term storage for agents.CronService: Manages scheduledRoutineexecutions, allowing agents to trigger actions based on temporal triggers.