A fully autonomous AI system capable of understanding user intent, planning actions, executing them across supported tools and services, handling errors gracefully, and continuously improving through feedback.
- Intent Understanding: Advanced NLP for understanding user requests
- Smart Planning: Multi-step task planning with dependency resolution
- Intelligent Execution: Execute tasks across multiple services and tools
- Error Recovery: Automatic error handling with multiple recovery strategies
- Continuous Learning: Machine learning-based improvement from user feedback
- Email Services: Gmail integration for sending/receiving emails
- Calendar Management: Create, update, and manage calendar events
- Media Control: Play music, videos, and manage playlists
- Weather Information: Real-time weather data and forecasts
- Web Services: REST API, Webhook, and WebSocket integrations
- Voice Interface: Speech-to-text and text-to-speech capabilities
- User Preferences: Learn and adapt to user preferences
- Pattern Recognition: Identify and learn from usage patterns
- Feedback Integration: Continuous improvement through user feedback
- Auto-Training: Automated model training and optimization
pip install -r requirements.txt
pip install -r requirements-autonomous.txt # Additional dependenciesCreate .env file with:
# Core JAI Configuration
OPENAI_API_KEY=your_openai_api_key
GROQ_API_KEY=your_groq_api_key
# Gmail Integration (Optional)
GMAIL_CLIENT_ID=your_gmail_client_id
GMAIL_CLIENT_SECRET=your_gmail_client_SECRET
# Weather API (Optional)
WEATHER_API_KEY=your_weather_api_key
# Autonomous System
JAI_AUTONOMOUS_ENABLED=true
JAI_LEARNING_ENABLED=true
JAI_ERROR_RECOVERY_ENABLED=trueThe system automatically creates SQLite databases:
jai_autonomous_feedback.json- User feedback datajai_user_preferences.json- User preferencesjai_learning_data/- Machine learning datajai_integrations.json- External integrations
- Start the web server:
python main.py
# or
uvicorn main:app --host 0.0.0.0 --port 80- Open your browser to:
- Main Interface:
https://j-ai.top/ - Autonomous Dashboard:
https://j-ai.top/autonomous
- Main Interface:
- System Status: Real-time monitoring of autonomous operations
- Task Management: View active tasks and execution history
- Performance Metrics: Success rates, response times, error statistics
- Learning Insights: View learned patterns and user preferences
- Feedback System: Rate and provide feedback on task performance
- Integration Management: Configure external service integrations
POST /api/autonomous/process
Content-Type: application/json
{
"text": "Send email to john@example.com about the meeting tomorrow",
"autonomous": true,
"context": {}
}POST /api/autonomous/enable
POST /api/autonomous/disable
POST /api/autonomous/emergency-stopGET /api/autonomous/statistics
GET /api/autonomous/active-tasks
GET /api/autonomous/task-history
GET /api/autonomous/learning-insightsPOST /api/autonomous/feedback
{
"task_id": "task_123",
"rating": 5,
"comment": "Perfect execution!"
}
POST /api/autonomous/trainGET /api/integrations
POST /api/integrations
{
"name": "Slack Webhook",
"type": "webhook",
"auth_type": "api_key",
"endpoint": "https://hooks.slack.com/...",
"auth_data": {"api_key": "xoxb-..."}
}- Explicit Feedback: User ratings and comments on task performance
- Implicit Learning: Analysis of user behavior and corrections
- Pattern Recognition: Identifying recurring patterns in requests
- Preference Adaptation: Learning user preferences over time
- Feedback History: All user feedback with ratings and comments
- Usage Patterns: Time-based usage analysis and preferences
- Error Analysis: Common errors and successful recovery strategies
- Intent Patterns: Learned patterns for intent classification
# Manual training
from jai_learning_system import learning_system
await learning_system.auto_improve()
# View learning insights
insights = learning_system.get_learning_insights()
print(insights)# Send email autonomously
result = await jai_autonomous.process_request(
"Send email to team@company.com about the project update",
context={"priority": "high"}
)# Schedule meeting
result = await jai_autonomous.process_request(
"Schedule team meeting for tomorrow at 2 PM with John and Sarah"
)# Add Slack webhook
import requests
webhook_config = {
"name": "Slack Notifications",
"type": "webhook",
"auth_type": "api_key",
"endpoint": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
"auth_data": {"api_key": "your_token"}
}
response = requests.post(
"http://localhost:8080/api/integrations",
json=webhook_config
)- Exponential Backoff: Retry with increasing delays
- Token Refresh: Automatic authentication token renewal
- Fallback Services: Switch to backup services when primary fails
- Resource Cleanup: Clean up and retry resource-related errors
- Graceful Degradation: Continue with reduced functionality
- Network: Connection issues, timeouts
- Authentication: Invalid/expired credentials
- Permission: Access rights issues
- Resource: Memory, disk, or quota limits
- External Service: Third-party service failures
- Success Rate: Percentage of successfully completed tasks
- Response Time: Average time to process requests
- Error Rate: Frequency of errors by category
- Learning Progress: Improvement in accuracy over time
- Integration Health: Status of external service connections
Real-time monitoring includes:
- Active task execution
- System resource usage
- API response times
- Error trends and patterns
- Learning model performance
- API Keys: Secure storage of external service credentials
- OAuth2: Standard OAuth2 flow for supported services
- Token Management: Automatic token refresh and rotation
- Local Storage: All learning data stored locally
- Encryption: Sensitive data encrypted at rest
- Access Control: User-specific data isolation
from jai_autonomous import TaskExecutor
class CustomHandler(TaskExecutor):
async def handle_custom_service(self, action: str, params: dict):
# Custom implementation
return {"success": True, "result": "Custom action completed"}
# Register custom handler
jai_autonomous.task_executor.handlers['custom'] = CustomHandler()# Create complex multi-step workflows
workflow_request = """
Plan and execute a complete project kickoff:
1. Schedule kickoff meeting for next week
2. Send calendar invites to all team members
3. Create project documentation template
4. Set up Slack channel for project communication
5. Send summary email to stakeholders
"""
result = await jai_autonomous.process_request(workflow_request)- Import Errors: Ensure all dependencies are installed
- Authentication Failures: Check API keys and credentials
- Database Issues: Verify write permissions for data directory
- Network Errors: Check internet connectivity for external services
# Enable debug logging
import logging
logging.basicConfig(level=logging.DEBUG)
# View detailed error information
from jai_error_handler import error_handler
stats = error_handler.get_error_statistics()
print(stats)- Caching: Enable response caching for repeated requests
- Batch Processing: Group similar operations for efficiency
- Resource Management: Monitor and optimize memory usage
- Connection Pooling: Reuse connections for external services
git clone https://github.com/HACKERpgx/JAI.git
cd JAI
pip install -r requirements.txt
pip install -r requirements-autonomous.txt# Run autonomous system tests
python -m pytest tests/test_autonomous.py
# Test individual components
python test_autonomous_integration.pyThis project is part of the JAI (Just Another Intelligence) system. See main LICENSE file for details.
For issues and questions:
- Check the troubleshooting section
- Review error logs in
jai_autonomous.log - Create an issue on the GitHub repository
- Include system logs and configuration details
JAI Autonomous System - Transforming AI assistance into true autonomy. 🚀