Skip to content

Commit cf7559b

Browse files
Merge branch 'hotfix' into UT-10888-backend
2 parents 81aec05 + be39487 commit cf7559b

File tree

9 files changed

+49
-24
lines changed

9 files changed

+49
-24
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Multi-Agent: Custom Automation Engine – Solution Accelerator
1+
# Multi-Agent-Custom-Automation-Engine – Solution Accelerator
22

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

@@ -13,23 +13,23 @@ Problem:
1313
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.
1414

1515
Solution:
16-
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.
16+
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.
1717

1818
### Technology Note
1919
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.
2020

2121
### Use cases / scenarios
2222
The multi-agent approach allows users to utilize multiple AI agents simultaneously for repeatable tasks, ensuring consistency and efficiency.
23-
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.
23+
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.
2424

2525
### Business value
26-
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:
26+
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:
2727

2828
- **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.
2929
- **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.
3030
- **Applicable to most industries:** these are common challenges that most organizations face, across most industries.
3131

32-
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.
32+
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.
3333

3434
### Technical key features
3535

@@ -185,10 +185,10 @@ To add your newly created backend image:
185185
To add the new container to your website run the following:
186186

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

194194

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

200200
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.
201201

202-
- For OpeAI service, you can add yourself to the ‘Cognitive Services OpenAI User’ permission in the Access Control (IAM) pane of the Azure portal.
202+
- For OpenAI service, you can add yourself to the ‘Cognitive Services OpenAI User’ permission in the Access Control (IAM) pane of the Azure portal.
203203
- Cosmos is a little more difficult as it requires permissions be added through script. See these examples for more information:
204204
- [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)
205205
- [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)

TRANSPARENCY_FAQS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Multi-Agent: Custom Automation Engine – Solution Accelerator : Responsible AI FAQ
1+
# Multi-Agent-Custom-Automation-Engine – Solution Accelerator : Responsible AI FAQ
22

33
## What is the Multi Agent: Custom Automation Engine – Solution Accelerator?
44
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.

documentation/LocalDeployment.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
```
2323
- To specify a tenant, use:
2424
```bash
25-
az login --tenant 16b3c013-0000-0000-0000-000000000
25+
az login --tenant <tenant_id>
2626
```
2727

2828
3. **Create a Resource Group:**
@@ -42,29 +42,47 @@
4242
```bash
4343
az ad signed-in-user show --query id -o tsv
4444
```
45-
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
45+
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.
4646
47-
5. **Create a `.env` file:**
47+
- **Additional Notes**:
48+
49+
**Role Assignments in Bicep Deployment:**
50+
51+
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:
52+
```bash
53+
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>
54+
```
55+
56+
```bash
57+
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>
58+
```
59+
**Using a Different Database in Cosmos:**
60+
61+
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:
62+
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
63+
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.
64+
65+
6. **Create a `.env` file:**
4866
4967
- Navigate to the `src` folder and create a `.env` file based on the provided `.env.sample` file.
5068
51-
6. **Fill in the `.env` file:**
69+
7. **Fill in the `.env` file:**
5270
5371
- Use the output from the deployment or check the Azure Portal under "Deployments" in the resource group.
5472
55-
7. **(Optional) Set up a virtual environment:**
73+
8. **(Optional) Set up a virtual environment:**
5674
5775
- If you are using `venv`, create and activate your virtual environment for both the frontend and backend folders.
5876
59-
8. **Install requirements - frontend:**
77+
9. **Install requirements - frontend:**
6078
6179
- In each of the frontend and backend folders -
6280
Open a terminal in the `src` folder and run:
6381
```bash
6482
pip install -r requirements.txt
6583
```
6684
67-
9. **Run the application:**
85+
10. **Run the application:**
6886
- From the src/backend directory:
6987
```bash
7088
python app.py

documentation/azure_app_service_auth_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

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

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

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

src/backend/.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ COSMOSDB_DATABASE=autogen
33
COSMOSDB_CONTAINER=memory
44

55
AZURE_OPENAI_ENDPOINT=
6+
AZURE_OPENAI_MODEL_NAME=gpt-4o
67
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
78
AZURE_OPENAI_API_VERSION=2024-08-01-preview
89
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY=

src/backend/agents/group_chat_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ async def _execute_step(self, session_id: str, step: Step):
305305
)
306306

