Skip to content

Rivalz-ai/RAgents-Documents

Repository files navigation

Multi-Agent OrchestratorΒ 

Flexible and powerful framework for managing multiple AI agents and handling complex conversations.

GitHub Repo PyPI Documentation

GitHub stars GitHub forks GitHub watchers

Last Commit Issues Pull Requests

PyPI Monthly Downloads

πŸ”– Features

  • 🧠 Intelligent intent classification β€” Dynamically route queries to the most suitable agent based on context and content.
  • 🌊 Flexible agent responses β€” Support for both streaming and non-streaming responses from different agents.
  • πŸ“š Context management β€” Maintain and utilize conversation context across multiple agents for coherent interactions.
  • πŸ”§ Extensible architecture β€” Easily integrate new agents or customize existing ones to fit your specific needs.
  • 🌐 Universal deployment β€” Run anywhere - from AWS Lambda to your local environment or any cloud platform.
  • πŸ“¦ Pre-built agents and classifiers β€” A variety of ready-to-use agents and multiple classifier implementations available.

What's the Multi-Agent Orchestrator ❓

The Multi-Agent Orchestrator is a flexible framework for managing multiple AI agents and handling complex conversations. It intelligently routes queries and maintains context across interactions.

The system offers pre-built components for quick deployment, while also allowing easy integration of custom agents and conversation messages storage solutions.

This adaptability makes it suitable for a wide range of applications, from simple chatbots to sophisticated AI systems, accommodating diverse requirements and scaling efficiently.

πŸ—οΈ High-level architecture flow diagram





  1. The process begins with user input, which is analyzed by a Classifier.
  2. The Classifier leverages both Agents' Characteristics and Agents' Conversation history to select the most appropriate agent for the task.
  3. Once an agent is selected, it processes the user input.
  4. The orchestrator then saves the conversation, updating the Agents' Conversation history, before delivering the response back to the user.

1. RAgent Development Framework

We are building a robust ecosystem centered on resource-based Agents (rAgents) with advanced verifiability, complemented by powerful multi-agent orchestration. This enables both the seamless development of new rAgents and the efficient coordination of large-scale agent swarms in production environments.

πŸš€ Built-in RAgents

We provide four core resource agent types:

  1. Data Resources (RD): For managing datasets, files, and streams
  2. Social Resources (RX): For social media account interactions
  3. Compute Resources (RC): For CPU, GPU, and RAM management
  4. Execution Resources (RE): For Docker and runtime environments

πŸ› οΈ Custom RAgent Development

Providers can contribute new agent types by:

  1. Cloning our framework
  2. Implementing resource interactions
  3. Configuring environment settings
  4. Submitting for review and integration


2. Multi-Agent Orchestration SDK

πŸ“Œ Example SDK Usage

// Create a swarm of agents
const swarm = new Swarm({
 agents: [socialAgent, computeAgent, dataAgent],
 orchestration: {
   type: 'collaborative',
   strategy: 'round-robin'
 }
});

// Define interaction patterns
swarm.defineInteraction({
 between: ['socialAgent', 'dataAgent'],
 protocol: 'request-response',
 sharing: ['data', 'results']
});

3. ROME SDK - Swarm Orchestration Framework

πŸ“Œ Core Features

3.1 Agent Lifecycle Management

3.1.1 Agent Creation and Initialization

import { Agent, AgentConfig } from '@rome-sdk/agents';
import { Swarm, SwarmConfig } from '@rome-sdk/swarm';

const config: AgentConfig = {
  id: 'agent-001',
  capabilities: ['compute', 'storage'],
  resources: {
    maxMemory: '1GB',
    maxCPU: 2
  }
};

const agent = new Agent(config);
await agent.initialize();

3.1.2 State Management and Persistence

// ...existing state management code...

3.1.3 Graceful Shutdown and Recovery

// ...existing graceful shutdown and recovery code...

3.1.4 Health Monitoring and Auto-healing

// ...existing health monitoring and auto-healing code...

3.2 Swarm Orchestration

3.2.1 Dynamic Swarm Formation

const swarmConfig: SwarmConfig = {
  name: 'processing-swarm',
  minAgents: 3,
  maxAgents: 10,
  consensusStrategy: 'raft'
};

const swarm = new Swarm(swarmConfig);
await swarm.addAgent(agent);

3.2.2 Role-based Agent Organization

// ...existing role-based agent organization code...

3.2.3 Task Distribution and Load Balancing

const task = new Task({
  id: 'task-001',
  type: 'DATA_PROCESSING',
  priority: 'HIGH',
  timeout: '5m'
});

await swarm.distributeTask(task, {
  strategy: 'round-robin',
  retries: 3
});

3.2.4 Consensus Mechanisms

// ...existing consensus mechanisms code...

3.3 Communication Patterns

3.3.1 P2P Direct Messaging

// Subscribe to events
agent.on('message', async (message) => {
  console.log('Received:', message);
});

// Send message to another agent
await agent.sendMessage('agent-002', {
  type: 'TASK_ASSIGNMENT',
  payload: { taskId: 'task-001' }
});

3.3.2 Pub/Sub Event System

// ...existing pub/sub event system code...

3.3.3 Broadcast Communications

// ...existing broadcast communications code...

3.3.4 Message Queuing and Persistence

// ...existing message queuing and persistence code...

3.4 Resource Management

3.4.1 Compute Resource Sharing

// Share resources
await agent.shareResource({
  type: 'COMPUTE',
  amount: '500MB',
  target: 'agent-003',
  duration: '30m'
});

// Monitor usage
agent.on('resource-usage', (metrics) => {
  console.log('Current usage:', metrics);
});

3.4.2 Storage Allocation

// ...existing storage allocation code...

3.4.3 Memory Management

// ...existing memory management code...

3.4.4 Resource Discovery

// ...existing resource discovery code...

3.5 Security & Access Control

3.5.1 Agent Authentication

import { SecurityManager } from '@rome-sdk/core';

const security = new SecurityManager({
  encryption: 'AES-256',
  tokenValidity: '24h'
});

const token = await security.generateToken(agent.id);

3.5.2 Capability-based Security

// Grant capability
await agent.grantCapability('storage-access', {
  target: 'agent-002',
  duration: '1h',
  permissions: ['read', 'write']
});

// Use capability
await agent.useCapability('storage-access', {
  operation: 'write',
  data: buffer
});

3.5.3 Encryption for Data in Transit

// ...existing encryption for data in transit code...

3.5.4 Access Token Management

// ...existing access token management code...

πŸ“Œ Getting Started

4.1 Installation

npm install @rome-sdk/core @rome-sdk/agents @rome-sdk/swarm

4.2 Quick Start

4.2.1 Create an Agent

import { Agent, AgentConfig } from '@rome-sdk/agents';
import { Swarm, SwarmConfig } from '@rome-sdk/swarm';

const config: AgentConfig = {
  id: 'agent-001',
  capabilities: ['compute', 'storage'],
  resources: {
    maxMemory: '1GB',
    maxCPU: 2
  }
};

const agent = new Agent(config);
await agent.initialize();

4.2.2 Form a Swarm

const swarmConfig: SwarmConfig = {
  name: 'processing-swarm',
  minAgents: 3,
  maxAgents: 10,
  consensusStrategy: 'raft'
};

const swarm = new Swarm(swarmConfig);
await swarm.addAgent(agent);

4.2.3 Implement Communication

// Subscribe to events
agent.on('message', async (message) => {
  console.log('Received:', message);
});

// Send message to another agent
await agent.sendMessage('agent-002', {
  type: 'TASK_ASSIGNMENT',
  payload: { taskId: 'task-001' }
});

πŸ“Œ Advanced Usage

5.1 Custom Behaviors

class CustomAgent extends Agent {
  async onMessageReceived(message: Message) {
    // Custom message handling
  }

  async onResourceRequest(request: ResourceRequest) {
    // Custom resource handling
  }
}

5.2 Swarm Policies

const policy = new SwarmPolicy({
  scaling: {
    minAgents: 5,
    maxAgents: 20,
    scalingFactor: 1.5
  },
  resourceLimits: {
    maxMemoryPerAgent: '2GB',
    maxCPUPerAgent: 4
  },
  security: {
    requireEncryption: true,
    tokenRefreshInterval: '6h'
  }
});

await swarm.applyPolicy(policy);

4. Contribution Flows

πŸ›  RAgent Contribution

  1. Clone framework repository
  2. Implement new agent type
  3. Configure resource access
  4. Submit pull request with:
    • βœ… Agent implementation
    • βœ… Resource configuration
    • βœ… Documentation
    • βœ… Tests

πŸ“¦ SDK Contribution

  1. Fork SDK repository
  2. Add new orchestration patterns
  3. Create example use cases
  4. Submit merge request with:
    • βœ… Implementation
    • βœ… Documentation
    • βœ… Usage examples
    • βœ… Performance benchmarks

5. πŸ“š Documentation Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages