The New York State Library was created in 1818. Assemblyman Thomas Oakley introduced the idea in the New York Assembly on March 9, 1818 with a motion that "a committee be appointed to inquire into the expediency of providing by law for the establishment of a public library, for the use of the government."
The motion passed and a committee of three, headed by Oakley, was formed. Nine days later Mr. Oakley submitted a bill to "establish a public library at the seat of government." The bill, with some minor adjustments, passed in the Assembly on April 18, 1818 and in the Senate on April 21, 1818, and was then signed into law by Governor DeWitt Clinton.
The information above is from For the Government and People of this State: A History of the New York State Library, by Cecil R. Roseberry (1970).