Each year thousands of bills are enacted into law by Congress, state legislatures, and municipalities. As new laws are enacted, legal codes have grown in length and complexity to such an extent that, in many domains, even the government lacks systematic knowledge of what the law is. This challenge has repeatedly stymied legal reform and research efforts. To address the problem, we develop the Statutory Research Assistant (STARA), an automated system capable of performing accurate “statutory surveys”---compilations of all provisions relevant to a particular legal issue, together with detailed annotations and reasoning. We validate STARA’s accuracy on three existing human-compiled surveys, showing that it can reproduce them with high fidelity and in many cases identify hundreds of previously undiscovered provisions. We address the unique challenges of automated statutory research, and show that STARA’s domain-specific architecture yields substantial improvements in accuracy over off-the-shelf language models. STARA can dramatically reduce the time for discerning the law, and we discuss its considerable implications for legal reform, academic research, and transparency. We make STARA’s compiled statutory surveys available to the public and the tool available to researchers upon request.