Based on a variable-coefficient Kadomtsev–Petviashvili (KP) equation, the topographic effect on the wave interactions between two oblique internal solitary waves is investigated. In the absence of rotation and background shear, the model set-up featuring idealised shoaling topography and continuous stratification is motivated by the large expanse of continental shelf in the South China Sea. When the bottom is flat, the evolution of an initial wave consisting of two branches of internal solitary waves can be categorised into six patterns depending on the respective amplitudes and the oblique angles measured counterclockwise from the transverse axis. Using theoretical multi-soliton solutions of the constant-coefficient KP equation, we select three observed patterns and examine each of them in detail both analytically and numerically. The effect of shoaling topography leads to a complicated structure of the leading waves and the emergence of two types of trailing wave trains. Further, the case when the along-crest width is short compared with the transverse domain of interest is examined and it is found that although the topographic effect can still modulate the wave field, the spreading effect in the transverse direction is dominant.