Molecular detection in complex mixtures is of great importance in biomedical diagnosis, food safety, and environmental monitoring. Although surface-enhanced Raman scattering serves as one of the most promising detection methods, metal surfaces are prone to contamination, making the direct detection of small molecules in mixtures elusive. Metal nanoparticle-loaded hydrogels have been used for the exclusion of large adhesive molecules and direct detection of small molecules. Here, we design microgels containing highly concentrated gold nanoparticles through the simultaneous formation of hydrogel and gold nanoparticles in emulsion droplets. Monodisperse water-in-oil droplets are microfluidically prepared to contain a gold precursor, hydrogel precursor, and photoinitiator. Upon ultraviolet irradiation, a hydrogel is gradually formed in the drop by photocross-linking at which gold nanoparticles are synthesized and grown by photo and thermal reduction. The in situ synthesis provides the uniform distribution of gold nanoparticles at very high concentrations without aggregation, which is otherwise very difficult to achieve. Using the microgels, small molecules in albumin solutions can be detected by Raman measurement with high signal sensitivity and reproducibility in the absence of interruption from albumin. As a proof of concept, we demonstrate the direct detection of pyocyanin, a biomarker for Pseudomonas infection spiked in unpurified saliva.