Workflow
- Receive short prompt
- Optionally gather context via tools
- Apply expansion strategy
- Return detailed, actionable prompt
Setup
Run — Python
Run — CLI
Run — agents.yaml
Serve API
Expansion Strategies
BASIC
Simple expansion with clarity improvements. Fixes ambiguity and adds minimal context.
DETAILED
Rich expansion with context, constraints, format guidance, and quality expectations.
STRUCTURED
Expansion with clear sections: Task, Format, Requirements, Style, Constraints.
CREATIVE
Expansion with vivid, inspiring language and creative direction.
Basic Usage
Using Specific Strategies
Using Tools for Context
Configuration Options
ExpandResult Properties
Convenience Methods
Key Difference from Query Rewriter
| Feature | Query Rewriter | Prompt Expander |
|---|---|---|
| Purpose | Optimize for search/retrieval | Expand for task execution |
| Use Case | RAG applications | Task prompts |
| Output | Search-optimized queries | Detailed action prompts |
| CLI Flag | --query-rewrite | --expand-prompt |
Example: Movie Script
Input:Monitor / Verify
Features Demonstrated
| Feature | Implementation |
|---|---|
| Workflow | Single-step prompt expansion |
| Observability | --verbose flag |
| Tools | Optional context-gathering tools |
| Structured Output | ExpandResult with metadata |
Next Steps
- Query Rewriter for search optimization
- Research Agent for web research
- Memory for persistent context

