Skip to content

Policy Queries

Query Zubbl for optimized task strategies before execution.

Usage

policies = zubbl.query(
    task_type="code_review",
    limit=5,
)

for policy in policies:
    print(f"{policy.pattern}: {policy.score}")

How Policies Work

  1. Zubbl analyzes all past trajectories for the given task type
  2. Patterns are scored by success rate, efficiency, and feedback
  3. Top patterns are returned as policy recommendations
  4. Your agent uses these to guide its approach

Scoring Factors

Factor Weight Description
Success Rate 40% Historical success of the pattern
Token Efficiency 30% Lower token usage = better
Latency 20% Faster execution = better
Feedback 10% Human/automated ratings