Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Multi Agent Custom Automation Engine Solution Accelerator",
"image": "mcr.microsoft.com/devcontainers/python:3.10",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1.0.8": {},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/rchaganti/vsc-devcontainer-features/azurebicep:1.0.5": {}
},

"postCreateCommand": "sudo chmod +x .devcontainer/setupEnv.sh && ./.devcontainer/setupEnv.sh",

"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-bicep",
"ms-python.python"
]
},
"codespaces": {
"openFiles": [
"README.md"
]
}
},

"remoteUser": "vscode",
"hostRequirements": {
"memory": "8gb"
}
}
8 changes: 8 additions & 0 deletions .devcontainer/setupEnv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

pip install --upgrade pip


(cd ./src/frontend; pip install -r requirements.txt)

(cd ./src/backend; pip install -r requirements.txt)
48 changes: 20 additions & 28 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,13 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Log in to Azure Container Registry
if: ${{ github.ref_name == 'main' }}
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix') }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Log in to Azure Container Registry (Dev/Demo)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
username: ${{ secrets.ACR_DEV_USERNAME }}
password: ${{ secrets.ACR_DEV_PASSWORD }}

- name: Set Docker image tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
Expand All @@ -57,27 +49,27 @@ jobs:
echo "TAG=demo" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/hotfix" ]]; then
echo "TAG=hotfix" >> $GITHUB_ENV
else
echo "TAG=pullrequest-ignore" >> $GITHUB_ENV
fi
- name: Build and push Docker images
if: ${{ github.ref_name == 'main' }}
run: |
cd src/backend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Backend image built and pushed successfully."
cd ../frontend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Frontend image built and pushed successfully."
- name: Build and push Docker images (Dev/Demo/hotfix)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}

- name: Build and push Docker images optionally
run: |
cd src/backend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Backend image built and pushed successfully."
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }} -f Dockerfile . && \
if [[ "${{ env.TAG }}" == "latest" || "${{ env.TAG }}" == "dev" || "${{ env.TAG }}" == "demo" || "${{ env.TAG }}" == "hotfix" ]]; then
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }} && \
echo "Backend image built and pushed successfully."
else
echo "Skipping Docker push for backend with tag: ${{ env.TAG }}"
fi
cd ../frontend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Frontend image built and pushed successfully."
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} -f Dockerfile . && \
if [[ "${{ env.TAG }}" == "latest" || "${{ env.TAG }}" == "dev" || "${{ env.TAG }}" == "demo" || "${{ env.TAG }}" == "hotfix" ]]; then
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} && \
echo "Frontend image built and pushed successfully."
else
echo "Skipping Docker push for frontend with tag: ${{ env.TAG }}"
fi


1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r src/backend/requirements.txt
pip install pytest-cov
pip install pytest-asyncio
- name: Check if test files exist
id: check_tests
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Multi-Agent: Custom Automation Engine – Solution Accelerator
# Multi-Agent-Custom-Automation-Engine – Solution Accelerator

