Interpretable Intelligence
Developer guide for configuring and using Interpretable Intelligence—comprehensive explanations of all optimization decisions with configurable detail levels.
Overview
Interpretable Intelligence provides comprehensive explanations of all optimization decisions. Explanations are processed asynchronously by default, providing a 22-26% performance boost while still delivering detailed insights.
What You Get
- •Natural language summaries: Human-readable explanations of optimization decisions
- •Technical decision logs: Detailed logs of all strategy selection decisions
- •Interactive visualizations: Visual diagnostics of optimization process (optional)
- •Audit trails: Complete records for regulatory compliance
Explanation Levels
Control the detail level of explanations to balance information needs with compute costs:
# Explanation Levels
Level 0: No explanations (fastest)
- No explanation data returned
- Minimal overhead
Level 1: Basic summary
- Simple one-line summary
- Strategy name and basic metrics
Level 2: Detailed (default)
- Strategy rationale
- Key decision points
- Performance metrics
Level 3: Comprehensive
- Full decision tree
- Alternative strategies considered
- Detailed performance analysis
Level 4: Full audit trail
- Complete decision log
- All alternatives with scores
- Regulatory compliance ready
Level 5: Maximum detail
- Every decision point logged
- Full traceability
- Research-grade documentationSimple Configuration
Enable Interpretable Intelligence with a simple explanation level:
from sematryx import Sematryx
client = Sematryx(api_key="sk-your-api-key")
# Enable Interpretable Intelligence with explanation level
result = client.optimize(
objective="minimize",
variables=[{"name": "x", "bounds": (-5, 5)}, {"name": "y", "bounds": (-5, 5)}],
objective_function=sphere,
explanation_level=2 # 0=none, 1=basic, 2=detailed, 3=comprehensive, 4=full audit
)
print(result.explanation) # Human-readable explanation of the solutionAdvanced Configuration
Fine-tune Interpretable Intelligence behavior with advanced options:
from sematryx import Sematryx
client = Sematryx(api_key="sk-your-api-key")
# Advanced Interpretable Intelligence configuration
result = client.optimize(
objective="minimize",
variables=[{"name": "x", "bounds": (-5, 5)}, {"name": "y", "bounds": (-5, 5)}],
objective_function=sphere,
intelligence_config={
"use_interpretable_intelligence": True,
"interpretable": {
"explanation_level": 3, # 0-5 detail level
"async_explanations": True, # Background processing (22-26% faster)
"include_visualizations": True, # Generate visual diagnostics
"natural_language": True # Enable NLP summaries
}
}
)Configuration Options
- explanation_level (int, 0-5, default: 2)
Detail level for explanations. Higher levels provide more information but increase compute cost.
- async_explanations (bool, default: True)
Process explanations asynchronously in the background. Provides 22-26% performance boost.
- include_visualizations (bool, default: False)
Generate visual diagnostics of the optimization process. Useful for debugging and presentations.
- natural_language (bool, default: True)
Enable natural language processing for human-readable summaries. Disable for technical-only logs.
REST API Configuration
Configure Interpretable Intelligence via REST API:
curl -X POST https://api.sematryx.com/v1/optimize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"objective_function_id": "func_1234567890",
"bounds": [[-10, 10], [-10, 10]],
"max_evaluations": 2000,
"intelligence_config": {
"use_interpretable_intelligence": true,
"explanation_level": 3,
"interpretable": {
"async_explanations": true,
"include_visualizations": true,
"natural_language": true
}
}
}'JavaScript SDK Configuration
Configure Interpretable Intelligence using the JavaScript SDK:
import { Sematryx } from '@sematryx/javascript-sdk'
const client = new Sematryx('sk-your-api-key')
// Enable Interpretable Intelligence
const result = await client.optimize({
objective: 'minimize',
variables: [
{ name: 'x', bounds: [-5, 5] },
{ name: 'y', bounds: [-5, 5] }
],
objectiveFunction: sphere,
explanationLevel: 3,
intelligenceConfig: {
interpretable: {
asyncExplanations: true,
includeVisualizations: true,
naturalLanguage: true
}
}
})
console.log(result.explanation)Best Practices
- •Use async_explanations: Always enable async processing for the 22-26% performance boost with no downside.
- •Choose appropriate level: Use level 1-2 for production, level 3-4 for debugging, level 5 for compliance/audit.
- •Enable visualizations for debugging: Turn on visualizations when troubleshooting optimization issues.
- •Natural language for stakeholders: Keep natural_language enabled when explanations need to be shared with non-technical stakeholders.