The sense of smell enables animals to detect and react to long-distance cues according to internalized valences. Odors evoke responses from olfactory receptor neurons (ORNs), whose activities are integrated and processed in olfactory glomeruli and then relayed by projection neurons (PNs) to higher brain centers. The wiring diagram with synaptic resolution, which is unknown for any glomerular olfactory system, would enable the formulation of circuit function hypotheses to explain physiological and behavioral observations. Here, we have mapped with electron microscopy the complete wiring diagram of the left and right antennal lobes of Drosophila larva, an olfactory neuropil similar to the vertebrate olfactory bulb. We found two parallel circuits processing ORN inputs. First, a canonical circuit that consists of uniglomerular PNs that relay gain-controlled ORN inputs to the learning and memory center (mushroom body) and the center for innate behaviors (lateral horn). Second, a novel circuit where multiglomerular PNs and hierarchically structured local neurons (LNs) extract complex features from odor space and relay them to multiple brain areas. We found two types of panglomerular inhibitory LNs: one primarily providing presynaptic inhibition (onto ORNs) and another also providing postsynaptic inhibition (onto PNs), indicating that these two functionally different types of inhibition are susceptible to independent modulation. The wiring diagram revealed an LN circuit that putatively implements a bistable gain control mechanism, which either computes odor saliency through panglomerular inhibition, or allows a subset of glomeruli to respond to faint aversive odors in the presence of strong appetitive odor concentrations. This switch between operational modes is regulated by both neuromodulatory neurons and non-olfactory sensory neurons. Descending neurons from higher brain areas further indicate the context-dependent nature of early olfactory processing. The complete wiring diagram of the first olfactory neuropil of a genetically tractable organism will support detailed experimental and theoretical studies of circuit function towards bridging the gap between circuits and behavior.