DSPy Pipeline for Ad Generation

planningChallengeNovember 21, 2025

Prompt Content

Design a DSPy pipeline that takes a user query and a brand focus as input and outputs a short, engaging sponsored ad. Your pipeline should include modules for: 1. Query analysis, 2. RAG-based guideline retrieval, and 3. Ad content generation using Gemini 2.5 Pro. Explain how you'd use DSPy's `dspy.Predict` and `dspy.Chain` (or `dspy.Program`) components.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations