Skip to content

Commit a8ec0f3

Browse files
committed
merging deploys and docs
1 parent 1d056a6 commit a8ec0f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6378
-107
lines changed

README.md

Lines changed: 153 additions & 107 deletions
Large diffs are not rendered by default.

README_old.md

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# Multi-Agent-Custom-Automation-Engine – Solution Accelerator
2+
3+
MENU: [**USER STORY**](#user-story) \| [**QUICK DEPLOY**](#quick-deploy) \| [**SUPPORTING DOCUMENTATION**](#supporting-documentation) \|
4+
5+
<h2><img src="./documentation/images/readme/userStory.png" width="64">
6+
<br/>
7+
User story
8+
</h2>
9+
10+
### Overview
11+
12+
Problem:
13+
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.
14+
15+
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.
17+
18+
### Technology Note
19+
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.
20+
21+
### Use cases / scenarios
22+
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.
24+
25+
### 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:
27+
28+
- **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.
29+
- **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.
30+
- **Applicable to most industries:** these are common challenges that most organizations face, across most industries.
31+
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.
33+
34+
### Technical key features
35+
36+
This application is an AI-driven orchestration system that manages a group of AI agents to accomplish tasks based on user input. It uses a FastAPI backend to handle HTTP requests, processes them through various specialized agents, and stores stateful information using Azure Cosmos DB. The system is designed to:
37+
38+
- Receive input tasks from users.
39+
- Generate a detailed plan to accomplish the task using a Planner agent.
40+
- Execute the plan by delegating steps to specialized agents (e.g., HR, Procurement, Marketing).
41+
- Incorporate human feedback into the workflow.
42+
- Maintain state across sessions with persistent storage.
43+
44+
This system is intended for developing and deploying custom AI solutions for specific customers. This code has not been tested as an end-to-end, reliable production application- it is a foundation to help accelerate building out multi-agent systems. You are encouraged to add your own data and functions to the agents, and then you must apply your own performance and safety evaluation testing frameworks to this system before deploying it.
45+
46+
\
47+
![image](./documentation/images/readme/macae-application.png)
48+
49+
50+
51+
### Products used/licenses required
52+
53+
- Azure Container Application
54+
55+
- Azure OpenAI
56+
57+
- Azure Cosmos DB
58+
59+
- The user deploying the template must have permission to create
60+
resources and resource groups.
61+
62+
### Solution accelerator architecture
63+
![image](./documentation/images/readme/macae-architecture.png)
64+
65+
66+
67+
68+
### **How to install/deploy**
69+
70+
This guide provides step-by-step instructions for deploying your application using Azure Container Registry (ACR) and Azure Container Apps.
71+
72+
There are several ways to deploy the solution. You can deploy to run in Azure in one click, or manually, or you can deploy locally.
73+
74+
## Quick Deploy
75+
76+
<h2><img src="./documentation/images/readme/oneClickDeploy.png" width="64"></h2>
77+
78+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FMulti-Agent-Custom-Automation-Engine-Solution-Accelerator%2Frefs%2Fheads%2Fmain%2Fdeploy%2Fmacae-continer-oc.json)
79+
80+
When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](./documentation/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
81+
82+
## Local Deployment
83+
To run the solution site and API backend only locally for development and debugging purposes, See the [local deployment guide](./documentation/LocalDeployment.md).
84+
85+
## Manual Azure Deployment
86+
Manual Deployment differs from the ‘Quick Deploy’ option in that it will install an Azure Container Registry (ACR) service, and relies on the installer to build and push the necessary containers to this ACR. This allows you to build and push your own code changes and provides a sample solution you can customize based on your requirements.
87+
88+
### Prerequisites
89+
90+
- Current Azure CLI installed
91+
You can update to the latest version using ```az upgrade```
92+
- Azure account with appropriate permissions
93+
- Docker installed
94+
95+
### Deploy the Azure Services
96+
All of the necessary Azure services can be deployed using the /deploy/macae.bicep script. This script will require the following parameters:
97+
98+
```
99+
az login
100+
az account set --subscription <SUBSCRIPTION_ID>
101+
az group create --name <RG_NAME> --location <RG_LOCATION>
102+
```
103+
To deploy the script you can use the Azure CLI.
104+
```
105+
az deployment group create \
106+
--resource-group <RG_NAME> \
107+
--template-file <BICEP_FILE> \
108+
--name <DEPLOYMENT_NAME>
109+
```
110+
111+
Note: if you are using windows with PowerShell, the continuation character (currently ‘\’) should change to the tick mark (‘`’).
112+
113+
The template will require you fill in locations for Cosmos and OpenAI services. This is to avoid the possibility of regional quota errors for either of these resources.
114+
115+
### Create the Containers
116+
#### Get admin credentials from ACR
117+
118+
Retrieve the admin credentials for your Azure Container Registry (ACR):
119+
120+
```sh
121+
az acr credential show \
122+
--name <e.g. macaeacr2t62qyozi76bs> \
123+
--resource-group <rg-name>
124+
```
125+
126+
#### Login to ACR
127+
128+
Login to your Azure Container Registry:
129+
130+
```sh
131+
az acr login --name <e.g. macaeacr2t62qyozi76bs>
132+
```
133+
134+
#### Build and push the image
135+
136+
Build the frontend and backend Docker images and push them to your Azure Container Registry. Run the following from the src/backend and the src/frontend directory contexts:
137+
138+
```sh
139+
az acr build \
140+
--registry <e.g. macaeacr2t62qyozi76bs> \
141+
--resource-group <rg-name> \
142+
--image <e.g. backendmacae:latest> .
143+
```
144+
145+
### Add images to the Container APP and Web App services
146+
147+
To add your newly created backend image:
148+
- Navigate to the Container App Service in the Azure portal
149+
- Click on Application/Containers in the left pane
150+
- Click on the "Edit and deploy" button in the upper left of the containers pane
151+
- In the "Create and deploy new revision" page, click on your container image 'backend'. This will give you the option of reconfiguring the container image, and also has an Environment variables tab
152+
- Change the properties page to
153+
- point to your Azure Container registry with a private image type and your image name (e.g. backendmacae:latest)
154+
- under "Authentication type" select "Managed Identity" and choose the 'mace-containerapp-pull'... identity setup in the bicep template
155+
- In the environment variables section add the following (each with a 'Manual entry' source):
156+
157+
name: 'COSMOSDB_ENDPOINT'
158+
value: \<Cosmos endpoint>
159+
160+
name: 'COSMOSDB_DATABASE'
161+
value: 'autogen'
162+
Note: To change the default, you will need to create the database in Cosmos
163+
164+
name: 'COSMOSDB_CONTAINER'
165+
value: 'memory'
166+
167+
name: 'AZURE_OPENAI_ENDPOINT'
168+
value: <Azure OpenAI endpoint>
169+
170+
name: 'AZURE_OPENAI_DEPLOYMENT_NAME'
171+
value: 'gpt-4o'
172+
173+
name: 'AZURE_OPENAI_API_VERSION'
174+
value: '2024-08-01-preview'
175+
Note: Version should be updated based on latest available
176+
177+
name: 'FRONTEND_SITE_NAME'
178+
value: 'https://<website Name>.azurewebsites.net'
179+
180+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
181+
value: <Application Insights Connection String>
182+
183+
- Click 'Save' and deploy your new revision
184+
185+
To add the new container to your website run the following:
186+
187+
```
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>
192+
```
193+
194+
195+
### Add the Entra identity provider to the Azure Web App
196+
To add the identity provider, please follow the steps outlined in [Set Up Authentication in Azure App Service](./documentation/azure_app_service_auth_setup.md)
197+
198+
### Run locally and debug
199+
200+
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.
201+
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.
203+
- Cosmos is a little more difficult as it requires permissions be added through script. See these examples for more information:
204+
- [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)
205+
- [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)
206+
207+
Add the appropriate endpoints from Cosmos and OpenAI services to your .env file.
208+
Note that you can configure the name of the Cosmos database in the configuration. This can be helpful if you wish to separate the data messages generated in local debugging from those associated with the cloud based solution. If you choose to use a different database, you will need to create that database in the Cosmos instance as this is not done automatically.
209+
210+
If you are using VSCode, you can use the debug configuration shown in the [local deployment guide](./documentation/LocalDeployment.md).
211+
212+
## Supporting documentation
213+
214+
215+
###
216+
217+
### How to customize
218+
219+
This solution is designed to be easily customizable. You can modify the front end site, or even build your own front end and attach to the backend API. You can further customize the backend by adding your own agents with their own specific capabilities. Deeper technical information to aid in this customization can be found in this [document](./documentation/CustomizeSolution.md).
220+
221+
### Additional resources
222+
223+
- [Python FastAPI documentation](https://fastapi.tiangolo.com/learn/)
224+
- [AutoGen Framework Documentation](https://microsoft.github.io/autogen/dev/user-guide/core-user-guide/index.html)
225+
- [Azure Container App documentation](https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-custom-container?tabs=core-tools%2Cacr%2Cazure-cli2%2Cazure-cli&pivots=container-apps)
226+
- [Azure OpenAI Service - Documentation, quickstarts, API reference - Azure AI services | Microsoft Learn](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data)
227+
- [Azure Cosmos DB documentation](https://learn.microsoft.com/en-us/azure/cosmos-db/)
228+
229+
230+
<h2><img src="./documentation/images/readme/customerTruth.png" width="64">
231+
</br>
232+
Customer truth
233+
</h2>
234+
Customer stories coming soon.
235+
236+
<br/>
237+
<br/>
238+
<br/>
239+
240+
---
241+
242+
## Disclaimers
243+
244+
To the extent that the Software includes components or code used in or derived from Microsoft products or services, including without limitation Microsoft Azure Services (collectively, “Microsoft Products and Services”), you must also comply with the Product Terms applicable to such Microsoft Products and Services. You acknowledge and agree that the license governing the Software does not grant you a license or other right to use Microsoft Products and Services. Nothing in the license or this ReadMe file will serve to supersede, amend, terminate or modify any terms in the Product Terms for any Microsoft Products and Services.
245+
246+
You must also comply with all domestic and international export laws and regulations that apply to the Software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit https://aka.ms/exporting.
247+
248+
You acknowledge that the Software and Microsoft Products and Services (1) are not designed, intended or made available as a medical device(s), and (2) are not designed or intended to be a substitute for professional medical advice, diagnosis, treatment, or judgment and should not be used to replace or as a substitute for professional medical advice, diagnosis, treatment, or judgment. Customer is solely responsible for displaying and/or obtaining appropriate consents, warnings, disclaimers, and acknowledgements to end users of Customer’s implementation of the Online Services.
249+
250+
You acknowledge the Software is not subject to SOC 1 and SOC 2 compliance audits. No Microsoft technology, nor any of its component technologies, including the Software, is intended or made available as a substitute for the professional advice, opinion, or judgement of a certified financial services professional. Do not use the Software to replace, substitute, or provide professional financial advice or judgment.
251+
252+
BY ACCESSING OR USING THE SOFTWARE, YOU ACKNOWLEDGE THAT THE SOFTWARE IS NOT DESIGNED OR INTENDED TO SUPPORT ANY USE IN WHICH A SERVICE INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE COULD RESULT IN THE DEATH OR SERIOUS BODILY INJURY OF ANY PERSON OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (COLLECTIVELY, “HIGH-RISK USE”), AND THAT YOU WILL ENSURE THAT, IN THE EVENT OF ANY INTERRUPTION, DEFECT, ERROR, OR OTHER FAILURE OF THE SOFTWARE, THE SAFETY OF PEOPLE, PROPERTY, AND THE ENVIRONMENT ARE NOT REDUCED BELOW A LEVEL THAT IS REASONABLY, APPROPRIATE, AND LEGAL, WHETHER IN GENERAL OR IN A SPECIFIC INDUSTRY. BY ACCESSING THE SOFTWARE, YOU FURTHER ACKNOWLEDGE THAT YOUR HIGH-RISK USE OF THE SOFTWARE IS AT YOUR OWN RISK.

azure.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
name: multi-agent-custom-automation-engine-solution-accelerator
3+

0 commit comments

Comments
 (0)