Skip to content

76Trystan/agent-2-agent-OpenAI

Repository files navigation

Agent-to-Agent (A2A) Communication System

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.


Overview

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.


Features

Modular Agent Architecture

Easily define new agents with custom:

  • Roles
  • Specializations
  • System prompts
  • Model configurations

Sequential Workflows

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

Parallel Workflows

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

Orchestration Layer

A simple orchestrator handles:

  • Agent execution
  • Response passing
  • Parallel scheduling
  • Data merging
  • Error handling

Model Selection

Supports any OpenAI Chat Completion model:

  • gpt-5.1
  • gpt-4.1
  • gpt-4o
  • gpt-3.5-turbo

Project Structure

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

About

Demonstrating an agent-2-agent project using OpenAI API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors