Diagnosis of the cause of cerebral thrombi is vital for recurrence prevention but also challenging. The presence of the microbiome has recently been confirmed in thrombus, suggesting a novel approach to distinguish cerebral thrombi of different origins. However, little is known about whether there is heterogeneity in microbiological colonization of cerebral thrombi of different sources. Forty patients experiencing acute ischemic stroke were included and clinical data were collected. Metagenomic next-generation sequencing was adopted to detect bacterial and genomic signatures of human cerebral thrombi samples. We found similar species diversity between the large-artery atherosclerosis thrombi and cardioembolic thrombi but different species composition and distribution of cerebral thrombus microbiota. Compared with the group with cardioembolism, the group with large-artery atherosclerosis showed a significantly higher relative abundance of Ralstonia insidiosa among the top 10 bacterial species in cerebral thrombi. Twenty operational taxonomy units were correlated with 11 clinical indicators of ischemic stroke. The Gene Ontology enrichment analysis revealed 9 different enriched biological processes (translation and carbohydrate metabolic process, etc). The enriched Kyoto Encyclopedia of Genes and Genomes pathways included ribosome, butanoate metabolism, and sulfur metabolism. This study, based on the approach of metagenomic next-generation sequencing, provides a diagnostic microbiological method to discriminate individuals with cardioembolic thrombi from those with large-artery atherosclerosis thrombi with human cerebral thrombi samples. Our findings provide a fresh perspective on microbial heterogeneity of cerebral thrombi and demonstrate biological processes and pathway features of cerebral thrombi.