Advanced Orchestration
Overview
The Advanced Orchestration feature provides intelligent routing between AI models based on task characteristics. It automatically analyzes incoming prompts and routes them to the most suitable provider and model combination for optimal performance and cost efficiency.
Key Features
🧠 Binary Task Classification
Fast Tasks: Simple queries, calculations, quick facts → Routed to Vertex AI Gemini 2.5 Flash
Reasoning Tasks: Complex analysis, philosophical questions, detailed explanations → Routed to Vertex AI Claude Sonnet 4
⚡ Intelligent Model Routing
Automatic provider and model selection based on task type
Optimizes for response speed vs. reasoning capability
Built-in confidence scoring for classification accuracy
🎯 Precedence Hierarchy
User-specified provider/model (highest priority)
Orchestration routing (when no provider specified)
Auto provider selection (fallback)
Graceful error handling
🔄 Zero Breaking Changes
Completely optional feature (disabled by default)
Existing functionality preserved
Backward compatible with all existing code
Usage
Basic Usage
Advanced Usage
Manual Classification and Routing
Task Classification Logic
Fast Tasks (→ Gemini 2.5 Flash)
Short prompts (< 50 characters)
Keywords: quick, fast, simple, what, time, weather, calculate, translate
Patterns: Questions, calculations, greetings, simple requests
Examples:
"What's 2+2?"
"Current time?"
"Quick weather update"
"Translate 'hello' to Spanish"
Reasoning Tasks (→ Claude Sonnet 4)
Complex prompts (detailed analysis requests)
Keywords: analyze, explain, compare, design, strategy, implications, philosophy, complex
Patterns: Analysis requests, philosophical questions, strategy development
Examples:
"Analyze the ethical implications of AI in healthcare"
"Compare different economic theories"
"Design a comprehensive climate strategy"
"Explain the philosophical implications of consciousness"
Configuration Options
Constructor Options
Environment Variables
The orchestration system uses unified Vertex AI for both fast and reasoning tasks:
Architecture
Components
BinaryTaskClassifier: Analyzes prompts and classifies as 'fast' or 'reasoning'
ModelRouter: Maps task types to optimal provider/model combinations
NeurosLink AI Integration: Orchestration logic integrated into main generation flow
Precedence Engine: Handles priority between user preferences and orchestration
Flow Diagram
Error Handling
Orchestration Failure: Falls back to auto provider selection
Provider Unavailable: Uses next best available provider
Classification Errors: Defaults to fast task routing
Network Issues: Standard NeurosLink AI retry mechanisms apply
Performance
Response Time Optimization
Fast tasks: Target <2s response time with Gemini Flash
Reasoning tasks: Accept longer response time for better quality with Claude Sonnet 4
Classification overhead: <10ms per request
Routing overhead: <5ms per request
Cost Optimization
Fast tasks: Use cost-effective Gemini Flash for simple queries
Reasoning tasks: Use premium Claude Sonnet 4 for complex analysis
Automatic scaling: Route based on complexity, not user preference
Monitoring and Analytics
Built-in Logging
Alternative: Set environment variable before running your application:
Event Monitoring
Best Practices
When to Enable Orchestration
✅ Good use cases:
Mixed workloads (both simple and complex queries)
Cost optimization important
Response time optimization for simple queries
Large-scale applications with varied request types
❌ Not recommended:
Single-purpose applications (all fast or all reasoning)
When you need consistent provider behavior
Testing/development with specific models
Applications requiring strict provider control
Optimization Tips
Trust the Classification: The binary classifier is highly accurate (>95% confidence)
Use Precedence: Override orchestration when you need specific behavior
Monitor Performance: Track response times and adjust if needed
Combine with Analytics: Use
enableAnalytics: trueto track usage patterns
Integration Patterns
Migration Guide
From Standard NeurosLink AI
Gradual Adoption
Troubleshooting
Common Issues
Issue: Orchestration not working
Issue: Wrong provider selected
Issue: Performance concerns
Debug Mode
API Reference
BinaryTaskClassifier
ModelRouter
NeurosLink AI Constructor
Version History
v7.31.0: Initial implementation of Advanced Orchestration
Binary task classification
Intelligent model routing
Zero breaking changes
Comprehensive testing and validation
Support
For questions, issues, or feature requests related to Advanced Orchestration:
Check this documentation first
Review the troubleshooting section
Run the POC validation test:
node test-orchestration-poc.jsOpen an issue on the NeurosLink AI repository
Advanced Orchestration is a powerful feature that makes AI model selection intelligent and automatic. Use it to optimize both performance and costs while maintaining full control when needed.
Last updated
Was this helpful?

