SUBMIT A PRLAST EDIT : Feb 17, 2025
Orchestrator
Overview
The Orchestrator is a decentralized agent management system that handles AI agent registration, communication, and data storage using Irys (formerly Arweave) for permanent storage and Supabase for metadata management.
Key Features
- Agent Registration - Store agent configurations permanently on Irys
- Agent Communication - Send messages to registered agents through REST API
- Data Provenance - Track agent-generated data with timestamped transactions
- Decentralized Storage - Leverage Irys network for immutable data storage
- Status Monitoring - Check agent availability and operational status
System Architecture
Core Components
-
API Server (Fastify)
- REST endpoints for agent management
- Handles message routing between agents
- Manages agent status checks
-
Irys Integration
- Stores agent configurations as mutable transactions
- Retrieves historical agent data
- Manages data provenance through transaction chaining
-
Supabase Bridge
- Maintains root transaction IDs
- Links agent IDs to their storage locations
- Provides quick lookup for agent metadata
Key Workflows
1. Agent Registration
- Stores agent configuration with:
- Unique agent ID
- API endpoint
- Operational state
- Character parameters
- Creates chained transactions for updates
2. Message Handling
- Endpoint:
/api/agent/sendMessageToAgent - Flow:
- Verify agent existence
- Retrieve agent endpoint from Irys
- Forward message to agent's API
- Return response to caller
3. Data Retrieval
- Gets all data stored by an agent in the last hour
- Uses Irys timestamp filters for efficient querying
- Recursively fetches chained transaction data
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/agent/status | GET | System health check |
/api/agent/getAgentOnNetwork | GET | List all registered agents |
/api/agent/storeAgentOnNetwork | POST | Register new agent |
/api/agent/sendMessageToAgent | POST | Forward message to agent |
/api/agent/getDataStoredByAgentLastHour | POST | Retrieve agent storage data |
Data Flow
- Client → Orchestrator API
- Orchestrator → Irys (store/retrieve data)
- Orchestrator → Agent API (message forwarding)
- Orchestrator ↔ Supabase (metadata management)
// ... existing documentation ...
Command Line Interface
Agent Management
Store Agent on Network
- Ensure you have:
- Created a character file in
characters/directory - Set
SWARM_ORCHESTRATOR_URLin .env file
- Created a character file in
- Run the store command:
npm run swarm-agent-store
- Follow the prompts:
- Select character from list
- Enter agent API URL (defaults to API_URL from .env)
List Registered Agents
Get all agents currently registered on the network:
npm run swarm-agent-list
Example output:
[
{
"agentId": "abc123",
"apiUrl": "https://your-agent.com/api",
"status": "online",
"lastUpdated": "2024-02-15T12:34:56Z"
}
]