Skip to content

yordanos-habtamu/AI-Task-Assigner

Repository files navigation

πŸ€– AI Task Assignment System

An intelligent task assignment system powered by AI that analyzes GitHub issues and developer profiles to make optimal task assignments. Features multi-provider AI support, Google SSO authentication, and automatic notification generation.

✨ Features

πŸ” Authentication & Security

  • User Authentication: Secure login/signup with password hashing
  • Google SSO: One-click sign-in with Google OAuth
  • API Key Management: Store and auto-load your AI provider keys

πŸ€– Multi-Provider AI Support

  • OpenAI (GPT-4, GPT-3.5)
  • Google Gemini (Gemini 1.5 Pro, Gemini 2.0 Flash)
  • Local AI (Ollama - run models locally)

πŸ“Š Smart Task Assignment

  • GitHub Integration: Fetch issues and contributors directly from repositories
  • AI Analysis: Intelligent matching of tasks to developers based on skills, workload, and preferences
  • Manual Upload: JSON file upload for offline use

πŸ“ Notification System

  • Auto-generate Jira tickets with professional descriptions
  • Create Slack messages for developer notifications
  • Draft Messenger updates for quick status sharing

πŸ’Ύ Database & History

  • SQLite database for persistent storage
  • Assignment history tracking
  • User profile management

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Git
  • Google Cloud Console account (for Google SSO)

Installation

  1. Clone the repository
git clone https://github.com/yordanos-habtamu/AI-Task-Assigner.git
cd AI-Task-Assigner
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables
cp .env.example .env

Edit .env and add your API keys:

# AI Provider (choose one)
OPENAI_API_KEY=your_openai_key
# OR
GOOGLE_API_KEY=your_gemini_key

# Google OAuth (optional, for SSO)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

# GitHub (optional, for higher rate limits)
GITHUB_TOKEN=your_github_token

Running the Application

Option 1: With Google SSO (Recommended)

Terminal 1 - Start OAuth Server:

./run_oauth.sh

Terminal 2 - Start Streamlit App:

./run.sh

Access at:

Option 2: Without Google SSO

./run.sh

Then create an account using username/password.

πŸ”§ Configuration

Google SSO Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Go to APIs & Services β†’ Credentials
  4. Click Create Credentials β†’ OAuth 2.0 Client ID
  5. Configure OAuth consent screen
  6. Add redirect URI: http://localhost:8502/auth/google/callback
  7. Copy Client ID and Client Secret to .env

See GOOGLE_SSO_SETUP.md for detailed instructions.

AI Provider Setup

OpenAI

  1. Get API key from OpenAI Platform
  2. Add to .env: OPENAI_API_KEY=sk-...

Google Gemini

  1. Get API key from Google AI Studio
  2. Add to .env: GOOGLE_API_KEY=...

Ollama (Local AI)

  1. Install Ollama: https://ollama.ai
  2. Pull a model: ollama pull llama3.1
  3. Start Ollama: ollama serve

πŸ“– Usage

1. Sign In

  • Google: Click "Continue with Google"
  • Username/Password: Create an account or login

2. Configure AI Provider

  • Select provider (OpenAI, Gemini, or Ollama)
  • Enter API key if needed
  • Choose model
  • Click "πŸ’Ύ Save API Keys to Profile" (optional)

3. Load Data

Option A: GitHub Repository

  • Enter repository URL (e.g., owner/repo)
  • Add GitHub token for private repos
  • Click "Fetch Data"

Option B: Manual JSON Upload

  • Upload issues.json and developers.json
  • See backend/data/ for example formats

4. Run Assignment

  • Click "πŸš€ Run AI Assignment"
  • View results in the table
  • Check "πŸ“ Review & Send" tab for notifications

5. Review Notifications

  • Edit Jira ticket descriptions
  • Customize Slack messages
  • Click "πŸš€ Send All (Simulate)" or individual send buttons

πŸ“ Project Structure

TaskAssignAi/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ ai/                      # AI agents
β”‚   β”‚   β”œβ”€β”€ llm_provider.py     # Multi-provider abstraction
β”‚   β”‚   β”œβ”€β”€ issue_agent.py      # Issue analysis
β”‚   β”‚   β”œβ”€β”€ dev_agent.py        # Developer analysis
β”‚   β”‚   β”œβ”€β”€ assign_agent.py     # Task assignment
β”‚   β”‚   └── notification_agent.py # Notification generation
β”‚   β”œβ”€β”€ oauth_server.py         # Flask OAuth server
β”‚   β”œβ”€β”€ database.py             # SQLAlchemy models
β”‚   β”œβ”€β”€ crud.py                 # Database operations
β”‚   β”œβ”€β”€ auth_utils.py           # Password hashing
β”‚   └── data/                   # Sample JSON files
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ app.py                  # Main Streamlit UI
β”‚   └── auth.py                 # Login/Signup pages
β”œβ”€β”€ run.sh                      # Start Streamlit
β”œβ”€β”€ run_oauth.sh               # Start OAuth server
└── requirements.txt           # Python dependencies

πŸ› οΈ Development

Running Tests

pytest

Backend Only

python backend/main.py

Database Management

# View database
sqlite3 task_assignments.db

# Reset database
rm task_assignments.db

πŸ”’ Security Notes

  • API keys are stored in plain text in the database (encrypt in production)
  • Use HTTPS in production
  • Rotate OAuth secrets regularly
  • Don't commit .env file to version control

🀝 Contributing

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

πŸ“ License

MIT License - see LICENSE file for details

πŸ™ Acknowledgments

  • Built with Streamlit
  • AI powered by OpenAI, Google Gemini, and Ollama
  • OAuth integration with Authlib

πŸ“ž Support

For issues and questions:


Made with ❀️ by the TaskAssignAI Team

About

AI task assigner works using github issues. Assigns tasks to developers based on their experince and knowledge.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors