|
| 1 | +# Semantic Kernel Agent for Warranty Claim Processing Using Azure AI Agent Service |
| 2 | + |
| 3 | +Sample warranty claim processing AI agent implemented with Azure AI Agent Service and Semantic Kernel. The workflow between Azure AI Agent Service agent and tools is orchestrated using the Semantic Kernel Process Framework. This demo showcases the capabilities of Azure in automating complex document-centric workflows. |
| 4 | + |
| 5 | +## Scenario Overview |
| 6 | + |
| 7 | +Contoso Electronics receives thousands of warranty claims monthly for consumer devices like computers, laptops, speakers, and home sensors. Each claim involves uploaded receipts, claim forms, and incident images—many of which require careful manual review to validate eligibility, redact sensitive information, and assess potential misuse or fraud. |
| 8 | + |
| 9 | +To improve operational efficiency, data privacy, and turnaround time, Contoso has adopted a multi-agent AI system built with Azure AI Agent Service and Semantic Kernel. |
| 10 | + |
| 11 | +This end-to-end solution automates the warranty claim workflow by orchestrating a specialized processusing the Semantic Kernel Process Framework: |
| 12 | +* **Document Intelligence step** invokes Azure AI Document Intelligence to scan and extract structured data from submitted claim forms. See a [sample warranty claim](assets/input/sample-claim-signed.png) in the `assets/input` folder. |
| 13 | +* **PII Redaction step** uses Azure AI Language Service to redact personally identifiable information (PII), enabling privacy-compliant processing, ensuring that downstream analysis remains bias-free, and minimizing the security risk of leaking sensitive customer data. |
| 14 | +* **Claim Assessment Agent step** executes an AI agent, built with Azure AI Agent Service, to verify warranty eligibility, detects anomalies, and analyze claim details. It then recommends next steps (e.g., approve, deny, request more info) and generates a concise summary for reviewers. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +With this automated solution, Contoso realizes the following benefits: |
| 19 | +* Rapid acceleration of claim processing by delegating laborious tasks to AI |
| 20 | +* Improved accuracy by reducing human error and enforcing consistency |
| 21 | +* Privacy assurance via redaction and responsible AI practices |
| 22 | +* Enterprise extensibility and flexibility, with the ability to add agents to the sequential workflow as new business needs emerge or independently upgrade agents’ implementation with minimal codebase modifications |
| 23 | + |
| 24 | +This use case can be adapted to similar document-heavy scenarios. |
| 25 | + |
| 26 | +## Getting Started |
| 27 | + |
| 28 | +### Prerequisites |
| 29 | + |
| 30 | +* [Python](https://www.python.org/downloads/) 🐍 |
| 31 | +* [`Azure.Accounts` Powershell module](https://www.powershellgallery.com/packages/Az.Accounts/4.0.2) might be required by the dependencies |
| 32 | + |
| 33 | +### Quickstart |
| 34 | + |
| 35 | +#### (Optional) Step 1: Create Azure AI Agent Service Agent |
| 36 | + |
| 37 | +*This step is optional. If you don't create an Azure AI Agent, the program will create one for you automatically.* |
| 38 | + |
| 39 | +1. Follow the official [Azure AI Agent Service documentation](https://learn.microsoft.com/azure/ai-services/agents/quickstart?pivots=ai-foundry-portal) to create the claims analysis agent (a chat completion agent). |
| 40 | +2. In the **Instructions** box, paste the contents of [claims_analysis_agent_instructions.md file](other_assets/claims_analysis_agent_instructions.md). |
| 41 | + |
| 42 | +#### Step 2: Create Azure AI Document Intelligence Resource |
| 43 | + |
| 44 | +1. Follow the official [Azure AI Document Intelligence documentation](https://learn.microsoft.com/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource) to create your resource. |
| 45 | +2. Optionally, test the resource in the AI Foundry portal. |
| 46 | + |
| 47 | +#### Step 3: Configure Application |
| 48 | + |
| 49 | +1. Provide the required secrets in the [src/config/config_secrets.py file](src/config/config_secrets.py). You can retrieve them from your resources or from AI Foundry portal. |
| 50 | +1. Setup the configuration variables in the [src/config/config.py file](src/config/config.py). You can retrieve them from your resources or from AI Foundry portal (e.g., in the *Agents* page for your Azure AI Agent Service agent). |
| 51 | + 1. Initially, the application defaults to mocked agents. Mock agents don't call the backend AI services; instead they operate on hardcoded data. This allows you to save the cost or reduce the latency when debugging. To remove mocking, set respective (or, all) mocking configuration variables `MOCK_*_STEP` to `False`. |
| 52 | + |
| 53 | +#### Step 4: Install Required Modules |
| 54 | + |
| 55 | +Run the following command to install modules used by the application: |
| 56 | +```sh |
| 57 | +pip install -r requirements.txt |
| 58 | +``` |
| 59 | + |
| 60 | +#### Step 5: Run Application |
| 61 | + |
| 62 | +Execute the application: |
| 63 | +```sh |
| 64 | +python src/template.py |
| 65 | +``` |
| 66 | + |
| 67 | +## Resources |
| 68 | + |
| 69 | +- Semantic Kernel [documentation](https://learn.microsoft.com/semantic-kernel/overview/) and [GitHub repo with source code](https://github.com/microsoft/semantic-kernel) |
| 70 | +- [Azure AI Agent Service documentation](https://learn.microsoft.com/azure/ai-services/agents/) |
| 71 | +- [Azure AI Document Intelligence documentation](https://learn.microsoft.com/azure/ai-services/document-intelligence) |
| 72 | +- [Azure AI Language documentation](https://learn.microsoft.com/azure/ai-services/language-service/overview) |
| 73 | +- [Azure AI Foundry documentation](https://learn.microsoft.com/azure/ai-foundry/) |
0 commit comments