BackgroundRhizobia are alpha-proteobacteria commonly found in soil and root nodules of legumes. It was recently reported that nitrogen-fixing rhizobia also inhabit legume seeds. In this study, we examined whole-genome sequences of seven strains of rhizobia isolated from seeds of common bean (Phaseolus vulgaris).ResultsRhizobial strains included in this study belonged to three different species, including Rhizobium phaseoli, R. leguminosarum, and R. grahamii. Genome sequence analyses revealed that six of the strains formed three pairs of highly related strains. Both strains comprising a pair shared all but one plasmid. In two out of three pairs, one of the member strains was effective in nodulation and nitrogen fixation, whereas the other was ineffective. The genome of the ineffective strain in each pair lacked several genes responsible for symbiosis, including nod, nif, and fix genes, whereas that of the effective strain harbored the corresponding genes in clusters, suggesting that recombination events provoked gene loss in ineffective strains. Comparisons of genomic sequences between seed strains and nodule strains of the same species showed high conservation of chromosomal sequences and lower conservation of plasmid sequences. Approximately 70% of all genes were shared among the strains of each species. However, paralogs were more abundant in seed strains than in nodule strains. Functional analysis showed that seed strains were particularly enriched in genes involved in the transport and metabolism of amino acids and carbohydrates, biosynthesis of cofactors and in transposons and prophages. Genomes of seed strains harbored several intact prophages, one of which was inserted at exactly the same genomic position in three strains of R. phaseoli and R. leguminosarum. The R. grahamii strain carried a prophage similar to a gene transfer agent (GTA); this represents the first GTA reported for this genus.ConclusionsSeeds represent a niche for bacteria; their access by rhizobia possibly triggered the infection of phages, recombination, loss or gain of plasmids, and loss of symbiosis genes. This process probably represents ongoing evolution that will eventually convert these strains into obligate endophytes.Electronic supplementary materialThe online version of this article (10.1186/s12864-018-5023-0) contains supplementary material, which is available to authorized users.