A flexible multi-agent system built with Node.js and OpenAI’s API, enabling autonomous agents to collaborate on complex tasks through sequential and parallel workflows.
This project implements a robust Agent-to-Agent (A2A) communication framework, where multiple AI agents with specialized roles work together to solve tasks that exceed the capabilities of a single model.
The Agents Demonstrate:
- Operating sequentially, passing their output to the next agent in the chain
- Operating in parallel, processing the same input simultaneously
- Collaborate using a orchestration layer
The architecture is fully extensible, making it good for automation pipelines, multi-step reasoning systems, AI-powered workflows, and distributed decision-making.
Easily define new agents with custom:
- Roles
- Specializations
- System prompts
- Model configurations
Link agents in a chain where:
- Agent A -> Agent B -> Agent C
- Each agent receives the previous agent’s output
- Ideal for: multi-step reasoning, refinement loops, staged processing
Execute multiple agents at the same time on the same input:
- Each agent runs independently
- Results are combined or compared afterward
- Useful for: ensemble reasoning, multi-perspective analysis
A simple orchestrator handles:
- Agent execution
- Response passing
- Parallel scheduling
- Data merging
- Error handling
Supports any OpenAI Chat Completion model:
gpt-5.1gpt-4.1gpt-4ogpt-3.5-turbo
a2a_chatbox-project/
├── examples/ # Basic OpenAI (API) and RAG Demonstration
├── .env # Environment variables (API keys)
├── client.mjs # OpenAI client configuration
├── agents.mjs # Agent class definition
├── orchestrator.mjs # Agent orchestration logic
├── main.mjs # Example usage and entry point
├── tools.mjs # Agent toolls (e.g Weather API)
├── package.json # Project dependencies
└── README.md # This file