Skip to content

gregunger-microsoft/SimpleAgentOrchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Azure Agent Orchestrator

A multi-cloud AI agent orchestration system that enables Azure AI agents to coordinate and communicate with AWS Bedrock agents. This project demonstrates cross-cloud AI agent collaboration with "Large Marge" as the Azure-based orchestrator.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Azure AI Projects                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚           Large Marge (Orchestrator)                   β”‚ β”‚
β”‚  β”‚         - Azure AI Agent                               β”‚ β”‚
β”‚  β”‚         - Manages rollcall coordination                β”‚ β”‚
β”‚  β”‚         - Uses fetch_rollcall() function              β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β”‚ calls
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Multi-Agent Library                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚              execute_rollcall()                        β”‚ β”‚
β”‚  β”‚         - Parallel/Sequential execution                β”‚ β”‚
β”‚  β”‚         - Agent configuration management               β”‚ β”‚
β”‚  β”‚         - Result aggregation                           β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β”‚ orchestrates
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   AWS Bedrock Agents                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   Agent 1   β”‚  β”‚   Agent 2   β”‚  β”‚   Agent N   β”‚        β”‚
β”‚  β”‚             β”‚  β”‚             β”‚  β”‚             β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

azure_orch/
β”œβ”€β”€ main.py              # Azure AI Agent orchestrator (Large Marge)
β”œβ”€β”€ multi_agents.py      # Multi-agent library for AWS Bedrock coordination
β”œβ”€β”€ .env                 # Environment configuration
β”œβ”€β”€ requirements.txt     # Python dependencies
└── README.md           # This documentation

πŸš€ Features

  • Cross-Cloud Orchestration: Azure AI agent coordinating AWS Bedrock agents
  • Flexible Execution: Support for both parallel and sequential agent calls
  • Rich Reporting: Comprehensive rollcall results with success rates and detailed responses
  • Error Handling: Robust error handling and status reporting
  • Configurable: Environment-based configuration for easy deployment
  • Extensible: Library-based architecture for easy integration

πŸ“‹ Prerequisites

  1. Azure AI Projects Setup:

    • Azure subscription with AI Projects enabled
    • Azure AI Project created and configured
    • Model deployment (e.g., GPT-4 mini) in your Azure AI Project
  2. AWS Bedrock Setup:

    • AWS account with Bedrock access
    • Bedrock agents created and configured
    • Proper AWS credentials configured locally
  3. Python Environment:

    • Python 3.8 or higher
    • Virtual environment (recommended)

βš™οΈ Installation

  1. Clone/Download the project:

    cd azure_orch
  2. Create and activate virtual environment:

    python -m venv .venv
    .venv\Scripts\activate  # Windows
    # or
    source .venv/bin/activate  # macOS/Linux
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure environment variables: Create/update .env file with your configuration:

    # Azure AI Configuration
    PROJECT_ENDPOINT=https://your-project.cognitiveservices.azure.com/
    MODEL_DEPLOYMENT_NAME=gpt-4o-mini
    USER_MESSAGE=I am taking roll call. Everyone check in and acknowledge.
    
    # AWS Bedrock Configuration
    AWS_REGION=us-west-2
    PROMPT=Hello from Large Marge! Please report in.
    
    # Bedrock Agents (add as many as needed)
    BEDROCK_AGENT_ID_1=your_agent_id_1
    BEDROCK_AGENT_ALIAS_ID_1=your_alias_id_1
    AGENT_NAME_1=Agent Alpha
    
    BEDROCK_AGENT_ID_2=your_agent_id_2
    BEDROCK_AGENT_ALIAS_ID_2=your_alias_id_2
    AGENT_NAME_2=Agent Beta
    
    # Add more agents as needed (up to 10)
  5. Configure AWS credentials (choose one method):

    • AWS CLI: aws configure
    • Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
    • IAM roles (if running on AWS)

🎯 Usage

Primary Execution (Azure Orchestrator)

