CLIENT: "We have a database with over 2,700 email addresses for doctors, but we don't really know who these contacts actually belong to. For some addresses, we are not sure if they are still active, and mostly we don't know if they are specific doctors, or just general contacts for receptions, clinics, or institutions. We need to remove universal emails like info@ or reception@ and work only with real doctors. For doctors, we need to know exactly what their specialization or qualification is. Today we solve this manually – someone searches for each email on the internet, goes through several websites and tries to guess who it is from the available information. It is slow, demanding, and unsustainable in the long run. We are looking for a way to automate this process and get reliable data in a reasonable time."
The project arose from the need to effectively work with a large database of medical contacts, where there was a lack of certainty regarding the relevance of individual email addresses and the professional specialization of the addressed persons. Manual verification was extremely time-consuming given the volume of data, and with the growing number of records, the error rate caused by fatigue and monotonous work also increased.
Therefore, the goal of the project was not only to speed up the existing process but to fundamentally change the way of working. First, it was necessary to separate general and institutional contacts from real doctors and then reliably determine their specialization for valid contacts. Such cleaned data was to serve as a quality basis for further recruitment and business activities of the personnel agency.
The solution design utilized a combination of automated web search, AI analysis, and a simple script architecture. Information that is commonly traceable manually was systematically searched and evaluated by a machine. Thanks to this, it was possible to process the entire dataset within approximately two hours instead of several weeks of manual work.
The solution was implemented as a one-time executable Python script that acts as the orchestrator of the entire process. The script works over a PostgreSQL database, from where it gradually loads unprocessed records containing an email address and context data.
To obtain information from the internet, the Tavily API is used, which ensures targeted web searching. The obtained results are merged into a text context and passed to the OpenAI language model for further analysis.
The OpenAI model classifies the contact into pre-defined categories (general practitioner, pediatrician, specialist, general contact, inactive record) and returns the result in a structured JSON format. This result is subsequently saved back to the database.
The entire process runs in batches with a controlled pace due to API limits (the Tavily free tier model was used). Configuration of the database, API keys, and the prompt itself is handled via environment variables, which allows for easy adaptation of the solution to other datasets.
| Client Industry | HR Agency |
| Area | Recruiting |
| Technologies used | Python, Tavily, OpenAI, PostgreSQL |
| Implementation time | 1 day |
| Savings | 180 hours |