Optimizing Medical Leave Management with Make and PrivateGPT

,

:robot: Lee este artículo en español :es: en LinkedIn:
Automatización con Make y IA en un entorno seguro

Integrating artificial intelligence (AI) in businesses often sparks internal debates. Some companies have even gone to the extreme of banning AI tools like ChatGPT for fear of confidential information leaks.

However, information safety is not the only concern; it is also necessary to align these tools with current laws and regulations in each country.

Therefore, finding a balance between innovation propelled by AI and respect for privacy regulations is crucial. This requires consistent corporate and government dialogue to set clear guidelines.

A few weeks ago, I shared an article titled “Optimizing Medical Leave Management with Make and OpenAI,” where I detailed how you can create an automated process in Make to handle medical licenses. If you missed it, you can read it here.

For those who still have reservations about AI use due to privacy concerns, this article is for you.

Here, I’ll show you how you can reproduce the medical license process using a private AI model - PrivateGPT.

All shared data are protected in an environment controlled by the company, with no data transferred outside this setting.

Technology Stack to be used

The tools and services to be used are the same ones we used in the original article, with the difference being that we’ll replace OpenAI with PrivateGPT. Additionally, we will use:

  • Google Workspace, to manage the organization.
  • Slack, Gmail and Google Task, as notification channels.
  • Google Drive, as a storage space for the different files involved.
  • Buk, the human resources software that centralizes people management.

Use of PrivateGPT in a private setting

In this case, we’ll use PrivateGPT, which Private AI developed. It’s designed to strengthen privacy when using ChatGPT. You can find more information here.

A significant advantage of PrivateGPT is that it allows you to take advantage of the Large Language Model (LLMs) capabilities without risking exposure to sensitive information.

However, a potential downside is that it requires effort to install and integrate with external systems.

Note: PrivateGPT isn’t on Make module; however, it has an API that I will use to create the automated process in Make.

Proof of Concept: Automation Created with Make and AI in a Private Environment

Step 1: PrivateGPT Installation

Install PrivateGPT on your personal computer or your company’s server. Once you run it, it will generate a local IP address on port 8001. Through Ngrok, we expose our local environment to the internet, so Make can connect with our local machine.

Step 2: Modification of the Make Scenario

Modify the Make scenario, removing the OpenAI modules and adding the HTTP modules that will consume PrivateGPT’s four endpoints.

In the image of the new process, you will see the elimination of the OpenAI modules, and in their place, 4 HTTP modules have been incorporated. These modules use the following 4 endpoints:

List Documents:
Before submitting a new PDF document with the medical license, it is necessary to list the documents that PrivateGPT currently holds. These documents will be deleted before uploading a new file.

Therefore, the first HTTP module uses the endpoint /v1/ingest/list, which provides us with the
list of documents to delete.

Delete Documents
Now, we proceed to delete each document that the previous endpoint returned to us. To perform this action, we use the iterator module to traverse the list of documents and obtain their identifiers. These identifiers are later used in another HTTP module that enables deletion of the document.

In this new HTTP module, we make use of the endpoint /v1/ingest/[ID], where [ID] represents the identifier of the file that will be deleted.

Upload New Document
Once we have deleted the previous documents, we proceed to upload the new PDF document corresponding to the newly received medical license by mail. To carry out this process, we use the /v1/ingest/file endpoint in an additional HTTP module, selecting the file attached to the Gmail module.

License Data Extraction
Finally, it is necessary to execute the endpoint /v1/completions, sending it the prompt with the data that we want to obtain from the document, along with the identifier of the file that we had previously loaded.

Once we’ve made these changes, we’ve created a new process using PrivateGPT.

This guarantees higher safety and privacy in managing medical license document information.

3 Likes