|

|  How to Integrate Rasa with Microsoft Teams

How to Integrate Rasa with Microsoft Teams

January 24, 2025

Discover step-by-step instructions to seamlessly integrate Rasa with Microsoft Teams, enhancing collaboration through intelligent chatbots.

How to Connect Rasa to Microsoft Teams: a Simple Guide

 

Setup Your Rasa Bot

 

  • Ensure your Rasa bot is up and running. You need a trained Rasa model to respond to user queries.
  •  

  • Start your Rasa server using the command below. This will serve your Rasa assistant on the localhost.

 

rasa run --enable-api

 

 

Create a Microsoft Teams App

 

  • Access the Microsoft Teams Developer Portal with your Microsoft account.
  •  

  • Click on "Create a new app" and provide a name and other necessary details like package name, app ID, etc.

 

 

Configure the Bot Framework

 

  • Navigate to Microsoft Bot Framework portal and log in with your account.
  •  

  • Register a new bot and fill in the required details such as bot handle and messaging endpoint. The endpoint should point to the publicly accessible URL where your Rasa server is accessible.
  •  

  • Obtain your Microsoft App ID and Microsoft App Password. These will be used in your integration setup.

 

 

Middleware Setup to Relay Messages to Rasa

 

  • Create a middleware application that communicates between Microsoft Teams and your Rasa server. You can use platforms such as Flask or Express.js for this purpose.

 

from flask import Flask, request
import requests

app = Flask(__name__)

@app.route('/bot', methods=['POST'])
def bot_message():
    incoming_message = request.json
    # Process incoming message here
    # Relay to Rasa
    response = requests.post('http://localhost:5005/webhooks/rest/webhook', json=incoming_message)
    return response.json()

if __name__ == '__main__':
    app.run(port=3978)

 

 

Deploy Your Middleware

 

  • Use services like Heroku, AWS, or Azure to deploy your middleware application so it's publicly accessible.
  •  

  • Ensure the endpoint URL of the deployed middleman application is registered in the Microsoft Bot Framework as the Messaging endpoint.

 

 

Test the Integration

 

  • Use the Microsoft Teams client to add your bot by searching for the app name you provided.
  •  

  • Test messaging functionality to ensure messages from Teams reach your Rasa bot and provide appropriate responses back to the Teams client.

 

 

Debugging and Logging

 

  • Implement logging within your middleware to capture incoming and outgoing requests for debugging purposes.
  •  

  • Use Developer Tools in Microsoft Teams to observe network activity and debug potential issues with message routes and responses.

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi.

How to Use Rasa with Microsoft Teams: Usecases

 

Use Case: Enhancing Team Communication with Rasa and Microsoft Teams

 

  • Teams can benefit greatly from integrating Rasa with Microsoft Teams. This setup can streamline internal communication and improve information dissemination.
  •  

  • With a Rasa chatbot in MS Teams, employees can easily access HR policies, IT helpdesk support, or sales statistics without disrupting ongoing conversations.

 

Benefits of Integration

 

  • By leveraging the AI capabilities of Rasa, the chatbot can provide prompt and accurate answers to common queries, enhancing employee productivity.
  •  

  • The integration allows employees to use natural language, making the tool easy to use for non-technical staff.

 

Implementing the Solution

 

  • Set up the Rasa server and configure endpoints to integrate with Microsoft Teams.
  •  

  • Create Rasa models trained with organizational-specific intents and entities to ensure the responses are relevant to your team’s needs.

 

rasa run --enable-api

 

Customizing Chatbot Responses

 

  • Create customized responses in Rasa based on frequently asked queries within your organization. This could range from "What are our core working hours?" to "How can I reset my password?"
  •  

  • Leverage Microsoft Teams' adaptive cards to enhance the interactivity of responses.

 

utter_welcome:
  - text: "Hello! How can I assist you today?"
    buttons:
      - title: "HR Policies"
        payload: "/hr_policies"

 

Sustaining Usage and Adoption

 

  • Gather feedback through surveys or direct interaction to iteratively improve the chatbot over time.
  •  

  • Continuously train the Rasa model with new data and use cases to adapt to evolving organizational requirements.

 

 

Use Case: Streamlining Project Management with Rasa and Microsoft Teams

 

  • Integrating Rasa with Microsoft Teams can significantly enhance project management processes by automating task allocation, updating project statuses, and retrieving project-related information effortlessly.
  •  

  • A Rasa-powered bot can serve as a project management assistant within Teams, helping team members to keep track of project tasks, deadlines, and deliverables.

 

Highlights of the Integration

 

  • The Rasa bot can send reminders and notifications for upcoming deadlines, ensuring the team stays on track.
  •  

  • Users can query the bot to get real-time updates on project progress, reducing the need for regular status meetings.

 

Implementing the Integration

 

  • Set up a Rasa server and connect it with Microsoft Teams using the appropriate connectors and APIs.
  •  

  • Develop Rasa models tailored to capture and understand project-oriented conversations, such as task queries and deadline updates.

 

rasa run --connector microsoft-teams

 

Enhancing Bot Interaction

 

  • Design intuitive conversation flows in Rasa to facilitate task creation, assignment, and tracking directly from within Microsoft Teams.
  •  

  • Utilize Teams’ adaptive cards to display project data in a more appealing and actionable format.

 

utter_task_status:
  - text: "Here are the current project statuses. Which project would you like to know more about?"
    buttons:
      - title: "Project Alpha"
        payload: "/project_alpha_status"

 

Promoting Adoption and Efficiency

 

  • Engage team members in regular training sessions to familiarize them with the capabilities of the bot, encouraging its use in daily project management activities.
  •  

  • Collect feedback to continually refine bot interactions, ensuring they meet the changing needs of project workflows.

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded