Osaka Museum of History (osakamushis.jp) towers over Osaka-jō, so where better to get an overview of the city's history? On entry, get the link for the audio guide, as English labeling can be patchy, especially on the 10th floor, which has a recreation of the ancient court based on a dig done right by the museum – don't miss the early-7th-century lotus pattern tiles! Naniwa was temporarily Japan's capital (652–686) before the court moved on to a more permanent setting in Nara.
The museum is a top-down voyage through time, and the 9th floor deals with the Middle Ages and early modern period. In a model of the nearby town of Sakai, you can see the first Westerners showing up in Japan. Sakai's economy boomed as matchlock weapons were introduced in the 16th century. You'll also learn how Toyotomi Hideyoshi changed the infrastructure of Osaka, developing the port and waterways so that it became a hub for the transportation of goods – most importantly rice – earning it the nickname "the kitchen of the nation."
Increasingly wealthy Osaka enjoyed a cultural flourishing reflected in items like the model of a kabuki theater, the fantastic Gozabune float made in the shape of a boat, and satirical woodblock prints. It also spawned bunraku (a form of puppet theater) and you can play with a puppet – if that whets your appetite, consider a visit to the National Bunraku Theatre (ntj.jac.go.jp/bunraku) where you can watch a show with an audio guide.
On the 8th floor, dedicated to temporary exhibitions, you can take a break on comfy sofas overlooking the wonderful early-20th-century streetscape on the next floor down, which rounds off a trip nicely.