got postgres interaction up and running, now to handle grouping and random group choosing for prompt generation