Skip to main content
This page defines the fundamental domain concepts and technical terminology used throughout the Palyra codebase. Understanding these concepts is essential for navigating the architecture of the daemon, the CLI, and the communication protocols.

Domain Entity Overview

The following diagram illustrates the relationship between high-level domain concepts and their corresponding implementations in the Rust codebase.

Concept to Code Mapping

Sources: crates/palyra-daemon/src/agents.rs#46-49, crates/palyra-daemon/src/orchestrator.rs#77-78, crates/palyra-daemon/src/journal.rs#67-68, crates/palyra-daemon/src/gateway.rs#86-86

Core Definitions

Agents

An Agent is a configured entity with a specific identity, instructions, and set of capabilities. In the codebase, agents are managed via the AgentRegistry and persisted as AgentRecord structs. Agents are resolved during message routing based on AgentResolutionSource.

Runs and Sessions

Principals and Devices

Tools and Skills


Data Structures and Protocols

Tape and Journal

Palyra uses a ledger-based approach for persistence and auditability.
  • Journal: The primary append-only store for all system events, including configuration changes, session starts, and tool results. Managed by JournalStore.
  • Tape: A subset of the journal specific to a single Run. It contains the sequence of events (messages, tool calls, token chunks) that constitute the “recording” of that run.
  • Implementation:

Canvas

Canvas is a specialized environment for rendering rich, interactive user interfaces generated by agents. It uses CanvasStatePatchRecord to synchronize state between the agent and the frontend.

A2UI (Agent-to-User Interface)

The A2UI protocol is the JSON-based communication standard used by agents to update the UI dynamically. It relies on JSON Patch documents to perform granular updates to the Canvas state.

Connectivity and Orchestration

Channels and Connectors

Orchestration Flow

The following diagram shows the data flow from a message arrival to the execution of a tool. Sources: crates/palyra-daemon/src/gateway.rs#50-82, crates/palyra-daemon/src/orchestrator.rs#77-78, crates/palyra-daemon/src/journal.rs#63-70

Technical Constants

The system enforces several constraints defined in the gateway: Sources: crates/palyra-daemon/src/gateway.rs#86-141