Prompt Composer
The Prompt Composer node is a specialized component that dynamically assembles prompts by combining base instructions, relevant examples, and contextual data. It serves as a bridge between your prompt library and runtime execution, enabling context-aware, dynamic prompt generation.
Key Features
- Dynamic prompt assembly
- Example matching based on user input
- Template context injection
- Configurable matching thresholds
- Integration with prompt library
Configuration
Basic Setup
- Add the Prompt Composer node to your skill
- Select a prompt from your prompt library
- Configure template context if using dynamic data
- Set up match values for example selection
Template Context
Template context allows you to inject dynamic data into your prompts:
Base text: "Here is the sales data: {{dataset_query.df}}"
The variable in double curly braces will be replaced with actual data at runtime.
Match Values
- Create variables to match against example triggers
- Standard format:
user__full_query
- Enable "Include as chat parameter" for user input matching
- Multiple match values can be configured for complex matching scenarios
Node Outputs
composed_prompt
- Complete assembled prompt including:
- Base prompt text
- Matched examples
- Injected template data
- Ready for immediate use by Prompt Runner
matched_examples
- List of examples that matched the query/match term
- Useful for debugging and optimization
Best Practices
Threshold Configuration for Prompt
- Default: 0.4 (recommended starting point)
- Higher thresholds (0.8+): More precise matching
- Lower thresholds (0.1-0.3): More flexible matching
- Adjust based on your use case needs
Debugging
- Check template context injection (is df or other input being included in the composed prompt?)
- Verify example matching
- Review final composed prompt
- Adjust prompt match thresholds if needed
Common Issues and Solutions
No Examples Matching
- Lower the matching threshold
- Review match value configuration
- Check example trigger phrases
- Verify user input format
Use Cases
1. Brand Analysis Assistant
- Purpose: Analyze brand performance and characteristics
- Implementation:
- Base prompt with brand analysis instructions
- Examples for different analysis types (sales, perception, growth)
- Template context set to a df with brand performance data
- Match values based on the type of analysis that answers the user's request
2. Customer Support Router
- Purpose: Route and format customer inquiries
- Implementation:
- Base prompt with response guidelines
- Examples for different support categories
- Template context with conversation history
- Match values based on inquiry type or themes
3. Market Analysis Reporter
- Purpose: Generate market analysis reports
- Implementation:
- Base prompt with analysis framework
- Examples for different market conditions
- Template context with market data
- Match values based on analysis type
Integration Examples
With Dataset Query
Dataset Query → Prompt Composer → Prompt Runner
Useful for data-driven analysis and reporting
With User Input Processing
User Input → Input Processor → Prompt Composer → Prompt Runner
Ideal for interactive applications
With Multiple Data Sources
Dataset Query 1 ↘
Dataset Query 2 → Prompt Composer → Prompt Runner
Dataset Query 3 ↗
Perfect for comprehensive analysis scenarios
Updated 8 days ago