This study elucidates the autophagy-related gene signatures (PIK3R1, TRIM21, TRIM22, and ITPR3) in epilepsy and clarifies their association with immune infiltration and their role in anti-epileptic drug responsiveness, which provide a novel target for future therapeutic interventions and disease markers in epilepsy. This evidence concerns the gene TRIM22 and epilepsy.