Run the main Azure AI agent orchestrator:

python main.py

This will:

  1. Initialize "Large Marge" Azure AI agent
  2. Create a conversation thread
  3. Send the configured message to trigger rollcall
  4. Execute the fetch_rollcall() function
  5. Coordinate with AWS Bedrock agents
  6. Return comprehensive results

Standalone Multi-Agent Testing

Test the multi-agent library directly:

python multi_agents.py

This will:

  1. Load configured Bedrock agents
  2. Execute rollcall in synchronous mode
  3. Display detailed results and summary

Library Usage

You can also import and use the library programmatically:

import multi_agents

# Execute rollcall with default settings
results = multi_agents.execute_rollcall()

# Execute rollcall in parallel with custom prompt
results = multi_agents.execute_rollcall(
    prompt="Custom rollcall message", 
    parallel=True
)

# Get summary statistics
summary = multi_agents.get_rollcall_summary(results)

πŸ”§ Configuration Details

Azure AI Configuration

  • PROJECT_ENDPOINT: Your Azure AI Project endpoint URL
  • MODEL_DEPLOYMENT_NAME: Name of your deployed model (e.g., gpt-4o-mini)
  • USER_MESSAGE: Message sent to Large Marge to trigger rollcall

AWS Bedrock Configuration

  • AWS_REGION: AWS region where your Bedrock agents are deployed
  • PROMPT: Default message sent to Bedrock agents
  • BEDROCK_AGENT_ID_X: Agent ID for agent number X
  • BEDROCK_AGENT_ALIAS_ID_X: Alias ID for agent number X
  • AGENT_NAME_X: Human-readable name for agent number X

πŸ“Š Expected Output

Azure Agent Response

{
  "status": "success",
  "summary": {
    "total_agents": 3,
    "successful": 2,
    "failed": 1,
    "success_rate": "66.7%"
  },
  "agent_responses": [
    {
      "name": "Agent Alpha",
      "success": true,
      "response": "Alpha reporting in from AWS Bedrock!",
      "error": ""
    }
  ],
  "orchestrator": "Large Marge from Azure"
}

Console Output

Created agent, ID: asst_xyz123
Created thread, ID: thread_abc789
Created message, ID: msg_def456
πŸ€– Calling Agent Alpha...
βœ… Agent Alpha: Alpha reporting in from AWS Bedrock!
πŸ€– Calling Agent Beta...
βœ… Agent Beta: Beta standing by and ready!
Run completed with status: RunStatus.COMPLETED
Role: assistant, Content: [{'type': 'text', 'text': {'value': 'Rollcall complete...'}}]
Deleted agent

πŸ› Troubleshooting

Common Issues

  1. Azure Authentication Errors:

    • Ensure you're logged into Azure CLI: az login
    • Verify your Azure AI Project endpoint and model deployment
  2. AWS Bedrock Connection Issues:

    • Check AWS credentials: aws sts get-caller-identity
    • Verify Bedrock agent IDs and alias IDs
    • Ensure proper IAM permissions for Bedrock
  3. No Agents Configured:

    • Check .env file has valid BEDROCK_AGENT_ID_X and BEDROCK_AGENT_ALIAS_ID_X pairs
    • Agent numbering starts from 1 and must be sequential
  4. Module Import Errors:

    • Ensure virtual environment is activated
    • Run pip install -r requirements.txt again

Debug Mode

Add debugging to see detailed execution:

import logging
logging.basicConfig(level=logging.DEBUG)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ™‹β€β™€οΈ About Large Marge

Large Marge is the Azure-based orchestrator agent that coordinates rollcall across multiple cloud environments. She's responsible for:

  • Initiating rollcall sequences
  • Coordinating with AWS Bedrock agents
  • Aggregating and reporting results
  • Maintaining cross-cloud communication protocols

"Large Marge sends her regards from Azure!" 🚚

About

Python application that creates an agent in Azure Foundry which then executes agents in AWS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages