Neural representations of head direction have been discovered in many different species. A large body of theoretical work has proposed that the dynamics associated with these representations might be generated, maintained, and updated by recurrent network structures called ring attractors. Ring attractor models rely on specific assumptions about the structure of excitatory and inhibitory connectivity. These assumptions have been difficult to test directly. We therefore performed electron-microscopy-based circuit reconstruction and RNA profiling of identified cell types in the heading direction system of Drosophila melanogaster to directly examine excitatory and inhibitory synaptic connectivity, generating a dataset that should serve as a reference for future functional studies of the network. Consistent with several theoretical models, we identified network motifs that have been hypothesized to maintain the heading representation in darkness, update it when the animal turns, and tether it to visual cues. Genetically targeted two-photon calcium imaging and thermogenetic perturbation of the constituent neuron types during behavior provided additional support for these functional roles. However, we also discovered network motifs absent in current models, including a surprising degree of recurrence between arbors of different neurons with mixed pre-and post-synaptic specializations. Overall, our results confirm that the Drosophila heading direction network contains the core components of a ring attractor while also revealing unpredicted structural features that might enable the heading system to accurately track the animal's heading with a small number of neurons. Importantly, however, these and other models of attractor networks in the fly have assumed the circuit's connectivity based on relatively indirect evidence (Cope et al., 2017;Han et al., 2019;Kakaria and de Bivort, 2017;Kim et al., 2017;Su et al., 2017;Turner-Evans et al., 2017). For example, the location of pre-and post-synaptic arbors has been inferred from whether neural processes visible in light-microscopic images seem spine-or bouton-like in specific substructures (Hanesch et al., 1989;Lin et al., 2013;Wolff et al., 2015). The hypothesized connectivity of the circuit has then been derived from light-level overlap between the putatively pre-and post-synaptic arbors of neurons . In Drosophila, such conclusions have been bolstered by employing GFP-reconstitution-acrosssynaptic-partners (GRASP) (Xie et al., 2017) and trans-Tango (Omoto et al., 2018) techniques. Although both GRASP and trans-Tango are powerful techniques, their reliability and accuracy when used to estimate pairwise connectivity is limited (Lee et al., 2017; Talay et al., 2017). Similarly, measurements of functional connectivity by optogenetic stimulation of one neuron type and calcium imaging of another (Franconville et al., 2018) cannot conclusively establish the presence or absence of monosynaptic connectivity.In the current study, we established the synaptic-and cellular-resolution str...