File size: 1,578 Bytes
3eb9a4a
 
2f37145
3eb9a4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f37145
3eb9a4a
 
 
 
 
 
 
 
 
2f37145
3eb9a4a
 
 
 
 
 
 
 
 
2f37145
3eb9a4a
 
2f37145
3eb9a4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from serp_tool import search_google
from llm_tool import analyze_data

def run_analysis(input_type, query):
    """
    Core agent logic to handle different analysis types
    """
    if input_type == "Competitor Analysis":
        raw_data = search_google(f"site:{query} reviews pricing features")
        prompt = f"""Analyze competitor {query} using these reviews and features: {raw_data}

Generate a detailed SWOT analysis:
1. Strengths
2. Weaknesses
3. Opportunities
4. Threats

Include pricing strategy insights and customer sentiment summary."""
    
    elif input_type == "Keyword Research":
        raw_data = search_google(f"best keywords for {query}")
        prompt = f"""Generate SEO keyword report for "{query}" using: {raw_data}

List:
1. Top 5 keywords (with search volume and CPC)
2. Content gap opportunities
3. Backlink strategies
4. Competitor keyword analysis"""
    
    elif input_type == "Trend Discovery":
        raw_data = search_google(f"latest trends in {query} 2024")
        prompt = f"""Identify emerging trends in "{query}" using: {raw_data}

Report:
1. Top 3 trends
2. Viral content patterns
3. Customer pain points
4. Opportunity areas"""
    
    elif input_type == "Idea Validation":
        raw_data = search_google(f"market demand for {query}")
        prompt = f"""Validate business idea "{query}" using market data: {raw_data}

Assess:
1. Market demand score (1-10)
2. Competitor saturation
3. Pricing benchmarks
4. Go-to-market strategy"""
    
    else:
        return "Invalid analysis type selected"

    return analyze_data(prompt)