RAG chatbot in Teams, to transform the knowledge base

Managing procedures is often complex: the information is there, but it is not always easy to find, and this greatly slows down decision-making and the operation of a business. One of our clients asked us for an easier way to access company information and our solution was to integrate a chatbot based on Retrieval-Augmented Generation into Microsoft Teams, the work app most used by staff. Here's how it went.

RAG chatbot in Teams, to transform the knowledge base

The customer's problem: retrieving information from internal procedures

Our client, a global group operating in the pharmaceutical and medical sector, faced significant difficulties in retrieving the information contained in internal procedures.

The biggest critical issues emerged in the daily lives of workers, who needed to consult regulatory documents and company guidelines to carry out their tasks, but access to such content was slow and fragmented.

There was no structured knowledge base to facilitate this task.

The documents were in fact distributed in different repositories and the company lacked a centralized system that would allow them to be organized and updated in a uniform way.

This entailed:

  • delays in decisions;
  • slowdowns in processes;
  • a growing sense of frustration among staff.

Our solution: integrating a RAG chatbot into Microsoft Teams

To meet this pressing need, we have designed a solution that involves the integration of a chatbot based on Retrieval-Augmented Generation (more simply, RAG) into Microsoft Teams, the application used every day by most employees.

We started with the creation of a document repository in Azure AI Search, where the most sought after business procedures were organized.

The repository was then configured to allow our chatbot to access documents in real time, read their contents and return relevant answers to questions formulated in natural language.

Users can then ask the chatbot questions such as:

  • “Where do I find laboratory safety guidelines?”
  • “What is the procedure for reporting an adverse event?”
  • “What do I need to do to start working with a new vendor?”

Whatever the question, the system retrieves the documents from the repository (which plays the role of knowledge base here), interprets the data and provides contextualized answers in a few seconds, accompanied by links to the reference documentation.

Another benefit?

The entire process takes place without ever leaving Teams, thus eliminating the need to consult infinite files of procedures dispersed in the corporate digital workplace.

What is RAG, and how does it work?

We've talked about Retrieval-Augmented Generation, but maybe not everyone knows what it is.

The Retrieval-Augmented Generation is a technology that stems from the integration between large language models and intelligent search engines. If traditional generative models, such as ChatGPT, are based on generic and static knowledge, the RAG adds an additional element: the ability to connect to a knowledge base to provide relevant, contextualized and always updated answers.

In practice, when a user asks a question, the system does not just “remember” what they learned during training, but searches the documents included in the knowledge base for the most suitable answer.

The mechanism is not too complicated.

The procedures are divided into smaller sections, transformed into numerical vectors that represent their meaning and stored in a specialized search engine (such as Azure AI Search).

The user's question is in turn converted into a vector and compared with the index: here, in a few moments, the most relevant sections of the documents are retrieved and passed to the generative model, which constructs its response using only business sources.

The result is a virtual assistant capable of combining the naturalness of ChatGPT style answers with the reliability of the information present in the internal procedures.

Instead of providing a generic answer to a question like “What is the remote work policy?”, the system draws on the dedicated section of the company guidelines to return precise information, accompanied by links to the documentation for carrying out checks or insights.

We could therefore say that RAG allows AI to become a really useful tool for everyday work.

To learn more about this technology, check out our project ”Retrieval-Augmented Generation, with Azure OpenAI”.

The results obtained

The implementation took place quickly, thanks to:

  • Template by our team, capable of accelerating the development of customized RAG solutions. This is an approach that allows us to create new RAG projects using an already tested structure.
  • Simplified user interface for interacting with the chatbot.
  • Integration with Microsoft Teams, an app already widely adopted in the company.

In addition to this, the customer experienced additional benefits.

The time needed to search for information has been reduced considerably, to a few seconds thanks to the chatbot's answers, based exclusively on verified documentation.

As a result, the productivity of teams and individual workers has increased, who can now focus on their activities without wasting time and energy consulting lengthy scattered procedures.

Perhaps, however, the most important result we have obtained concerns the creation of a structured knowledge base, finally accessible in a simple and centralized way.

Thanks to the chatbot, integrated into Microsoft Teams, all staff can access documents without leaving their work environment, immediately finding the information of interest in an always-updated repository.

Get in touch with the team

Modern Apps

The Modern Apps team responds swiftly to IT needs where software development is the core component, including solutions that integrate artificial intelligence. The technical staff is trained specifically in delivering software projects based on Microsoft technology stacks and has expertise in managing both agile and long-term projects.