MENU: [**USER STORY**](#user-story) \| [**QUICK DEPLOY**](#quick-deploy) \| [**SUPPORTING DOCUMENTATION**](#supporting-documentation) \|

Expand All @@ -13,23 +13,23 @@ Problem:
Agentic AI systems are set to transform the way businesses operate, however it can be fairly complex to build an initial MVP to demonstrate this value.

Solution:
The Multi-Agent -Custom Automation Engine Solution Accelerator provides a ready to go application to use as the base of the MVP, or as a reference, allowing you to hit the ground running.
The Multi-Agent-Custom Automation Engine Solution Accelerator provides a ready to go application to use as the base of the MVP, or as a reference, allowing you to hit the ground running.

### Technology Note
This accelerator uses the AutoGen framework from Microsoft Research. This is an open source project that is maintained by [Microsoft Research’s AI Frontiers Lab](https://www.microsoft.com/research/lab/ai-frontiers/). Please see this [blog post](https://devblogs.microsoft.com/autogen/microsofts-agentic-frameworks-autogen-and-semantic-kernel/) for the latest information on using the AutoGen framework in production solutions.

### Use cases / scenarios
The multi-agent approach allows users to utilize multiple AI agents simultaneously for repeatable tasks, ensuring consistency and efficiency.
The agents collaborate with a manager on various assignments for onboarding a new employee , such as HR and tech support AI working together to set up software accounts, configure hardware, schedule onboarding meetings, register employees for benefits, and send welcome emails. Additionally, these agents can handle tasks like procurement and drafting press releases.
The agents collaborate with a manager on various assignments for onboarding a new employee, such as HR and tech support AI working together to set up software accounts, configure hardware, schedule onboarding meetings, register employees for benefits, and send welcome emails. Additionally, these agents can handle tasks like procurement and drafting press releases.

### Business value
Multi-agent systems represent the next wave of Generative AI use cases, offering entirely new opportunities to drive efficiencies in your business. The Multi-Agent -Custom Automation Engine Solution Accelerator demonstrates several key benefits:
Multi-agent systems represent the next wave of Generative AI use cases, offering entirely new opportunities to drive efficiencies in your business. The Multi-Agent-Custom-Automation-Engine Solution Accelerator demonstrates several key benefits:

- **Allows people to focus on what matters:** by doing the heavy lifting involved with coordinating activities across an organization, peoples’ time is freed up to focus on their specializations.
- **Enabling GenAI to scale:** by not needing to build one application after another, organizations are able to reduce the friction of adopting GenAI across their entire organization. One capability can unlock almost unlimited use cases.
- **Applicable to most industries:** these are common challenges that most organizations face, across most industries.

Whilst still an emerging area, investing in agentic use cases, digitatization and developing tools will be key to ensuring you are able to leverage these new technologies and seize the GenAI moment.
Whilst still an emerging area, investing in agentic use cases, digitization and developing tools will be key to ensuring you are able to leverage these new technologies and seize the GenAI moment.

### Technical key features

Expand Down Expand Up @@ -177,15 +177,18 @@ To add your newly created backend image:
name: 'FRONTEND_SITE_NAME'
value: 'https://<website Name>.azurewebsites.net'

name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
value: <Application Insights Instrumentation Key>

- Click 'Save' and deploy your new revision

To add the new container to your website run the following:

```
az webapp config container set --resource-group macae_full_deploy2_rg \
--name macae-frontend-2t62qyozi76bs \
--container-image-name macaeacr2t62qyozi76bs.azurecr.io/frontendmacae:latest \
--container-registry-url https://macaeacr2t62qyozi76bs.azurecr.io
az webapp config container set --resource-group <resource_group_name> \
--name <container_name> \
--container-image-name <e.g. macaeacr2t62qyozi76bs.azurecr.io/frontendmacae:latest> \
--container-registry-url <e.g. https://macaeacr2t62qyozi76bs.azurecr.io>
```


Expand All @@ -196,7 +199,7 @@ To add the identity provider, please follow the steps outlined in [Set Up Authen

To debug the solution, you can use the Cosmos and OpenAI services you have manually deployed. To do this, you need to ensure that your Azure identity has the required permissions on the Cosmos and OpenAI services.

- For OpeAI service, you can add yourself to the ‘Cognitive Services OpenAI User’ permission in the Access Control (IAM) pane of the Azure portal.
- For OpenAI service, you can add yourself to the ‘Cognitive Services OpenAI User’ permission in the Access Control (IAM) pane of the Azure portal.
- Cosmos is a little more difficult as it requires permissions be added through script. See these examples for more information:
- [Use data plane role-based access control - Azure Cosmos DB for NoSQL | Microsoft Learn](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Cpython&pivots=azure-interface-cli)
- [az cosmosdb sql role assignment | Microsoft Learn](https://learn.microsoft.com/en-us/cli/azure/cosmosdb/sql/role/assignment?view=azure-cli-latest#az-cosmosdb-sql-role-assignment-create)
Expand Down
2 changes: 1 addition & 1 deletion TRANSPARENCY_FAQS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Multi-Agent: Custom Automation Engine – Solution Accelerator : Responsible AI FAQ
# Multi-Agent-Custom-Automation-Engine – Solution Accelerator : Responsible AI FAQ

## What is the Multi Agent: Custom Automation Engine – Solution Accelerator?
Multi Agent: Custom Automation Engine – Solution Accelerator is an open-source GitHub Repository that enables users to solve complex tasks using multiple agents. The accelerator is designed to be generic across business tasks. The user enters a task and a planning LLM formulates a plan to complete that task. The system then dynamically generates agents which can complete the task. The system also allows the user to create actions that agents can take (for example sending emails or scheduling orientation sessions for new employees). These actions are taken into account by the planner and dynamically created agents may be empowered to take these actions.
Expand Down
7 changes: 6 additions & 1 deletion deploy/macae-continer-oc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "17567587246932458853"
"templateHash": "13282901028774763433"
}
},
"parameters": {
Expand Down Expand Up @@ -366,13 +366,18 @@
{
"name": "FRONTEND_SITE_NAME",
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
},
{
"name": "APPLICATIONINSIGHTS_INSTRUMENTATION_KEY",
"value": "[reference('appInsights').ConnectionString]"
}
]
}
]
}
},
"dependsOn": [
"appInsights",
"cosmos::autogenDb",
"containerAppEnv",
"cosmos",
Expand Down
4 changes: 4 additions & 0 deletions deploy/macae-continer.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
name: 'FRONTEND_SITE_NAME'
value: 'https://${format(uniqueNameFormat, 'frontend')}.azurewebsites.net'
}
{
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
value: appInsights.properties.ConnectionString
}
]
}
]
Expand Down
69 changes: 62 additions & 7 deletions documentation/LocalDeployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,43 @@
- Azure CLI, and an Azure Subscription
- Visual Studio Code IDE

# Local setup

