Understanding Prompts in Greenflash
Simple String Format (Quick Start)
The easiest way to get started with Greenflash is to submit your system prompt as a simple string:- ✅ Automatically tracks and versions your prompts
- ✅ Links prompts to conversation outcomes
- ✅ Generates optimization suggestions
- ✅ Provides performance analytics
- ❌ Can’t use template variables or dynamic content
- ❌ Can’t use component-level optimization
Advanced: Prompt Components
For more control and features, prompts in Greenflash can be built from components - modular pieces that can be combined, versioned, and optimized independently:system- Core instructions and behavior guidelinesuser- User-provided context or instructionstool- Tool outputs and function call resultsguardrail- Safety checks and content moderation rulesrag- Retrieval-augmented generation contextagent- Agent tool outputs and observationsother- Custom or miscellaneous component types
Templates and Variables
Greenflash supports variable interpolation using Handlebars-style syntax ({{variableName}}), allowing you to create reusable templates:
Dynamic Content Slots
TheisDynamic flag indicates components with content that varies per conversation (like RAG results):
isDynamic: false- Template components (may have variables)isDynamic: true- Dynamic content slots (RAG, agent outputs)
Recording Prompts via API
Simple String Format
The quickest way to start - just pass your prompt as a string:Component-Based Prompt Logging
For more control, structure your prompts using components:Using External IDs
Track prompts across different environments with external IDs:Component-Level Management
Mix and match components to create flexible prompt architectures:Managing Prompts via API
The management API endpoints require component format. Simple string prompts are automatically converted to components when logged, but explicit prompt creation/updates need the structured format.
Create a Prompt
Create and version prompts explicitly:Update a Prompt
Update existing prompts while maintaining version history:Retrieve a Prompt
Fetch prompts with optional variable interpolation:List Prompts
Browse and filter your prompt library:Template Matching and Deduplication
Greenflash automatically deduplicates prompts based on their template content, not the hydrated values. When you usevariables, the template (with {{placeholders}}) is what gets hashed and versioned — different variable values reuse the same template.
- Consistent versioning across variable values
- No prompt/version explosion from per-user content
- Accurate performance metrics
- Efficient storage
- Better optimization insights
UI Features
The Greenflash dashboard provides powerful prompt management capabilities:Prompt Library
- Browse all prompts across products
- Filter by type, usage, performance
- View version history
- Compare prompt versions side-by-side
Performance Analytics
- Usage metrics - How often each prompt is used
- Quality scores - Average CQI per prompt version
- Sentiment analysis - User satisfaction by prompt
- Error rates - Hallucination and failure patterns
- Latency impact - Response time by prompt complexity
Optimization Suggestions
- AI-generated improvements based on conversation analysis
- A/B testing recommendations
- Side-by-side comparisons with expected impact
- Evidence from actual conversations
Collaboration Tools
- Name and organize prompts
- Add descriptions and documentation
- Tag prompts for easy discovery
- Share prompts across teams
Active Optimization
How Greenflash Improves Prompts
Greenflash continuously analyzes conversations to identify optimization opportunities:-
Pattern Recognition
- Detects recurring user confusion
- Identifies successful interaction patterns
- Finds correlation between prompts and outcomes
-
Failure Analysis
- Tracks where conversations go wrong
- Identifies prompt ambiguities
- Detects missing instructions
-
Success Modeling
- Learns from high-quality conversations
- Identifies effective prompt patterns
- Suggests proven improvements
Optimization Examples
Before optimization:Implementing Suggestions
Review and apply optimizations through the UI or API:Best Practices
1. Use Components Strategically
- Separate concerns into different components
- Share common components across prompts
- Version components independently
2. Leverage Variables
- Use variables for customer-specific information
- Keep templates generic and reusable
- Document required variables clearly
3. Track Everything
- Include prompts with every conversation
- Use consistent external IDs
- Monitor performance metrics
4. Iterate Based on Data
- Review optimization suggestions weekly
- Test improvements with small user segments
- Measure impact before full rollout
5. Organize for Scale
- Use clear naming conventions
- Document prompt purposes
- Maintain a prompt changelog
Advanced Features
Conditional Components
Use metadata to conditionally include components:Prompt Chains
Track multi-turn prompt strategies:Getting Started Checklist
Quick Start (Simple String)
- Log with string prompts - Pass your prompt as a simple string
- Monitor metrics - Review performance in the dashboard
- Review suggestions - Apply AI-generated improvements
- Graduate to components - Add structure when you need more features
Full Implementation (Components)
- Set up component logging - Structure prompts into logical components
- Add variables - Use templates for customer-specific content
- Set external IDs - Track prompts across environments
- Configure dynamic slots - Mark RAG/agent components appropriately
- Monitor metrics - Review detailed performance analytics
- Review suggestions - Apply component-level optimizations
- Iterate and improve - Continuously optimize based on data
API Reference
Full API documentation for prompt management:Next
AI Product Analysis
Understand conversation metrics and performance insights.
Webhooks
Set up real-time alerts for prompt performance changes.
SDK Integration
Language-specific examples for implementing prompt optimization.

