User–item interactions on e-commerce platforms involve various intents, such as browsing and purchasing, which require fine-grained intent recognition. Existing recommendation methods incorporate latent intent into user–item interactions; however, they overlook important considerations. First, they fail to integrate intents with semantic information in knowledge graphs, neglecting intent interpretability. Second, they do not exploit the structural information from multiple views of latent intents in user–item interactions. This study established the intent with knowledge-aware multiview contrastive learning (IKMCL) model for explanation in recommendation systems. The proposed IKMCL model converts latent intent into fine-grained intent, calculates intent weights, mines latent semantic information, and learns the representation of user–item interactions through multiview intent contrastive learning. In particular, we combined fine-grained intents with a knowledge graph to calculate intent weights and capture intent semantics. The IKMCL model performs multiview intent contrastive learning at both coarse-grained and fine-grained levels to extract semantic relationships in user–item interactions and provide intent recommendations in structural and semantic views. In addition, an intent-relational path was designed based on multiview contrastive learning, enabling the capture of semantic information from latent intents and personalized item recommendations with interpretability. Experimental results using large benchmark datasets indicated that the proposed model outperformed other advanced methods, significantly improving recommendation performance.