Constraint Systems

Define boundaries and rules that govern agent behavior through hard and soft constraints

Soft Constraints: Preferences & Trade-offs

Soft constraints are preferences and goals that guide agent behavior but can be violated when necessary. They define what the agent should do, not what it must do.

Key Characteristics

  • Flexible: Can be violated if other priorities demand it
  • Weighted: Different priorities for different constraints
  • Trade-off aware: Balance competing goals (speed vs quality)
  • Context dependent: Priorities change based on situation

Interactive: Optimization Simulator

Adjust constraint priorities and see how the agent chooses different approaches:

Set Your Priorities (1=Low, 3=High)

Output Quality

Prefer detailed, accurate, well-reasoned responses

Priority: 3
💰
Cost Efficiency

Minimize token usage and API costs when possible

Priority: 2
Response Speed

Return results quickly to minimize user wait time

Priority: 1

Task: Answer customer question about product features

Agent will choose the option that best satisfies your priorities:

🏆
GPT-3.5 Turbo (Detailed)
Score: 21

Good answer with reasonable detail, lower cost

Quality
⭐⭐⭐☆☆
Cost
⭐⭐⭐⭐☆
Speed
⭐⭐⭐⭐☆
✓ Agent will choose this option
GPT-3.5 Turbo (Concise)
Score: 21

Quick answer with essential info, very cheap

Quality
⭐⭐☆☆☆
Cost
⭐⭐⭐⭐⭐
Speed
⭐⭐⭐⭐⭐
GPT-4 Turbo (Detailed)
Score: 19

Comprehensive answer with examples, comparisons, and recommendations

Quality
⭐⭐⭐⭐⭐
Cost
⭐☆☆☆☆
Speed
⭐⭐☆☆☆
GPT-4 Turbo (Concise)
Score: 19

Clear answer with key points, less elaboration

Quality
⭐⭐⭐⭐☆
Cost
⭐⭐☆☆☆
Speed
⭐⭐⭐☆☆

When Quality is High Priority

Agent chooses detailed responses with advanced models, even if slower or more expensive. Best for complex queries, critical decisions, or expert-level tasks.

When Speed is High Priority

Agent optimizes for fast responses using concise prompts and efficient models. Best for simple queries, real-time interactions, or high-volume scenarios.

💡
Soft Constraints in Practice

Most agent behaviors are soft constraints: cost optimization, response quality, latency targets, verbosity preferences. These create better user experiences without rigid restrictions. Hard constraints prevent disasters; soft constraints enable excellence.

← Previous: Hard Constraints