Package Exports
- blax
Readme
Blax v2.0 - Advanced Multi-Agent Collaboration Platform
Blax is a powerful multi-agent collaboration platform that combines human-in-the-loop supervision with value-driven decision making. Built for enterprise environments requiring sophisticated agent orchestration, real-time monitoring, and comprehensive audit trails.
π What's New in v2.0
Blax v2.0 represents a complete transformation from a basic terminal agent into a comprehensive multi-agent collaboration platform:
- π§ Unified System Orchestration - Manage complex multi-component systems with health monitoring
- πΌ Deal-Centric Value Contracts - Structure collaboration with stakeholders, financing, and measurable outcomes
- ποΈ Human-in-the-Loop Supervision - Real-time agent monitoring with pause, resume, escalate controls
- π Comprehensive Analytics - KPI tracking, performance metrics, and automated alerting
- βοΈ Dynamic Configuration - Runtime system tuning with feature flags and rollout management
π Key Features
Multi-Agent Orchestration
- Agent Hub with skill execution and telemetry
- Message Bus for real-time agent communication
- Control Channels for human oversight and intervention
- Delegation System for hierarchical task distribution
Value-Driven Decision Making
- Deal Management with CRUD operations for collaborative contracts
- Value Evaluation Engine providing binary YES/NO recommendations
- Financial Provenance with complete audit trails
- Standards Compliance validation across 197+ industry regulations
Real-Time Monitoring
- Interactive Terminal UI for live agent monitoring
- Event Streaming with filtering and correlation
- Alert Management with automated anomaly detection
- Health Monitoring with component status tracking
Enterprise Ready
- Production Deployment with Docker and Kubernetes support
- Scalable Architecture with Redis-backed communication
- Security Features with capability-based access control
- Compliance Tools with comprehensive audit logging
π¦ Quick Start
Installation
# Install globally
npm install -g blax@2.0.0
# Or install locally
npm install blax@2.0.0
Prerequisites
- Node.js 18+ for TypeScript execution
- Redis for message bus (install via
brew install redis
orapt install redis-server
)
Basic Usage
# Original terminal agent (v1.x compatibility)
blax interactive
# New HMS Dev system
blax system start
# Monitor agents in real-time
blax watch start
# Manage collaborative deals
blax deal create --name "API Integration" --budget 5000
Web Dashboard
Once started, access the web dashboard at:
- Main Interface: http://localhost:8090
- API Endpoint: http://localhost:8080
- System Status:
blax system status
π― Use Cases
Software Development Teams
# Create development deal
blax deal create \
--name "User Authentication System" \
--problem "Implement secure OAuth 2.0 login" \
--budget 15000 \
--stakeholders "Security Team,Frontend Team" \
--standards "OAUTH2,GDPR"
# Evaluate implementation approach
blax deal evaluate deal_123 --action-type implementation
# Monitor development progress
blax watch start
Enterprise Operations
# Start full system with monitoring
blax system start --dashboard-port 9090
# View real-time metrics
blax metrics show
# Check compliance status
blax deal list --status in_progress
Human-in-the-Loop Workflows
# Interactive agent supervision
blax watch start
# Control agent execution
blax watch control agent_123 PAUSE --reason "Code review required"
blax watch control agent_123 RESUME
# Escalate to human oversight
blax watch control agent_123 ESCALATE --reason "Complex decision needed"
ποΈ Architecture
Blax v2.0 Architecture
βββ π§ Core System
β βββ Unified Launcher - Multi-component orchestration
β βββ Message Bus - Redis-backed communication
β βββ Agent Hub - Enhanced skill execution
β βββ Event Bus - Real-time event distribution
βββ πΌ HMS Dev Components
β βββ Deal Management - Value-centric contracts
β βββ Watch Mode - HITL supervision
β βββ Metrics Collection - KPI tracking
β βββ Configuration - Dynamic system tuning
βββ π Integration Layer
β βββ Cross-component communication
β βββ State synchronization
β βββ Event correlation
βββ π» Interfaces
βββ CLI Commands - System management
βββ Web Dashboard - Real-time monitoring
βββ REST API - Programmatic access
βββ Interactive TUI - Terminal interface
π Command Reference
System Management
blax system start [options] # Start HMS Dev system
blax system stop # Stop system gracefully
blax system status # Show component status
Deal Operations
blax deal create [options] # Create collaborative deal
blax deal list [filters] # List deals with filtering
blax deal show <dealId> # Show detailed deal info
blax deal evaluate <dealId> # Evaluate deal actions
Agent Monitoring
blax watch start # Launch interactive TUI
blax watch agents # List active agents
blax watch control <id> <cmd> # Send control commands
Metrics & Monitoring
blax metrics show # Display system metrics
blax metrics alerts # Show active alerts
Quick Start Scripts
npm run hms:start # Start full system
npm run hms:watch # Start watch mode
npm run hms:status # Check system status
Legacy Commands (v1.x Compatibility)
blax # Interactive mode
blax ask "question" # One-shot Q&A
blax agents list # List agents
blax cloud status # Cloud service status
π§ Configuration
Environment Variables
# Core system
export HMS_REDIS_URL="redis://localhost:6379"
export HMS_API_HOST="0.0.0.0"
export HMS_API_PORT="8080"
# Dashboard
export HMS_DASHBOARD_HOST="localhost"
export HMS_DASHBOARD_PORT="8090"
# Development
export HMS_DEBUG="true"
export HMS_DEVELOPMENT_MODE="true"
# Legacy v1.x compatibility
export BLAX_API_URL="https://api.blax.ai"
export BLAX_HUB_URL="wss://api.blax.ai/hub"
export OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
Configuration Files
# hms-config.yaml
apiVersion: config.hms.dev/v1
kind: HMSConfig
metadata:
name: production-config
spec:
scope: global
data:
redis_url: "redis://production:6379"
enable_dashboard: true
dashboard_port: 8090
metrics_retention_hours: 24
π» Programming Interface
TypeScript Integration
import { UnifiedLauncher, DealRegistry, DealEvaluator } from 'blax';
// Start system programmatically
const launcher = new UnifiedLauncher({
redisUrl: 'redis://localhost:6379',
enableDashboard: true,
developmentMode: true
});
await launcher.start();
// Create and evaluate deals
const dealRegistry = new DealRegistry();
await dealRegistry.initialize();
const deal = await dealRegistry.createDeal({
name: 'AI Integration Project',
problem: 'Implement machine learning features',
stakeholders: [
{ name: 'Product Team', role: 'client', votingWeight: 1.0 }
],
financing: {
totalBudget: 25000,
currency: 'USD',
fundingType: 'milestone'
}
});
// Evaluate actions with binary recommendations
const evaluator = new DealEvaluator(dealRegistry);
const evaluation = await evaluator.evaluateDeal(deal.dealId, {
actionId: 'ml_implementation',
actionType: 'implementation',
agentId: 'ai_specialist',
estimatedDuration: 60,
resourceCost: 8000,
riskLevel: 0.4,
confidence: 0.85
});
console.log(`Recommendation: ${evaluation.recommendation}`);
console.log(`Value Delta: ${evaluation.valueDelta}`);
console.log(`Reasoning: ${evaluation.reasoning}`);
Human-in-the-Loop Integration
import { ControlAwareAgent, MessageBus } from 'blax';
// Create supervision-enabled agent
const messageBus = new MessageBus({ redisUrl: 'redis://localhost:6379' });
await messageBus.connect();
const agent = new ControlAwareAgent('ai_agent', messageBus, {
canPause: true,
canEscalate: true,
maxAutonomyLevel: 0.8,
requiresApproval: ['database_changes', 'external_api_calls']
});
await agent.initialize();
// Handle human oversight events
agent.on('paused', ({ reason }) => {
console.log(`βΈοΈ Agent paused: ${reason}`);
});
agent.on('escalated', ({ escalationRequest }) => {
console.log(`π¨ Human intervention required: ${escalationRequest.reason}`);
});
// Self-escalate for complex decisions
await agent.selfEscalate('ML model selection requires domain expertise', 'high', 'advisory');
π Deployment
Docker
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist/ ./dist/
COPY bin/ ./bin/
EXPOSE 8080 8090
CMD ["npm", "run", "hms:start"]
Docker Compose
version: '3.8'
services:
blax-hms:
build: .
ports:
- "8080:8080"
- "8090:8090"
environment:
- HMS_REDIS_URL=redis://redis:6379
depends_on:
- redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: blax-hms
spec:
replicas: 3
selector:
matchLabels:
app: blax-hms
template:
spec:
containers:
- name: blax-hms
image: blax:2.0.0
ports:
- containerPort: 8080
- containerPort: 8090
env:
- name: HMS_REDIS_URL
value: "redis://redis-service:6379"
π Key Metrics
Blax v2.0 tracks comprehensive metrics for operational excellence:
- System Availability: 99.9% uptime target
- API Response Time: <200ms for 95% of requests
- Deal Success Rate: >90% successful collaborations
- Agent Efficiency: >80% productive utilization
- Error Rate: <1% system-wide errors
- Human Intervention: Automated escalation workflows
π Migration from v1.x
Blax v2.0 maintains full backward compatibility:
# v1.x commands continue to work
blax interactive # β
Still available
blax ask "What is TypeScript?" # β
Still available
blax agents list # β
Still available
# New v2.0 features are additive
blax system start # π HMS Dev system
blax deal create # π Collaborative deals
blax watch start # π Real-time monitoring
Migration Steps
- Install Redis:
brew install redis && brew services start redis
- Update Blax:
npm install -g blax@2.0.0
- Verify:
blax system status
See CHANGELOG.md for detailed migration guide.
π οΈ Development
Building from Source
git clone https://github.com/hms-dev/blax.git
cd blax
npm install
npm run build
npm test
Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open Pull Request
Development Workflow
npm run dev # Start development server
npm run typecheck # Type checking
npm run lint # Code linting
npm run test # Run tests
npm run test:coverage # Coverage report
π Troubleshooting
Common Issues
System won't start:
# Check Redis connection
redis-cli ping
# Check port availability
lsof -i :8080
lsof -i :8090
# Debug mode
blax system start --debug
High memory usage:
# Reduce event buffer
export HMS_WATCHDOG_MAX_EVENTS=1000
# Disable compression
export HMS_WATCHDOG_COMPRESS=false
Dashboard not accessible:
# Check component status
blax system status
# Try custom port
blax system start --dashboard-port 9090
Debug Mode
export HMS_DEBUG=true
export HMS_LOG_LEVEL=debug
blax system start --debug
π Documentation
- Complete HMS Dev Guide - Comprehensive integration documentation
- Upgrade Plan - Implementation architecture and design
- Changelog - Version history and migration guide
- API Reference - Complete TypeScript interfaces
- Examples - Usage examples and tutorials
π€ Support
- GitHub Issues: Report bugs and request features
- Documentation: docs.hms-dev.com
- Community Discord: Join discussions
- Email Support: support@hms-dev.com
π License
MIT License - see LICENSE file for details.
π What's Next
Blax v2.0 establishes the foundation for advanced multi-agent collaboration. Future releases will focus on:
- Enhanced AI Integration - Advanced LLM coordination and decision-making
- Extended Platform Support - Cloud deployments and managed services
- Advanced Analytics - Machine learning-powered insights and optimization
- Integration Ecosystem - Third-party tool and service connectors
Thank you for choosing Blax for your multi-agent collaboration needs! π
Ready to get started? Run npm install -g blax@2.0.0
and blax system start
to experience the future of human-AI collaboration.
Powered by HMS-OPM Agency Ecosystem
203+ Professional Domain Agents | 197+ Industry Standards Compliance