> **Note for macOS Developers**: If you are using macOS on Apple Silicon (ARM64) the DevContainer will **not** work. This is due to a limitation with the Azure Functions Core Tools (see [here](https://github.com/Azure/azure-functions-core-tools/issues/3112)). We recommend using the [Non DevContainer Setup](./NON_DEVCONTAINER_SETUP.md) instructions to run the accelerator locally.
The easiest way to run this accelerator is in a VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):

1. Start Docker Desktop (install it if not already installed)
1. Open the project:
[![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)

1. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window

## Detailed Development Container setup instructions

The solution contains a [development container](https://code.visualstudio.com/docs/remote/containers) with all the required tooling to develop and deploy the accelerator. To deploy the Chat With Your Data accelerator using the provided development container you will also need:

* [Visual Studio Code](https://code.visualstudio.com)
* [Remote containers extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

If you are running this on Windows, we recommend you clone this repository in [WSL](https://code.visualstudio.com/docs/remote/wsl)

```cmd
git clone https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator
```

Open the cloned repository in Visual Studio Code and connect to the development container.

```cmd
code .
```

!!! tip
Visual Studio Code should recognize the available development container and ask you to open the folder using it. For additional details on connecting to remote containers, please see the [Open an existing folder in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container) quickstart.

When you start the development container for the first time, the container will be built. This usually takes a few minutes. **Please use the development container for all further steps.**

The files for the dev container are located in `/.devcontainer/` folder.

## Local deployment and debugging:

1. **Clone the repository.**
Expand All @@ -22,7 +59,7 @@
```
- To specify a tenant, use:
```bash
az login --tenant 16b3c013-0000-0000-0000-000000000
az login --tenant <tenant_id>
```

3. **Create a Resource Group:**
Expand All @@ -42,29 +79,47 @@
```bash
az ad signed-in-user show --query id -o tsv
```
You will also be prompted for locations for Cosmos and Open AI services. This is to allow separate regions where there may be service quota restrictions
You will also be prompted for locations for Cosmos and Open AI services. This is to allow separate regions where there may be service quota restrictions.

- **Additional Notes**:

**Role Assignments in Bicep Deployment:**

The **macae-dev.bicep** deployment includes the assignment of the appropriate roles to AOAI and Cosmos services. If you want to modify an existing implementation—for example, to use resources deployed as part of the simple deployment for local debugging—you will need to add your own credentials to access the Cosmos and AOAI services. You can add these permissions using the following commands:
```bash
az cosmosdb sql role assignment create --resource-group <solution-accelerator-rg> --account-name <cosmos-db-account-name> --role-definition-name "Cosmos DB Built-in Data Contributor" --principal-id <aad-user-object-id> --scope /subscriptions/<subscription-id>/resourceGroups/<solution-accelerator-rg>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-db-account-name>
```

```bash
az role assignment create --assignee <aad-user-upn> --role "Cognitive Services OpenAI User" --scope /subscriptions/<subscription-id>/resourceGroups/<solution-accelerator-rg>/providers/Microsoft.CognitiveServices/accounts/<azure-openai-account-name>
```
**Using a Different Database in Cosmos:**

You can set the solution up to use a different database in Cosmos. For example, you can name it something like autogen-dev. To do this:
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled “_+ New Container_” and provide all the necessary details.

5. **Create a `.env` file:**
6. **Create a `.env` file:**

- Navigate to the `src` folder and create a `.env` file based on the provided `.env.sample` file.

6. **Fill in the `.env` file:**
7. **Fill in the `.env` file:**

- Use the output from the deployment or check the Azure Portal under "Deployments" in the resource group.

7. **(Optional) Set up a virtual environment:**
8. **(Optional) Set up a virtual environment:**

- If you are using `venv`, create and activate your virtual environment for both the frontend and backend folders.

8. **Install requirements - frontend:**
9. **Install requirements - frontend:**

- In each of the frontend and backend folders -
Open a terminal in the `src` folder and run:
```bash
pip install -r requirements.txt
```

9. **Run the application:**
10. **Run the application:**
- From the src/backend directory:
```bash
python app.py
Expand Down
2 changes: 1 addition & 1 deletion documentation/azure_app_service_auth_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

![Add Provider](./images/azure-app-service-auth-setup/AppAuthIdentityProviderAdd.png)

5. Accept the default values and click on `Add` button to go back to the previous page with the identify provider added.
5. Accept the default values and click on `Add` button to go back to the previous page with the idenity provider added.

![Add Provider](./images/azure-app-service-auth-setup/AppAuthIdentityProviderAdded.png)

Expand Down
2 changes: 2 additions & 0 deletions src/backend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ COSMOSDB_DATABASE=autogen
COSMOSDB_CONTAINER=memory

AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_MODEL_NAME=gpt-4o
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-08-01-preview
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY=

BACKEND_API_URL='http://localhost:8000'
FRONTEND_SITE_NAME='http://127.0.0.1:3000'
Loading
Loading