Skip to content

ll2023/GenovateMain

Repository files navigation

Agents Hub Standalone

A standalone service for managing AI agents, task execution, and monitoring.

Features

  • Real-time agent management and monitoring
  • Multi-agent task coordination
  • Task queuing and execution
  • WebSocket-based communication
  • Redis-backed persistence and pub/sub
  • Docker support for easy deployment

Getting Started

Prerequisites

  • Node.js 20 or later
  • Docker and Docker Compose
  • Redis (included in Docker setup)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/agents-hub-standalone.git
cd agents-hub-standalone
  1. Install dependencies:
npm install
  1. Create a .env file with your configuration (see .env.example).

Development

Start the development server:

npm run dev

Run tests:

npm test
npm run test:coverage
npm run test:ui

Docker Deployment

Start the services using Docker Compose:

docker-compose up -d

Architecture

Components

  • Agent Service: Manages agent lifecycle and execution
  • Task Service: Handles task creation and coordination
  • LLM Service: Manages language model configurations and execution
  • WebSocket Server: Real-time communication
  • Redis: Message queues and caching
  • Bull: Task queue management

API

WebSocket Events

  • agent:initialize: Initialize a new agent
  • agent:execute: Execute an agent prompt
  • task:create: Create a multi-agent task
  • monitoring:status: Get system status

REST Endpoints

  • GET /health: Health check endpoint

Usage Example

import { agentsHubClient } from './agents/client';

// Initialize an agent
const agent = {
  id: 'agent1',
  name: 'Market Analyst',
  // ... other agent properties
};

await agentsHubClient.initializeAgent(agent);

// Execute a prompt
const result = await agentsHubClient.executePrompt(
  agent.id,
  [{
    id: '1',
    role: 'user',
    content: 'Analyze market trends',
    timestamp: new Date().toISOString()
  }]
);

// Create a multi-agent task
const taskId = await agentsHubClient.createTask({
  title: 'Comprehensive Market Analysis',
  description: 'Analyze market trends and competition',
  agents: ['agent1', 'agent2'],
  priority: 'high'
});

// Monitor task progress
agentsHubClient.subscribeToTask(taskId, (task) => {
  console.log('Task update:', task);
});

Testing

The project includes comprehensive tests:

  • Unit tests for core services
  • Integration tests for agent coordination
  • WebSocket communication tests
  • Task execution tests

Run tests with coverage:

npm run test:coverage

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages