docs/content/product/administration/ai/agent-rules.mdx
Understanding Agent Rules configuration and behavior in Cube.
Agent Rules in Cube provide a powerful way to customize and control how AI agents behave within specific spaces. Rules act as contextual instructions that guide agents' responses and analysis, ensuring consistent behavior aligned with your business logic and domain expertise.
Always Rules are automatically applied to every agent interaction within the space, regardless of the specific query or context.
Use Cases:
Example Always Rules:
Sales efficiency is deal size divided by sales cycle length
When analyzing customer data, always consider seasonality patterns from our retail business
Revenue should be calculated using our standard GAAP accounting principles
Agent Requested rules are conditionally applied when the agent determines they are relevant to the current query or analysis. The agent intelligently selects which rules to use based on the context.
Use Cases:
Example Agent Requested Rules:
If you asked to analyze sales efficiency start with correlation to WSE
For customer segmentation analysis, use RFM methodology (Recency, Frequency, Monetary)
When analyzing marketing performance, compare against industry benchmarks where available
✅ Good Rule Examples:
❌ Poor Rule Examples:
E-commerce Example:
Always Rule: "Customer lifetime value equals average order value × purchase frequency × customer lifespan"
Agent Requested: "For cart abandonment analysis, segment by device type and traffic source"
SaaS Example:
Always Rule: "MRR growth rate should exclude one-time charges and setup fees"
Agent Requested: "When analyzing churn, differentiate between voluntary and involuntary churn"
Rules should provide context that agents might not inherently understand about your business:
Always Rule: "Our peak season is Q4, with 40% of annual revenue typically occurring in December"
Agent Requested: "For inventory analysis, consider our 6-week lead time for international suppliers"
Based on the rule configuration system, when multiple rules could apply to the same query, the conflict resolution strategy would likely include:
Scenario 1: Direct Contradiction
Rule A (Always): "Revenue recognition follows monthly billing cycles"
Rule B (Always): "Revenue should be recognized quarterly"
Resolution: The agent will flag this conflict and may ask for clarification
Scenario 2: Complementary Rules
Rule A (Always): "Sales efficiency is deal size divided by sales cycle length"
Rule B (Agent Requested): "When analyzing sales efficiency, include pipeline velocity metrics"
Resolution: Both rules work together - B provides additional context to A
Scenario 3: Specificity Override
Rule A (Always): "Use standard deviation for all variance calculations"
Rule B (Agent Requested): "For customer behavior analysis, use median absolute deviation instead of standard deviation"
Resolution: Rule B takes precedence for customer behavior queries due to higher specificity