Latvian State Historical Archives has digitalization project Raduraksti, which mostly publishes vital records and materials from Russian censuses ("soul revisions"). They keep records up to 1909. There is a digitalization effort run by third party site Ciltskoki. You'll need to register on both sites. The later offers search engine as paid service, but you can still view lists of all transcribed records for free. Mind that this is meant to serve as reference and records are not transcribed fully. As most of events where recorded by churches, you'll need to know religion of persons you are looking for, if you are unsure, as rule of thumb much of Latvia historically was Lutheran, except for eastern areas which where predominantly Roman Catholic.