Antigen receptor genes exist in the germline in a "split" configuration and are assembled in developing B and T lymphocytes by V(D)J recombination. This site-specific recombination reaction is initiated by a complex containing the RAG1 and RAG2 proteins and completed by general DNA repair factors. RAG1 and RAG2, like the adaptive immune system itself, are found exclusively in jawed vertebrates, and are thought to have entered the vertebrate genome by horizontal transmission as components of a transposable element. This review discusses the structure of antigen receptor genes and the mechanisms by which they are assembled and diversified, and then goes on to consider the evolutionary implications of the arrival of the hypothetical "RAG transposon".