307307
track_event_if_configured(
308-
f"Group Chat Manager - Requesting {step.agent.value.title()} to perform the action and added into the cosmos",
308+
f"Group Chat Manager - Requesting {formatted_agent} to perform the action and added into the cosmos",
309309
{
310310
"session_id": session_id,
311311
"user_id": self._user_id,
312312
"plan_id": step.plan_id,
313-
"content": f"Requesting {step.agent.value.title()} to perform action: {step.action}",
313+
"content": f"Requesting {formatted_agent} to perform action: {step.action}",
314314
"source": "GroupChatManager",
315315
"step_id": step.id,
316316
},

src/backend/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from src.backend.event_utils import track_event_if_configured
2424
from fastapi.middleware.cors import CORSMiddleware
2525
from azure.monitor.opentelemetry import configure_azure_monitor
26+
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
2627

2728

2829
# Check if the Application Insights Instrumentation Key is set in the environment variables
@@ -52,6 +53,8 @@
5253
# Initialize the FastAPI app
5354
app = FastAPI()
5455

56+
FastAPIInstrumentor.instrument_app(app)
57+
5558
frontend_url = Config.FRONTEND_SITE_NAME
5659

5760
# Add this near the top of your app.py, after initializing the app

src/backend/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Config:
3737
COSMOSDB_CONTAINER = GetRequiredConfig("COSMOSDB_CONTAINER")
3838

3939
AZURE_OPENAI_DEPLOYMENT_NAME = GetRequiredConfig("AZURE_OPENAI_DEPLOYMENT_NAME")
40+
AZURE_OPENAI_MODEL_NAME = GetOptionalConfig("AZURE_OPENAI_MODEL_NAME", default=AZURE_OPENAI_DEPLOYMENT_NAME)
4041
AZURE_OPENAI_API_VERSION = GetRequiredConfig("AZURE_OPENAI_API_VERSION")
4142
AZURE_OPENAI_ENDPOINT = GetRequiredConfig("AZURE_OPENAI_ENDPOINT")
4243
AZURE_OPENAI_API_KEY = GetOptionalConfig("AZURE_OPENAI_API_KEY")
@@ -89,7 +90,8 @@ def GetAzureOpenAIChatCompletionClient(model_capabilities):
8990
if Config.AZURE_OPENAI_API_KEY == "":
9091
# Use DefaultAzureCredential for auth
9192
Config.__aoai_chatCompletionClient = AzureOpenAIChatCompletionClient(
92-
model=Config.AZURE_OPENAI_DEPLOYMENT_NAME,
93+
model=Config.AZURE_OPENAI_MODEL_NAME,
94+
azure_deployment=Config.AZURE_OPENAI_DEPLOYMENT_NAME,
9395
api_version=Config.AZURE_OPENAI_API_VERSION,
9496
azure_endpoint=Config.AZURE_OPENAI_ENDPOINT,
9597
azure_ad_token_provider=Config.GetTokenProvider(
@@ -101,7 +103,8 @@ def GetAzureOpenAIChatCompletionClient(model_capabilities):
101103
else:
102104
# Fallback behavior to use API key
103105
Config.__aoai_chatCompletionClient = AzureOpenAIChatCompletionClient(
104-
model=Config.AZURE_OPENAI_DEPLOYMENT_NAME,
106+
model=Config.AZURE_OPENAI_MODEL_NAME,
107+
azure_deployment=Config.AZURE_OPENAI_DEPLOYMENT_NAME,
105108
api_version=Config.AZURE_OPENAI_API_VERSION,
106109
azure_endpoint=Config.AZURE_OPENAI_ENDPOINT,
107110
api_key=Config.AZURE_OPENAI_API_KEY,

src/frontend/wwwroot/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<aside class="menu mx-3 mt-5">
1818
<strong id="goHomeButton" class="menu-logo is-flex is-align-items-center">
1919
<img class="mr-3" src="../assets/app-logo.svg">
20-
<span>Multi-Agent: Custom Automation Engine</span>
20+
<span>Multi-Agent-Custom-Automation-Engine</span>
2121
</strong>
2222
<button id="newTaskButton" class="button is-fullwidth my-6">New task</button>
2323
<p class="menu-label">My tasks</p>

0 commit comments

Comments
 (0)