StateSet Computer Use Agents - Quick Start Guide

🚀 Quick Setup

1. Install and Activate

git clone https://gitlab.com/stateset/stateset-computer-use-agent.git
cd stateset-computer-use-agent
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Run Your First Agent

# Auto-close tickets
./start-autoclose-agent.sh

# Or with custom instruction
python main.py "auto-close all pending tickets"

📋 Common Commands

Agent-Specific Commands

Auto-Close Agent

# Using script
./start-autoclose-agent.sh

# Direct command
python main.py "auto-close tickets"

Social Media Agent

# Using script
./start-socialmedia-agent.sh

# Direct command
python main.py "social media content moderation"

LinkedIn Agent

# Using script
./start-linkedin-agent.sh

# Direct command
python main.py "linkedin send connection requests"

Slack Support Agent

# Using script
./start-slack-agent.sh

# Direct command
python main.py "slack respond to customer inquiries"

Shopify Agent

# Using script
./start-shopify-agent.sh

# Direct command
python main.py "shopify update product inventory"

General Purpose Commands

# Custom task with general agent
./start-general-agent.sh "your task description here"

# Multiple agents simultaneously
python main.py "auto-close tickets and social media monitoring"

🔧 Configuration Examples

Setting Display Resolution

Edit main.py:

WIDTH = 1920   # Full HD width
HEIGHT = 1080  # Full HD height

API Key Configuration

Replace in main.py:

api_key = 'sk-ant-api03-YOUR-KEY-HERE'

Custom Agent Selection Logic

Add to get_active_agents() function:

if "custom_keyword" in instruction:
    active_agents.append(AGENT_CONFIGS["YOUR_AGENT"])

📊 Monitoring Commands

View Logs in Real-Time

# Follow logs as they're generated
python main.py "your task" 2>&1 | tee agent.log

# Filter logs by agent type
python main.py "your task" | grep "\[AUTO_CLOSE\]"

Check Screenshots

# List all screenshots
ls -la screenshots/*/

# View latest screenshot
eog screenshots/AUTO_CLOSE/screenshot_*.png

🛠️ Troubleshooting Commands

Check Dependencies

pip list | grep -E "anthropic|httpx|streamlit"

Test Display

echo $DISPLAY
xdpyinfo

Verify API Connectivity

curl -X POST https://response.cx/api/agents/get-agent \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "your-agent-id"}'

💡 Usage Examples

Example 1: Close Support Tickets

python main.py "auto-close all tickets marked as resolved in the last 24 hours"

Example 2: Social Media Monitoring

python main.py "social media hide inappropriate comments on our Facebook page"

Example 3: LinkedIn Outreach

python main.py "linkedin send connection requests to software engineers in San Francisco"

Example 4: Slack Customer Support

python main.py "slack respond to questions in #customer-support channel"

Example 5: Shopify Management

python main.py "shopify update inventory levels for out-of-stock products"

🔑 Key Environment Variables

# Set display for GUI applications
export DISPLAY=:1

# Optional: Set Anthropic API key
export ANTHROPIC_API_KEY="your-key-here"

# Optional: Set workspace path
export WORKSPACE_PATH="/home/user/stateset-computer-use-agent"

📈 Performance Tips

  1. Run Multiple Agents: Use ”&” to run agents in background

    python main.py "auto-close tickets" &
    python main.py "social media monitoring" &
    
  2. Limit Token Usage: Modify in code

    max_tokens=2048  # Instead of 4096
    
  3. Reduce Screenshot Frequency: Modify in code

    only_n_most_recent_images=3  # Instead of 5
    

🛡️ Security Quick Checks

# Check API key isn't in git
git grep "sk-ant-api"

# Verify permissions
ls -la ~/.ssh/
chmod 600 ~/.ssh/id_rsa

# Check running processes
ps aux | grep python

📝 Notes

  • Always use Ctrl+C for graceful shutdown
  • Screenshots are saved in screenshots/{AGENT_TYPE}/
  • Logs show [AGENT_TYPE] prefix for easy filtering
  • Billing only occurs for completed tasks
  • Virtual display must be running (DISPLAY=:1)

For detailed documentation, see USERGUIDE.md