Floods and droughts force over 25 million people into poverty annually, 30 times more than all other natural disasters combined (WB 2017). Developing a reservoir system to mitigate these risks requires an integrated understanding of long-term variability in supply and how supply and demand coincide within each year and spatially along river basins. We present a new county-resolution water-energy-food model of the United States, called AWASH, to study the risks and potential of the reservoir system. To understand the full range of variability, we develop a paleo-reconstruction of 500 years of monthly stream flows at over 3000 points across the US river network. This reconstruction uncovers long periods of drought, and the full range of variability is generally much greater than the magnitude of shifts from near-term climate change. Using archetype analysis, we optimize expansion of the reservoir system over time and under the uncertainty. Optimizing the reservoir system allows both the damages from extreme events and the economic loss from regular groundwater pumping to be reduced.