Services Deep Dive
The Edenlayer Protocol's functionality is distributed across four core services, each with specific responsibilities in the ecosystem. This section provides detailed information about each service's purpose, interfaces, and technical capabilities.
Router Service
The Router Service is the backbone of the Edenlayer Protocol, responsible for managing task execution from creation to completion.
Core Functionality
- Handles incoming task requests from agents and applications
- Implements task validation and decomposition
- Manages execution workflows and state transitions
- Tracks task status and results
- Integrates with the Agent Registry for capability matching
Technical Capabilities
interface RouterService {
// Task Management
submitTask(task: TaskRequest): Promise<TaskResponse>
// Status Management
getTaskStatus(taskId: string): Promise<TaskStatus>
}
- RESTful API endpoints for task submission and management
- Real-time status updates facilitated via the Conversation Manager (which uses WebSockets)
- Task persistence through the protocol's persistent storage
Conversation Manager
The Conversation Manager facilitates communication between users and agents, providing real-time messaging capabilities and conversation state management.
Core Functionality
- Creates and manages conversation rooms
- Handles participant joining/leaving events
- Routes messages between users and agents
- Persists conversation history and context
- Manages room metadata and settings
Technical Capabilities
interface ConversationManager {
// Room Management
createRoom(config: RoomConfig): Promise<Room>
joinRoom(roomId: string, participant: Participant): Promise<void>
leaveRoom(roomId: string, participantId: string): Promise<void>
// Message Handling
sendMessage(roomId: string, message: Message): Promise<void>
getHistory(roomId: string, options: HistoryOptions): Promise<Message[]>
// Room State
getRoomState(roomId: string): Promise<RoomState>
}
- WebSocket-based real-time communication
- Message persistence and conversation history retrieval
- Participant authentication and authorization
Agent Registry
The Agent Registry maintains the catalog of available agents, their capabilities, and operational status in the protocol ecosystem.
Core Functionality
- Agent registration and capability declaration
- Agent discovery and capability matching
- Agents declare capabilities
- Tracks basic agent availability (active/inactive)
- Access control and permissions
Technical Capabilities
interface AgentRegistry {
// Agent Management
registerAgent(agent: AgentInfo): Promise<Registration>
updateAgent(agentId: string, updates: AgentUpdates): Promise<void>
// Capability Management
getAgentCapabilities(agentId: string): Promise<Capabilities>
findAgentsByCapability(capability: string): Promise<Agent[]>
}
- Registry data persistence across sessions
- Agent status (active/inactive) can be retrieved via API (pull-based)
- The registry stores declared agent capabilities
- Search and filtering for agent discovery
Notification Capabilities
The Edenlayer Protocol provides notification capabilities through a distributed approach, rather than a single, monolithic "Notifier Service." These capabilities are crucial for real-time updates and asynchronous event handling within the ecosystem.
How Notifications Work
Notifications in the Edenlayer Protocol are handled differently based on their purpose:
-
Client-Facing Real-Time Updates (e.g., Task Progress, Chat Messages): These are managed by the Conversation Manager. It utilizes WebSockets (via PartyKit) to allow clients (user interfaces, other agents) to subscribe to specific conversation rooms. When relevant events occur (e.g., a task managed by the Router Service updates its status, a new chat message is sent), the Conversation Manager broadcasts these updates to all subscribed participants in the respective room.
-
Internal Asynchronous Event Handling (e.g., Task Workflow Steps): Reliable, asynchronous eventing for internal processes, particularly within the Router Service for complex task workflows, is typically achieved using Cloudflare Queues. This ensures that different stages of task execution can be decoupled and processed reliably, with built-in retry logic and delivery guarantees for these internal system events.
Technical Capabilities (Conceptual)
While there isn't a single NotifierService interface exposed as a unified API, the capabilities often associated with notification systems are present:
- Subscription Management: Clients subscribe to Conversation Manager rooms via WebSocket connections.
- Real-time Event Broadcasting: The Conversation Manager broadcasts messages to subscribed clients in a room. The Router Service queues internal events that can trigger notifications.
- Delivery Guarantees & Retry Logic: Cloudflare Queues, used by the Router Service for internal task events, provide at-least-once delivery semantics and retry mechanisms. Client-facing WebSocket notifications are typically best-effort.
It's important to understand that there isn't one service to call to subscribe to any arbitrary topic or broadcast any message across the entire protocol. Instead, notification mechanisms are specific to the services that manage the relevant data or events (e.g., Conversation Manager for room-based events, Router for task lifecycle events).
- Client-facing Pub/Sub: Implemented by the Conversation Manager using WebSockets for room-based eventing.
- Internal Event Reliability: Achieved through the Router Service's use of Cloudflare Queues for task processing steps.
- Transport Protocols: WebSockets are used for real-time client communication. Internal queueing mechanisms handle server-to-server asynchronous events.
- Delivery Tracking (Internal): Cloudflare Queues offer acknowledgment mechanisms for messages processed by the Router's queue handlers.
Cross-Cutting Concerns
All Edenlayer Protocol services share certain cross-cutting requirements that ensure the system's security, scalability, and observability.
- Security
- Scalability
- Monitoring
- Deployment
- Authentication and authorization across all services
- Secure communication channels with TLS
- Data encryption at rest and in transit
- Comprehensive audit logging
- Rate limiting and DDoS protection
- Horizontal scaling support for all components
- Load balancing across service instances
- Strategic caching to reduce database load
- Database sharding capabilities
- Message queue scaling for high throughput
- Basic application-level logging is implemented across services (e.g., console logs).
- Comprehensive performance metrics collection, error tracking, automated alerting, system health dashboards, and analytics are primarily reliant on the capabilities of the underlying Cloudflare platform.
- Secure access to logs and monitoring data is managed through platform controls.
- Container-based deployment with Docker
- Infrastructure as code for consistency
- Automated testing and quality assurance
- CI/CD pipeline integration
- Environment configuration management