BackgroundEpilepsy is the second most prevalent neurological disease. Although there are many antiseizure drugs, approximately 30% of cases are refractory to treatment. Temporal lobe epilepsy (TLE) is the most common epilepsy subtype, and previous studies have reported that hippocampal inflammation is an important mechanism associated with the occurrence and development of TLE. However, the inflammatory biomarkers associated with TLE are not well defined.MethodsIn our study, we merged human hippocampus datasets (GSE48350 and GSE63808) through batch correction and generally verified the diagnostic roles of inflammation-related genes (IRGs) and subtype classification according to IRGs in epilepsy through differential expression, random forest, support vector machine, nomogram, subtype classification, enrichment, protein‒protein interaction, immune cell infiltration, and immune function analyses. Finally, we detected the location and expression of inhibitor of metalloproteinase-1 (TIMP1) in epileptic patients and kainic acid-induced epileptic mice.ResultsAccording to the bioinformatics analysis, we identified TIMP1 as the most significant IRG associated with TLE, and we found that TIMP1 was mainly located in cortical neurons and scantly expressed in cortical gliocytes by immunofluorescence staining. We detected decreased expression of TIMP1 by quantitative real-time polymerase chain reaction and western blotting.ConclusionTIMP1, the most significant IRG associated with TLE, might be a novel and promising biomarker to study the mechanism of epilepsy and guide the discovery of new drugs for its treatment.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12974-023-02837-3.