Skip to content

ravindersirohi/GenAI-Teams-Bot-RAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Useful Microsoft Links

API Testing with Postman

You can test the Orchestrator API (ClaimAgent) using Postman or any REST client. Below is an example for the /api/claim-chat endpoint:

Orchestrator Endpoint

  • URL: http://localhost:7192/api/claim-chat
  • Method: POST
  • Headers:
    • Content-Type: application/json

Sample Request Body

{
	"ConversationId": "test-conv-1",
	"UserId": "user-123",
	"UserMessage": "I want to file a claim for my car accident.",
	"ChannelId": "teams",
	"Metadata": {
		"claimType": "auto",
		"locale": "en-US"
	}
}

Sample Postman Steps

  1. Open Postman and create a new POST request to http://localhost:7192/api/claim-chat (adjust port if needed).
  2. Set the request body to raw and select JSON.
  3. Paste the sample request body above.
  4. Click Send.
  5. You should receive a response similar to:
{
	"assistantReply": "...AI-generated response...",
	"messages": [
		{ "role": "system", "content": "..." },
		{ "role": "user", "content": "I want to file a claim for my car accident." },
		{ "role": "assistant", "content": "...AI-generated response..." }
	]
}

Note:

  • The API must be running locally (dotnet run in source/ClaimAgent).
  • Adjust the port if you changed it in launchSettings.json.
  • You can add authentication headers if your deployment requires it.

AI Claim Integration

AI Claim Integration is a cloud-native solution for automating and orchestrating insurance claim processing using Azure services, .NET, and AI. The project integrates multiple microservices, bots, and background workers to streamline claim handling, leveraging Azure OpenAI, Redis, Azure Storage, and more.

Key Components

  • ClaimAgent: Azure Functions app for orchestrating chat-based claim workflows using OpenAI, Azure Storage, and Semantic Kernel for advanced AI orchestration.
  • ClaimTeamsAgent: Microsoft Teams bot for interacting with users, collecting claim information, and forwarding messages to the orchestrator API for processing.
  • ClaimWorkerService: Background worker for processing claim data, embedding, and vector storage.
  • Infrastructure: Terraform scripts for provisioning Azure resources (resource groups, storage, Redis, Key Vault, Cognitive Services, etc).

Getting Started

Prerequisites

Setup

  1. Clone the repository

    git clone <repo-url>
    cd ai-claim-integration
  2. Provision Infrastructure

    • Update variables in infra/terraform-vars/dev.terraform.tfvars as needed.
    • Run Terraform:
      cd infra
      terraform init
      terraform plan -var-file="terraform-vars/dev.terraform.tfvars"
      terraform apply -var-file="terraform-vars/dev.terraform.tfvars"
  3. Configure Environment

    • Set required environment variables (see local.settings.json and appsettings.json in each service for details).
    • Ensure Azure resources (Storage, Redis, Key Vault, etc.) are provisioned and accessible.
  4. Build and Run Services

    • Each service (ClaimAgent, ClaimTeamsAgent, ClaimWorkerService) can be built and run independently:
      cd source/ClaimAgent
      dotnet build
      dotnet run
      Repeat for other services as needed.

Build and Test

  • Build: Use dotnet build in each service directory.
  • Run Locally: Use dotnet run or configure launch profiles in Visual Studio.
  • Unit/Integration Tests: (Add test instructions if available.)

Contribute

Contributions are welcome! Please open issues or submit pull requests for improvements, bug fixes, or new features.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a pull request

For major changes, please open an issue first to discuss your proposal.

License

This project is licensed under the MIT License.

References

Architecture Details

Semantic Kernel

Semantic Kernel is an open-source SDK from Microsoft that enables integration of AI models (like Azure OpenAI) with traditional programming logic. In this project, Semantic Kernel is used within the ClaimAgent to:

  • Orchestrate chat-based workflows using large language models (LLMs)
  • Manage conversation history and context
  • Integrate retrieval-augmented generation (RAG) by injecting claim data into the conversation
  • Enable advanced prompt engineering and memory management

How it works here:

  • The Orchestrator service uses Semantic Kernel to build a chat history, inject system prompts, and call Azure OpenAI for chat completions.
  • Claim data is loaded from Azure Blob Storage and provided as context to the LLM, improving the accuracy and relevance of responses.
  • Conversation memory is stored in Redis for continuity across user sessions.

Teams Bot (ClaimTeamsAgent)

The Teams bot enables users to interact with the claim system directly from Microsoft Teams. It:

  • Receives user messages and claim details
  • Forwards messages to the Orchestrator API for processing
  • Returns AI-generated responses and claim status updates to the user
  • Logs user and conversation details for traceability

Key features:

  • Built using the Microsoft Bot Framework and Teams SDK
  • Supports authentication and secure communication with backend APIs
  • Can be extended to support adaptive cards, notifications, and more

Orchestration API (ClaimAgent Orchestrator)

The Orchestrator API is the core logic engine that:

  • Receives requests from the Teams bot and other clients
  • Uses Semantic Kernel to manage conversation flow and AI completions
  • Maintains conversation state and memory in Redis
  • Loads claim data from Azure Blob Storage for RAG
  • Returns structured responses and conversation history

Typical flow:

  1. User sends a message in Teams
  2. Teams bot forwards the message to the Orchestrator API
  3. Orchestrator builds the chat context, injects claim data, and calls Azure OpenAI via Semantic Kernel
  4. The response is stored and sent back to the user via the bot

For more details, see the source code in source/ClaimAgent/Services/Orchestrator.cs, source/ClaimTeamsAgent/Bots/TeamsAgentBot.cs, and related files.

About

Integrate Microsoft Teams with GenAI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors