The secondary metabolites of seawater and freshwater blue-green algae are a rich natural product pool containing diverse compounds with various functions, including antiviral compounds; however, high-efficiency methods to screen such compounds are lacking. Advanced virtual screening techniques can significantly reduce the time and cost of novel antiviral drug identification. In this study, we used a cyanobacterial secondary metabolite library as an example and trained three models to identify compounds with potential antiviral activity using a machine learning method based on message-passing neural networks. Using this method, 364 potential antiviral compounds were screened from >2000 cyanobacterial secondary metabolites, with amides predominating (area under the receiver operating characteristic curve value: 0.98). To verify the actual effectiveness of the candidate antiviral compounds, HIV virus reverse transcriptase (HIV-1 RT) was selected as a target to evaluate their antiviral potential. Molecular docking experiments demonstrated that candidate compounds, including kororamide, mollamide E, nostopeptolide A3, anachelin-H, and kasumigamide, produced relatively robust non-covalent bonding interactions with the RNase H active site on HIV-1 RT, supporting the effectiveness of the proposed screening model. Our data demonstrate that artificial intelligence-based screening methods are effective tools for mining potential antiviral compounds, which can facilitate the exploration of various natural product libraries.