Skip to main content

Overview

Pricing Intelligence uses constraint satisfaction problem (CSP) solvers to find optimal subscription plans based on user requirements. The optimal and subscriptions tools leverage mathematical solvers (MiniZinc or Choco) to provide rigorous, grounded answers.

The Optimal Tool

The optimal tool finds the best (cheapest or most expensive) plan that satisfies a set of constraints.

Parameters

pricing_url
string
URL of the pricing page to analyze (if not providing YAML directly)
pricing_yaml
string
Direct YAML content (alternative to pricing_url)
filters
object
Constraints on features and usage limits
{
  "features": [{"name": "githubIntegration", "value": true}],
  "usageLimits": [{"name": "maxCollaboratorsPerProject", "value": 5, "operator": ">="}]
}
solver
string
default:"minizinc"
Solver to use: minizinc or choco
objective
string
default:"minimize"
Optimization objective: minimize (cheapest) or maximize (most expensive)
refresh
boolean
default:"false"
Bypass cache and re-extract pricing data

Response Format

{
  "request": {
    "url": "https://buffer.com/pricing",
    "filters": {...},
    "solver": "minizinc",
    "objective": "minimize"
  },
  "result": {
    "plan": "STANDARD",
    "price": 21,
    "features": {
      "githubIntegration": true,
      "fullDocumentHistory": true,
      "prioritySupport": true
    },
    "usageLimits": {
      "maxCollaboratorsPerProject": 11,
      "compileTimeoutLimit": 4
    }
  }
}

Natural Language Optimization

H.A.R.V.E.Y. translates natural language questions into structured optimal tool calls:
What is the cheapest Overleaf plan that includes GitHub integration?

// H.A.R.V.E.Y. translates to:
{
  "filters": {
    "features": [{"name": "githubIntegration", "value": true}]
  },
  "objective": "minimize"
}

Filter Structure

Filters define constraints on features and usage limits:

Feature Filters

{
  "features": [
    {
      "name": "githubIntegration",
      "value": true
    },
    {
      "name": "prioritySupport",
      "value": true
    }
  ]
}
Feature filters currently support boolean values. The plan must have the feature set to the specified value.

Usage Limit Filters

{
  "usageLimits": [
    {
      "name": "maxCollaboratorsPerProject",
      "value": 10,
      "operator": ">="
    },
    {
      "name": "compileTimeoutLimit",
      "value": 2,
      "operator": ">"
    }
  ]
}
operator
string
Comparison operator: >=, <=, >, <, =, !=

Special Values

The Pricing2Yaml format supports special numeric values:
  • .inf: Infinity (unlimited)
  • .nan: Not applicable
When filtering:
  • .inf is treated as a very large number
  • Comparisons with .nan may require special handling

The Subscriptions Tool

The subscriptions tool enumerates all valid plan configurations that match a set of filters.

Parameters

Same as optimal, but without the objective parameter:
pricing_url
string
URL of the pricing page
pricing_yaml
string
Direct YAML content
filters
object
Constraints (same structure as optimal)
solver
string
default:"minizinc"
Solver: minizinc or choco
refresh
boolean
default:"false"
Bypass cache

Response Format

{
  "request": {...},
  "result": {
    "subscriptions": [
      {
        "plan": "STANDARD",
        "price": 21,
        "features": {...},
        "usageLimits": {...}
      },
      {
        "plan": "PROFESSIONAL",
        "price": 42,
        "features": {...},
        "usageLimits": {...}
      }
    ],
    "cardinality": 2
  }
}
cardinality
number
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?”
1

H.A.R.V.E.Y. analyzes the question

Identifies requirements:
  • Feature: githubIntegration = true
  • Usage limit: maxCollaboratorsPerProject >= 10
  • Objective: Minimize price
2

Calls optimal tool

{
  "filters": {
    "features": [{"name": "githubIntegration", "value": true}],
    "usageLimits": [{"name": "maxCollaboratorsPerProject", "value": 10, "operator": ">="}]
  },
  "objective": "minimize"
}
3

Solver finds optimal plan

Returns: STANDARD plan at $21/month
  • Has githubIntegration: true
  • Supports 11 collaborators (satisfies >= 10)
4

H.A.R.V.E.Y. formats answer

“The cheapest plan that meets your requirements is the STANDARD plan at $21/month. It includes GitHub integration and supports up to 11 collaborators per project.”

Scenario 2: Enumerating Options

Question: “Show me all plans that include priority support.”
1

H.A.R.V.E.Y. uses subscriptions tool

{
  "filters": {
    "features": [{"name": "prioritySupport", "value": true}]
  }
}
2

Solver returns all matching plans

  • STANDARD ($21/month)
  • PROFESSIONAL ($42/month)
3

H.A.R.V.E.Y. summarizes

“Two plans include priority support: STANDARD at 21/monthandPROFESSIONALat21/month and PROFESSIONAL at 42/month. The main difference is that PROFESSIONAL offers unlimited collaborators.”

Scenario 3: Impossible Constraints

Question: “What’s the cheapest plan with unlimited collaborators and a $10 budget?”
1

H.A.R.V.E.Y. calls optimal tool

{
  "filters": {
    "usageLimits": [
      {"name": "maxCollaboratorsPerProject", "value": ".inf", "operator": ">="}
    ]
  },
  "objective": "minimize"
}
2

Solver finds minimum is $42

PROFESSIONAL plan has unlimited collaborators but costs $42
3

H.A.R.V.E.Y. explains the limitation

“The cheapest plan with unlimited collaborators is PROFESSIONAL at 42/month,whichexceedsyour42/month, which exceeds your 10 budget. No plans offer unlimited collaborators at that price point.”

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
Try both solvers if you encounter unexpected results. They may handle special values (.inf, .nan) differently.

Advanced Filtering

Combining Multiple Constraints

All filters are combined with AND logic:
{
  "features": [
    {"name": "githubIntegration", "value": true},
    {"name": "prioritySupport", "value": true}
  ],
  "usageLimits": [
    {"name": "maxCollaboratorsPerProject", "value": 5, "operator": ">="},
    {"name": "compileTimeoutLimit", "value": 2, "operator": ">="}
  ]
}
The solver finds plans where:
  • githubIntegration is true AND
  • prioritySupport is true AND
  • maxCollaboratorsPerProject >= 5 AND
  • compileTimeoutLimit >= 2

Numeric Comparisons

Greater Than

>: Strictly greater>=: Greater than or equal

Less Than

<: Strictly less than<=: Less than or equal

Equality

=: Exactly equal!=: Not equal

Performance 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
Use specific filters to reduce the search space and improve performance.

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 summary tool 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 subscriptions to 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 (choco vs minizinc) 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 validate tool)
  • Consider using the choco solver for faster enumeration

Programmatic Usage

result = await session.call_tool("optimal", {
    "pricing_url": "https://overleaf.com/pricing",
    "filters": {
        "features": [
            {"name": "githubIntegration", "value": True}
        ],
        "usageLimits": [
            {"name": "maxCollaboratorsPerProject", "value": 5, "operator": ">="}
        ]
    },
    "objective": "minimize",
    "solver": "minizinc"
})

optimal_plan = result["result"]["plan"]
optimal_price = result["result"]["price"]

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

Build docs developers (and LLMs) love