Daugavgrīvas Cietoksnis is a fortress originally built in the Swedish Livonia in the 17th century. There's more history at the link but the current structure is newer.
"The fortifications of the fort were completely rebuilt before the outbreak of the First World War. During World War I, the fort was bombed by German air forces. Soon the Germans took over the fortress, and in 1917, the German Emperor Wilhelm II personally inspected it. In 1940, the Soviet navy took over the fortress."
It's only open on the weekends but it's an interesting space to walk around and explore in Riga. It's across the river from old town and near the mouth of the river.