A standalone service for managing AI agents, task execution, and monitoring.
- 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
- Node.js 20 or later
- Docker and Docker Compose
- Redis (included in Docker setup)
- Clone the repository:
git clone https://github.com/yourusername/agents-hub-standalone.git
cd agents-hub-standalone- Install dependencies:
npm install- Create a
.envfile with your configuration (see.env.example).
Start the development server:
npm run devRun tests:
npm test
npm run test:coverage
npm run test:uiStart the services using Docker Compose:
docker-compose up -d- 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
agent:initialize: Initialize a new agentagent:execute: Execute an agent prompttask:create: Create a multi-agent taskmonitoring:status: Get system status
GET /health: Health check endpoint
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);
});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- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE file for details