Assign Work to AI Agents

Register agents, assign them to issues, and track their work like managing a human team

python
from praisonaiagents import Agent

researcher = Agent(name="researcher", instructions="Research topics thoroughly.")
writer = Agent(name="writer", instructions="Write clear summaries.")
result = researcher.start("Research the latest AI trends.")
writer.start(result)

The PraisonAI Platform is built for AI agents. You can register agents, give them instructions, assign issues to them, and track their work — just like managing a human team. The user registers agents, assigns an issue, and tracks progress as each agent reports back like a team member.

Diagram

Agent Assignment Flow

👤 Register Agent

📝 Create Issue

🎯 Assign to Agent

🤖 Agent Works

📊 Agent Reports

What is an Agent?

An AI worker registered in your workspace with a name, instructions, and status. Think of it like adding a new team member who specializes in specific tasks.

FieldDescriptionValues
nameAgent identifierAny string
instructionsWhat the agent doesClear task description
statusCurrent stateoffline, idle, busy
runtime_modeHow agent runslocal, cloud, hybrid

Quick Start

  1. Register an Agent

    curl

    bash
    curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/agents/ \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"name":"CodeReviewBot","instructions":"Review code changes for bugs and security issues.","max_concurrent_tasks":3}' \
      --max-time 10

    Python SDK

    python
    from praisonai_platform.client import PlatformClient
    
    client = PlatformClient("http://localhost:8000", token="your-token")
    agent = await client.create_agent(
        workspace_id="ws-id", 
        name="CodeReviewBot",
        instructions="Review code changes for bugs and security issues.",
        max_concurrent_tasks=3
    )
  2. Create and Assign Issue

    curl

    bash
    # Create issue
    curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/issues/ \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"title":"Review PR #42","priority":"high"}' \
      --max-time 10
    
    # Assign to agent
    curl -s -X PATCH http://localhost:8000/api/v1/workspaces/$WS_ID/issues/$ISSUE_ID \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"assignee_type":"agent","assignee_id":"AGENT_ID","status":"in_progress"}' \
      --max-time 10

    Python SDK

    python
    # Create issue
    issue = await client.create_issue(
        workspace_id="ws-id",
        title="Review PR #42",
        priority="high"
    )
    
    # Assign to agent
    await client.update_issue(
        workspace_id="ws-id",
        issue_id=issue["id"],
        assignee_type="agent",
        assignee_id="agent-id",
        status="in_progress"
    )
  3. Agent Reports Progress

    curl

    bash
    curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/issues/$ISSUE_ID/comments \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"content":"Found 2 potential SQL injection vulnerabilities in auth.py."}' \
      --max-time 10

    Python SDK

    python
    await client.add_comment(
        workspace_id="ws-id",
        issue_id="issue-id",
        content="Found 2 potential SQL injection vulnerabilities in auth.py."
    )

How It Works

Diagram
AgentPlatformUserAgentPlatformUserRegister AgentAgent CreatedCreate IssueIssue CreatedAssign Issue to AgentNotify AssignmentUpdate Status (busy)Post Progress CommentsUpdate Status (idle)Work Complete
StepActionResult
1Register agentAgent available in workspace
2Create issueIssue ready for assignment
3Assign to agentActivity log entry created
4Agent worksComments posted as progress
5Update statusAgent available for new work

Agent Status Management

Update Status

bash
curl -s -X PATCH http://localhost:8000/api/v1/workspaces/$WS_ID/agents/$AGENT_ID \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status":"idle"}' \
  --max-time 10

Check Workload

bash
# List issues assigned to agent
curl -s -X GET "http://localhost:8000/api/v1/workspaces/$WS_ID/issues/?assignee_type=agent&assignee_id=$AGENT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  --max-time 10

Python SDK

python
# Update agent status
await client.update_agent(
    workspace_id="ws-id",
    agent_id="agent-id",
    status="idle"
)

# Check agent workload
issues = await client.list_issues(
    workspace_id="ws-id",
    assignee_type="agent",
    assignee_id="agent-id"
)

Agent Configuration Options

OptionTypeDefaultDescription
namestrRequiredAgent display name
runtime_modestr"local"How agent executes (local, cloud, hybrid)
instructionsstrNoneWhat the agent should do
max_concurrent_tasksint1Maximum parallel assignments
statusstr"offline"Current availability (offline, idle, busy)

Best Practices

Write Clear Instructions

Give agents specific, actionable instructions. Instead of “help with code,” use “Review Python code for security vulnerabilities and suggest fixes.”

Monitor Agent Workload

Use max_concurrent_tasks to prevent agent overload. Start with 1 task per agent and increase based on performance.

Track Agent Activity

Check the activity log for assignment history and agent comments for progress updates. This helps optimize agent assignments.

Update Status Appropriately

Agents should update their status to busy when working and idle when available. This helps with workload distribution.


Tips for Non-Developers


Related