DSPy Pipeline for Ad Generation

planningChallenge

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.

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

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