Skip to main content
The Palyra repository is organized as a Rust monorepo utilizing Cargo workspaces to manage a suite of interconnected crates, alongside supporting schemas and frontend applications. The architecture is designed to decouple the core agent orchestration logic (the daemon) from the various execution environments (sandboxes, browsers, and workers) and the user interfaces (CLI and Web Console).

Monorepo Layout

The repository is partitioned into several top-level directories, each serving a distinct phase of the development and deployment lifecycle.
DirectoryPurpose
crates/The primary Rust workspace containing the daemon, CLI, and supporting libraries.
schemas/Language-agnostic definitions, including Protobuf files for gRPC and JSON schemas for UI updates.
apps/Frontend surfaces including the React-based Web Console and Tauri desktop wrapper.
infra/Deployment recipes, including Dockerfiles, systemd units, and Compose files.
scripts/Automation for protocol generation, CI/CD gates, and release packaging.
Sources: Cargo.toml#1-24, crates/palyra-common/src/deployment_profiles.rs#146-153

Crate Dependency Map

The following diagram illustrates the relationship between the core crates. palyra-daemon serves as the central orchestrator, while palyra-common provides the shared types used across the entire ecosystem.

System Entity Relationship Diagram

Sources: crates/palyra-daemon/Cargo.toml#25-41, crates/palyra-cli/Cargo.toml#25-33, crates/palyra-browserd/Cargo.toml#22-23

Core Crate Descriptions

Gateway and Orchestration

  • palyra-daemon: The central gateway. It hosts the agent run loop, manages session state, and exposes gRPC and HTTP APIs. It links almost every other crate to provide a unified runtime crates/palyra-daemon/Cargo.toml#25-41.
  • palyra-control-plane: Implements the high-level orchestration logic, including the scheduler for routines and the objective management system crates/palyra-daemon/Cargo.toml#28.
  • palyra-cli: The user-facing terminal interface. It provides tools for local agent interaction, daemon management, and diagnostic “doctor” checks crates/palyra-cli/Cargo.toml#11-13.

Security and Identity

Execution Runtimes

Protocol and Schema Architecture

The workspace uses a code-generation pipeline to ensure type safety across Rust, the Web Console, and potential mobile clients.

Protobuf Service Map

The build.rs scripts in the daemon and CLI crates compile .proto files from the schemas/ directory into Rust stubs using tonic crates/palyra-daemon/build.rs#7-14.
Schema FileGenerated Service / ClientPurpose
gateway.v1GatewayServiceClientMain agent interaction and session management crates/palyra-daemon/build.rs#8.
memory.v1MemoryServiceClientDurable fact storage and RAG retrieval crates/palyra-daemon/build.rs#10.
browser.v1BrowserServiceClientCommunication between daemon and palyra-browserd crates/palyra-daemon/build.rs#14.
auth.v1AuthServiceClientIdentity verification and pairing flows crates/palyra-daemon/build.rs#11.

Plugin WIT Interface

For Wasm plugins, Palyra uses the WebAssembly Interface Type (WIT) defined in crates/palyra-plugins/sdk/wit/palyra-sdk.wit. This defines the Tier A host capabilities, such as http-count and storage-handle, which are imported by plugins to interact with the host crates/palyra-plugins/sdk/src/lib.rs#23-43. Sources: crates/palyra-plugins/runtime/src/lib.rs#1-7, crates/palyra-plugins/sdk/src/lib.rs#11-25

Deployment Profiles

The repository defines canonical deployment profiles in palyra-common to standardize configuration across different environments. These profiles dictate the default security posture and binding behavior of the services. Sources: crates/palyra-common/src/deployment_profiles.rs#22-50