Note: Please be advised that this sample repository is currently in Public Preview, with a lot of active development work taking place. Please expect breaking changes as we continue to iterate.
We really appreciate your feedback! If you encounter any issue or error, please report issues to us following the Supporting Guide. Meanwhile you can make recording of your journey with our product, they really make the product better. Thank you!
This warning will be removed when the samples are ready for production.
Chatbots on Microsoft Teams are an easy way to provide answers to frequently asked questions by users. However, most chatbots fail to engage with users in a meaningful way because there is no human in the loop when the chatbot fails to answer a question well.
FAQ Plus bot is a friendly Q&A bot that brings a human in the loop when it is unable to help. A user can ask the bot a question and the bot responds with an answer if it's in the knowledge base. If not, the bot offers the user an option to "Ask an expert", which posts the question to a pre-configured team of experts to provide support. An expert can assign the question to themself, chat with the user to gain more context.
Here are some screenshots showing FAQ Plus in action:
- A user interacting with FAQ Plus through chat:
- Expert using FAQ Plus:
- NodeJS, fully tested on NodeJS 12, 14
- An M365 account. If you do not have M365 account, apply one from M365 developer program
- Visual Studio Code
- Teams Toolkit Visual Studio Code Extension
- An Azure subscription
- How to use TeamsFx to build a bot app.
- How to connect a Teams bot to an external system.
- How to use the Teams Toolkit to provision and deploy your app to Azure.
- FAQ Plus Bot relies on the 'QnA Maker' Azure services. Before you start, follow the instructions to create an Azure AD app.
- Open project in Visual Studio Code, ensure you have installed Teams Toolkit Visual Studio Code Extension
- Open the command palette by pressing
Ctrl+Shift+P / ⌘⇧-P or View -> Command - Palette
and select:Teams: Provision in the cloud
. If you have not logged in with your Azure Account, you will be asked to login and select a subscription to provision resources for this Bot. - Once provision is completed, follow the instructions to configure Azure AD app, create qna maker and configure the FAQ Plus app.
- Open the command palette and select:
Teams: Deploy to the cloud
. - To install and run the app, in Visual Studio Code, open
Run and Debug
tab and selectLaunch Remote (Edge)
orLaunch Remote (Chrome)
in the dropdown list. Then pressF5
or click green arrow button to launch Teams client in browser. Log in to Teams and clickAdd
button to install the app to your Teams client. - Your app is successfully running in your Teams client now, refer to 'Use the App' section below to interact with the app.
- Open project in Visual Studio Code, ensure you have installed Teams Toolkit Visual Studio Code Extension
- Follow the instcution to get necessary info. You need to use them in the next step.
- Create
bot/.env.teamsfx.local
file. Fill values for following environment variables. Note: You should get all these values in previous step.SCORETHRESHOLD=0.5 STORAGECONNECTIONSTRING= QNAMAKERAPIENDPOINTURL= QNAMAKERHOSTURL= QNAMAKERSUBSCRIPTIONKEY=
- To install and run the app, in Visual Studio Code, open
Run and Debug
tab and selectDebug (Edge)
orDebug (Chrome)
in the dropdown list. Then pressF5
or click green arrow button to launch Teams client in browser. Log in to Teams and clickAdd
button to install the app to your Teams client. - Your app is successfully running in your Teams client now, refer to 'Use the App' section below to interact with the app.
- The Bot will send out Welcome Message to kick off the conversation.
- You can just ask any question.
- Once receive questions, the Bot will search the QnA knowledge base to find answers. You can click 'Ask an expert' if Bot doesn't solve your questions well.
- Click "Ask an expert" button to escalate your question to an expert, fill in required information and click "Ask an expert" again to create a ticket.
WARNING: To enable "Ask an expert" feature, you will need to install the app to a Teams Channel for expert to receive ticket creation notification. Note that this Teams Channel must be a Channel of the Team configured in your FAQ Plus configuration app in this doc.
To install the FAQ Plus app to Teams Channel, you can terminate the current F5 session (just close the web browser), and launch a new F5 session to install app to Teams Channel by clicking "Add to a team"..
Experts can receive Bot notifications from Teams Channel. An expert can assign the questions to themselves, initiate chat with the user to gain more context.
- To enable the feature for expert, add the Bot to a Teams Channel for expert group.
- When user 'Ask an expert', a support ticket is created and posted to experts Teams Channel.
- Click "Chat with xxx" to initiate a chat with the user who asked for help. Note: if the support ticket is created by yourself, you cannot use this feature to chat with yourself.
- Click "Change status" button to change the status of the support ticket. The user who created the ticket will receive status change notification from the bot.
- Click 'View article' to search related answers from Knowledge base for some reference.
Thoughts? Questions? Ideas? Bugs and other code issues? Share them with us on GitHub Issues!
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.