Skip to main content

Competitive Analysis Agent

This agent demonstrates long-running tasks in Orpheus. It takes a list of URLs and performs a deep analysis, which can take several minutes to complete.

How it Works

  1. Input: Takes a list of competitor URLs and a topic.
  2. Processing:
    • Simulates crawling each website (5-10 seconds per site).
    • Extracts key points related to the topic.
    • Synthesizes a final report using an LLM (simulated).
  3. Output: Returns a markdown-formatted analysis report.

Key Features

  • Custom Timeout: Configured with a 10-minute timeout (timeout: 600) to handle long processing times.
  • Progress Tracking: Logs progress to stdout, which can be viewed in real-time logs.
  • Memory Usage: Allocates more memory (memory: 1024) for handling large text content.

Usage

orpheus run competitive-analysis '{
  "urls": ["example.com", "competitor.io"],
  "topic": "pricing strategy"
}'

Source Code

name: competitive-analysis
runtime: python3
module: agent
entrypoint: handler

# Resource allocation
memory: 1024
timeout: 600  # 10 minutes - critical for long workflow

# Environment variables
env:
  - OPENAI_API_KEY=${OPENAI_API_KEY}      # Set in your environment
  - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}  # Set in your environment

# Scaling configuration
scaling:
  min_workers: 1
  max_workers: 5
  target_utilization: 1.5
  scale_up_threshold: 2.0
  scale_down_threshold: 0.3
  scale_up_delay: "20s"
  scale_down_delay: "60s"
  queue_size: 10