Automate agentic AI system design using Azure's generative AI design patterns. Operations teams can streamline LLM integration, reducing development time and improving system autonomy. Connects to Azure AI services and Python workflows.
git clone https://github.com/microsoft/azure-genai-design-patterns.gitAzure GenAI Design Patterns is a structured repository of frameworks and guidance for designing generative AI systems on Microsoft Azure. It organizes content across foundational concepts, reusable design patterns, reference architectures, and accelerators to help teams implement agentic AI systems. The resource provides practical patterns and architectural blueprints that reduce development complexity when integrating Azure AI services. Teams can reference real-world design approaches and accelerators to streamline LLM integration and deployment. This enables faster prototyping and more consistent implementations of generative AI solutions at scale.
[{"step":"Define your use case and requirements","action":"List the specific tasks the agentic system needs to handle (e.g., customer support, data analysis, workflow automation). Identify key constraints like latency, cost, or integration requirements. Use tools like Azure AI Studio to prototype your LLM deployment.","tip":"Start with a narrow scope (e.g., a single agent for billing queries) before expanding to a multi-agent system. Use Azure's cost calculator to estimate expenses for LLM calls and API usage."},{"step":"Select and customize a design pattern","action":"Choose from Azure's recommended patterns (Orchestrator, Router, Evaluator, or Hybrid) based on your use case. Use the prompt template to generate a design document outlining components, decision logic, and error handling. Validate the pattern with stakeholders.","tip":"For complex workflows, the Hybrid pattern often works best. Use Azure's pattern documentation (e.g., 'Orchestration Patterns for Agentic AI') to compare trade-offs between patterns."},{"step":"Implement the system using Azure AI SDKs","action":"Translate the design into Python code using Azure's AI SDKs (e.g., `azure-ai-inference`, `azure-search-documents`). Start with a minimal viable version (e.g., a single agent) and iteratively add components like memory or tools. Deploy the LLM in Azure AI Studio with your chosen model (e.g., GPT-4o).","tip":"Use Azure Functions for lightweight tool integration (e.g., API calls) and Azure Container Apps for more complex agents. Leverage Azure Monitor for logging and debugging."},{"step":"Test and refine the agentic system","action":"Run end-to-end tests with synthetic data to validate the agent's behavior. Use Azure AI Content Safety to detect harmful outputs and refine prompts. Monitor performance metrics (e.g., response accuracy, latency) in Azure Application Insights.","tip":"Create a test suite with edge cases (e.g., ambiguous queries, API failures) to ensure robustness. Use Azure's prompt flow to iterate on agent prompts and tool configurations."},{"step":"Deploy and scale","action":"Deploy the system to Azure Kubernetes Service (AKS) or Azure Container Apps for scalability. Set up CI/CD pipelines (e.g., Azure DevOps) to automate deployments. Use Azure API Management to handle traffic spikes and enforce rate limits.","tip":"Start with a single region and expand to multi-region deployments if global latency is a concern. Use Azure Front Door for global load balancing and caching."}]
Automate customer support interactions using LLMs to provide instant responses.
Implement dynamic goal adjustment in AI systems based on real-time data inputs.
Create workflows that seamlessly transition between different applications to enhance productivity.
Develop AI agents that can autonomously manage and optimize business processes.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/microsoft/azure-genai-design-patternsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Design an agentic AI system for [USE_CASE] using Azure's generative AI design patterns. Follow these steps: 1) Select the most appropriate pattern from [PATTERN_OPTIONS: Orchestrator, Router, Evaluator, or Hybrid]. 2) Define the system's components including [COMPONENTS: LLM, memory, tools, API connections]. 3) Outline the agent's decision-making logic for handling [SPECIFIC_TASK]. 4) Specify error handling and fallback mechanisms. 5) Provide a Python code skeleton using Azure AI SDKs. Include comments for each section to explain the design choices.
### Agentic AI System Design for Customer Support Automation
**Pattern Selected:** Hybrid (Orchestrator + Router) — This combines the Orchestrator pattern for high-level task delegation with the Router pattern for dynamic routing of queries to specialized agents.
**System Components:**
- **LLM:** Azure OpenAI GPT-4o (deployed as `gpt-4o-2024-05-13` in Azure AI Studio)
- **Memory:** Azure Cosmos DB for structured conversation history and user preferences
- **Tools:** Azure AI Search for knowledge base retrieval, Azure Functions for ticketing system integration, and a custom sentiment analysis tool
- **API Connections:** Twilio API for SMS interactions, Salesforce REST API for ticket updates
**Decision-Making Logic:**
1. **Query Classification:** The system first routes the user's query using a lightweight classifier (fine-tuned `text-embedding-3-small` model) to determine intent (e.g., billing, technical support, account update).
2. **Specialized Agent Assignment:** Based on intent, the query is passed to the appropriate agent:
- **Billing Agent:** Handles payment queries using Azure AI Search to retrieve invoice data from SharePoint.
- **Technical Agent:** Uses a tool-calling LLM to execute diagnostic commands via Azure Functions, pulling logs from Azure Monitor.
- **Account Agent:** Updates user details by calling the Salesforce API.
3. **Fallback Mechanism:** If confidence scores for intent classification drop below 0.7, the query is escalated to a human agent via a Teams webhook.
**Error Handling:**
- **LLM Failures:** If the LLM returns an empty or invalid response, the system retries with a temperature of 0.3 and falls back to a predefined response template.
- **Tool Failures:** Failed tool calls trigger a retry with exponential backoff (1s, 2s, 4s) before escalating to human support.
- **API Rate Limits:** Implements Azure API Management policies to throttle requests and queue excess calls.
**Python Code Skeleton (Azure AI SDK):**
```python
from azure.ai.inference import ChatCompletionsClient
from azure.core.credentials import AzureKeyCredential
from azure.search.documents import SearchClient
from azure.cosmos import CosmosClient
# Initialize clients
llm_client = ChatCompletionsClient(
endpoint="https://[YOUR-AZURE-OPENAI-ENDPOINT].openai.azure.com/",
credential=AzureKeyCredential("[YOUR-AZURE-OPENAI-KEY]")
)
search_client = SearchClient(
endpoint="https://[YOUR-AZURE-SEARCH-ENDPOINT].search.windows.net",
index_name="support-knowledge-base",
credential=AzureKeyCredential("[YOUR-AZURE-SEARCH-KEY]")
)
# Agent orchestrator
class SupportAgent:
def __init__(self):
self.memory = CosmosClient("[YOUR-COSMOS-CONNECTION-STRING]").get_database_client("support-db")
def route_query(self, user_query: str) -> str:
# Step 1: Classify intent
intent = self._classify_intent(user_query)
# Step 2: Route to specialized agent
if intent == "billing":
return self._handle_billing(user_query)
elif intent == "technical":
return self._handle_technical(user_query)
else:
return self._handle_account(user_query)
def _classify_intent(self, query: str) -> str:
response = llm_client.complete(
messages=[{"role": "user", "content": f"Classify this query: '{query}'. Options: billing, technical, account."}],
model="gpt-4o",
temperature=0.1
)
return response.choices[0].message.content.strip().lower()
# Example usage
agent = SupportAgent()
response = agent.route_query("I need help with my recent invoice #INV-2024-00123")
print(response) # Output: "I see your invoice #INV-2024-00123. Let me retrieve the details..."
```AI-powered financial analysis and reporting
Microsoft's cloud platform for compute, storage, AI, and hybrid infrastructure
Your one-stop shop for church and ministry supplies.
Automate your browser workflows effortlessly
IronCalc is a spreadsheet engine and ecosystem
The new way to create a website
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan