Overview
Pricing Intelligence uses constraint satisfaction problem (CSP) solvers to find optimal subscription plans based on user requirements. Theoptimal and subscriptions tools leverage mathematical solvers (MiniZinc or Choco) to provide rigorous, grounded answers.
The Optimal Tool
Theoptimal tool finds the best (cheapest or most expensive) plan that satisfies a set of constraints.
Parameters
URL of the pricing page to analyze (if not providing YAML directly)
Direct YAML content (alternative to pricing_url)
Constraints on features and usage limits
Solver to use:
minizinc or chocoOptimization objective:
minimize (cheapest) or maximize (most expensive)Bypass cache and re-extract pricing data
Response Format
Natural Language Optimization
H.A.R.V.E.Y. translates natural language questions into structuredoptimal tool calls:
Filter Structure
Filters define constraints on features and usage limits:Feature Filters
Feature filters currently support boolean values. The plan must have the feature set to the specified value.
Usage Limit Filters
Comparison operator:
>=, <=, >, <, =, !=Special Values
The Pricing2Yaml format supports special numeric values:.inf: Infinity (unlimited).nan: Not applicable
.infis treated as a very large number- Comparisons with
.nanmay require special handling
The Subscriptions Tool
Thesubscriptions tool enumerates all valid plan configurations that match a set of filters.
Parameters
Same asoptimal, but without the objective parameter:
URL of the pricing page
Direct YAML content
Constraints (same structure as
optimal)Solver:
minizinc or chocoBypass cache
Response Format
Total number of valid configurations (may be larger than the returned array if results are paginated)
Example Scenarios
Scenario 1: Finding the Best Value
Question: “What’s the cheapest way to get GitHub integration and support for 10 collaborators?”H.A.R.V.E.Y. analyzes the question
Identifies requirements:
- Feature:
githubIntegration = true - Usage limit:
maxCollaboratorsPerProject >= 10 - Objective: Minimize price
Solver finds optimal plan
Returns: STANDARD plan at $21/month
- Has
githubIntegration: true - Supports 11 collaborators (satisfies >= 10)
Scenario 2: Enumerating Options
Question: “Show me all plans that include priority support.”Scenario 3: Impossible Constraints
Question: “What’s the cheapest plan with unlimited collaborators and a $10 budget?”Solver Selection
MiniZinc
- Default solver
- General-purpose constraint programming
- Best for complex optimization problems
- Slower but more flexible
Choco
- Java-based CSP solver
- Faster for enumeration tasks
- Better performance on large configuration spaces
- May have different behavior on edge cases
Advanced Filtering
Combining Multiple Constraints
All filters are combined with AND logic:githubIntegrationis true ANDprioritySupportis true ANDmaxCollaboratorsPerProject >= 5ANDcompileTimeoutLimit >= 2
Numeric Comparisons
Greater Than
>: Strictly greater>=: Greater than or equalLess Than
<: Strictly less than<=: Less than or equalEquality
=: Exactly equal!=: Not equalPerformance Considerations
Optimization queries involve solving constraint satisfaction problems, which can be computationally intensive for large configuration spaces.
- Small configuration spaces (3-5 plans): Near-instant results
- Medium spaces (10-20 plans with many features): 1-5 seconds
- Large spaces (complex plans with many constraints): 5-30 seconds
Troubleshooting
No Solutions Found
Problem: The solver returns no valid plans Solutions:- Check that feature names match exactly (case-sensitive)
- Verify usage limit names are correct
- Relax constraints one at a time to identify the conflicting requirement
- Use the
summarytool to list all available features and limits
Unexpected Results
Problem: The optimal plan doesn’t match expectations Solutions:- Review the filters to ensure they match your intent
- Use
subscriptionsto see all matching plans, not just the optimal one - Check the pricing YAML for special values (
.inf,.nan) that may affect comparisons - Try the other solver (
chocovsminizinc) to verify consistency
Solver Timeout
Problem: Query takes too long or times out Solutions:- Simplify the filters (fewer constraints)
- Check the CSP service logs:
docker-compose logs choco-api - Verify the pricing YAML is well-formed (use the
validatetool) - Consider using the
chocosolver for faster enumeration
Programmatic Usage
Best Practices
Use Exact Feature Names
Feature and limit names are case-sensitive. Use the
summary tool to list available names.Start Simple
Begin with one or two constraints, then add more as needed.
Validate First
Use the
validate tool to ensure the pricing model is mathematically consistent before optimizing.Compare Solvers
If results seem off, try the alternative solver to verify.
Next Steps
Configuration
Learn how to configure solvers, API keys, and service settings
Analysis API Reference
Explore the complete Analysis API documentation