Skip to content

Amitanand983/TaskAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TaskAI - Multi-Agent Task Execution System

A modern, scalable multi-agent task execution system built with Python, featuring asynchronous processing, safety management, and intelligent task orchestration.

๐Ÿš€ Features

  • Multi-Agent Architecture: Modular agent system with specialized capabilities
  • Asynchronous Processing: High-performance async/await patterns throughout
  • Safety & Security: Comprehensive safety checks and security measures
  • Shared Memory: Redis-backed shared memory for inter-agent communication
  • Message Bus: Asynchronous message passing between agents
  • Task Orchestration: Intelligent task scheduling and dependency management
  • Rich CLI: Beautiful command-line interface with Rich
  • Comprehensive Logging: Structured logging with Loguru
  • Configuration Management: Environment-based configuration with Pydantic
  • Data Validation: Robust validation system for all inputs

๐Ÿ“‹ Requirements

  • Python 3.9+
  • Redis server
  • LLM API keys (Groq, Google, or OpenAI)

๐Ÿ› ๏ธ Installation

  1. Clone the repository:

    git clone <repository-url>
    cd task-ai
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
  4. Start Redis:

    redis-server

๐Ÿš€ Quick Start

  1. Run the system:

    python main.py
  2. Use the CLI:

    taskai> help
    taskai> status
    taskai> submit
    

๐Ÿ“ Project Structure

task-ai/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/           # Core system components
โ”‚   โ”‚   โ”œโ”€โ”€ orchestrator.py    # Task orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ memory.py          # Shared memory system
โ”‚   โ”‚   โ”œโ”€โ”€ message_bus.py     # Message passing
โ”‚   โ”‚   โ””โ”€โ”€ safety.py          # Safety management
โ”‚   โ”œโ”€โ”€ agents/         # Agent implementations
โ”‚   โ”‚   โ”œโ”€โ”€ base_agent.py      # Abstract base class
โ”‚   โ”‚   โ”œโ”€โ”€ planner.py         # Task planning agent
โ”‚   โ”‚   โ”œโ”€โ”€ file_handler.py    # File operations agent
โ”‚   โ”‚   โ”œโ”€โ”€ shell_executor.py  # Command execution agent
โ”‚   โ”‚   โ””โ”€โ”€ monitor.py         # System monitoring agent
โ”‚   โ”œโ”€โ”€ utils/          # Utility modules
โ”‚   โ”‚   โ”œโ”€โ”€ prompt_refiner.py  # LLM prompt optimization
โ”‚   โ”‚   โ””โ”€โ”€ validators.py      # Data validation
โ”‚   โ””โ”€โ”€ config/         # Configuration management
โ”‚       โ””โ”€โ”€ settings.py        # Application settings
โ”œโ”€โ”€ main.py             # CLI entry point
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ”œโ”€โ”€ pyproject.toml      # Project configuration
โ””โ”€โ”€ README.md          # This file

๐Ÿ”ง Configuration

Environment Variables

Create a .env file with the following variables:

# Application
APP_NAME=TaskAI
DEBUG=false

# LLM Configuration
LLM_PROVIDER=groq
LLM_API_KEY=your_api_key_here
LLM_MODEL=llama3-8b-8192

# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0

# Logging
LOG_LEVEL=INFO
LOG_FILE_PATH=logs/taskai.log

# Safety
SAFETY_ENABLED=true
SAFETY_MAX_FILE_SIZE=10485760

Configuration Sections

  • LLM: Language model provider settings
  • Redis: Shared memory backend configuration
  • Logging: Logging behavior and output
  • Safety: Security and safety parameters

๐Ÿค– Agents

Base Agent

Abstract base class providing common functionality:

  • Lifecycle management
  • Task processing
  • Memory access
  • Message passing
  • Error handling

Specialized Agents

  1. Planner Agent: Task decomposition and planning
  2. File Handler Agent: File system operations
  3. Shell Executor Agent: Command execution
  4. Monitor Agent: System monitoring and logging

๐Ÿ”„ Task Execution

Task Lifecycle

  1. Submission: Tasks are submitted to the orchestrator
  2. Validation: Parameters and safety checks are performed
  3. Scheduling: Tasks are queued based on priority and dependencies
  4. Execution: Suitable agents execute the tasks
  5. Completion: Results are stored and status updated

Task Types

  • File Operations: Read, write, delete, list files
  • Command Execution: Execute shell commands safely
  • Data Analysis: Process and analyze data
  • Code Generation: Generate code based on requirements

๐Ÿ›ก๏ธ Safety & Security

Safety Features

  • File Operation Safety: Path validation and extension checking
  • Command Execution Safety: Blocked commands and pattern detection
  • Execution Time Limits: Prevent runaway processes
  • File Size Limits: Prevent memory exhaustion
  • Agent Operation Safety: Controlled agent interactions

Security Measures

  • Input Validation: Comprehensive data validation
  • Path Sanitization: Safe file path handling
  • Command Filtering: Dangerous command detection
  • Resource Limits: Memory and time constraints

๐Ÿ“Š Monitoring & Logging

Logging

  • Structured Logging: JSON-formatted logs with context
  • Multiple Outputs: Console and file logging
  • Log Rotation: Automatic log file management
  • Log Levels: Configurable verbosity

Monitoring

  • System Status: Real-time system health monitoring
  • Agent Performance: Task success/failure tracking
  • Resource Usage: Memory and execution time monitoring
  • Safety Violations: Security incident tracking

๐Ÿ”Œ API Integration

LLM Providers

  • Groq: Fast inference with Llama models
  • Google: Gemini models for complex reasoning
  • OpenAI: GPT models for general tasks

External Services

  • Redis: Shared memory and caching
  • File System: Local and remote file operations
  • Shell: Command execution and process management

๐Ÿงช Development

Setup Development Environment

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Code formatting
black src/
isort src/

# Type checking
mypy src/

Adding New Agents

  1. Inherit from BaseAgent
  2. Implement required abstract methods
  3. Register agent type with orchestrator
  4. Add validation rules

Adding New Task Types

  1. Define task parameters
  2. Add validation schema
  3. Implement agent logic
  4. Update CLI interface

๐Ÿ“ˆ Performance

Optimization Features

  • Async Processing: Non-blocking I/O operations
  • Connection Pooling: Efficient Redis connections
  • Task Queuing: Priority-based task scheduling
  • Memory Management: Automatic cleanup and expiration
  • Resource Limits: Prevent resource exhaustion

Scalability

  • Horizontal Scaling: Multiple agent instances
  • Load Balancing: Intelligent task distribution
  • Resource Isolation: Per-agent resource limits
  • Fault Tolerance: Graceful error handling

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Code Style

  • Follow PEP 8
  • Use type hints
  • Add docstrings
  • Write tests
  • Use async/await patterns

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ†˜ Support

  • Documentation: Check the code comments and docstrings
  • Issues: Report bugs and feature requests on GitHub
  • Discussions: Join community discussions

๐Ÿ”ฎ Roadmap

  • Web-based dashboard
  • REST API
  • Docker support
  • Kubernetes deployment
  • Plugin system
  • Advanced scheduling
  • Machine learning integration
  • Cloud deployment guides

TaskAI - Empowering intelligent task execution through multi-agent collaboration.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published