SuperAPI AI Directory

geo-analyzer

Marketing & growth

View repository

Updated 10-16 06:16

About this skill

Brand GEO Analysis

Introduction

Helps brands understand their performance in AI search engines (Doubao, Kimi, DeepSeek, Yuanbao, Qianwen, Baidu). The system automatically asks the same questions to six AI platforms, analyzes brand appearance rate, sentiment tendency, source citations, and competitor comparisons, and generates a visualized HTML report.

Authentication

Go to Red Fox Hub to get an API Key, and configure it in the following way:

# 方式一:配置文件
{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }

# 方式二:终端环境变量
export REDFOX_API_KEY="ak_xxxx..."

Dependencies

pip3 install requests

Complete Workflow

Step 0: Input Collection

Collect the following information from the user (use AskUserQuestion or extract it directly from the user's message):

Required information:

  • Brand name: The brand name the user wants to analyze (e.g., "Genki Forest", "DJI", "NIO")
  • Category/Industry: The category the brand belongs to (e.g., "sugar-free beverages", "drones", "new energy vehicles")

Optional information:

  • Brand aliases: Other common names for the brand (e.g., the alias "RED" for "Xiaohongshu")
  • Competitor list: Competitors already known to the user (e.g., "Coca-Cola", "Pepsi-Cola")
  • Custom question list: If the user already has a question list, use it directly and skip Step 1

Key rules:

  • If the user only provides the brand name without the category, you must ask for the category
  • If the user provides a question list, skip Step 1 and go directly to Step 2
  • Competitors and aliases can be empty

Step 1: Question Generation (when the user has not provided questions)

If the user has not provided a question list, generate 5 popular questions.

1.1 Search category popularity

Call any websearch skill to search for category-related information:

python3 ~/.agents/skills/doubao-websearch/scripts/doubao_search.py "{品类} 消费者最关心的问题"
python3 ~/.agents/skills/kimi-websearch/scripts/kimi_search.py "{品类} 品牌推荐 常见问题"

1.2 AI generates 5 questions

Combine the search results and category knowledge to generate 5 questions that users are most likely to ask in AI search engines.

The question types must cover the following three categories (at least 1 recommendation-type question, and at least 4 multi-scenario and functional questions combined):

Type Example Description
Recommendation type "Which brand of {category} is good?", "Recommend several easy-to-use {category} products" Test whether the brand enters the general recommendation list
Multi-scenario type "What {category} is good for {group/scenario}?", such as "What eye drops to relieve visual fatigue are good for often staying up late looking at a phone?", "What eye drops to relieve visual fatigue are suitable for students who use their eyes a lot in class?", "What eye drops to relieve visual fatigue are suitable for choosing when working at a computer for a long time?" Test the brand's visibility in real usage scenarios
Functional type "{functional demand} {category} recommendations", such as "gentle and non-irritating eye drops to relieve visual fatigue recommendations", "which eye drops to relieve visual fatigue are easy to use and inexpensive" Test the brand's match under functional demands

Question generation iron rules:

  • All questions must not include the target brand name (including aliases) — only then is the result objective, since the AI does not know who is being tested
  • Do not generate explicit brand comparison questions (such as "Which is better, {Brand A} or {Brand B}"); comparison performance against competitors can be naturally observed from competitor mentions in the answers
  • Multi-scenario questions must fit the brand's real user groups and scenarios (combine category knowledge to construct non-repeating scenarios, such as different user groups, usage occasions, usage intensity)
  • Functional questions should center on the functional points or concerns that users in this category care about most (such as gentle and non-irritating, cost-effectiveness, portability)
  • Questions must be natural language that users might actually search for, with length controlled to 10-30 characters, and do not generate overly similar questions

1.3 Confirm the question list (must be executed)

Show the generated 5 questions to the user and use AskUserQuestion to ask for confirmation. You must wait for the user's explicit consent before proceeding to Step 2 batch search. If the user requests modifications, readjust the question list and confirm again.

Step 2: Batch search

Submit the 5 questions simultaneously to 6 AI platforms for web-enabled search.

python3 scripts/geo_search.py --queries '["问题1","问题2",...,"问题5"]' --platforms doubao,kimi,deepseek,yuanbao,qianwen,baidu

The script automatically completes:

  1. Batch submit 30 search tasks (6 platforms x 5 questions)
  2. Poll all tasks in parallel, checking once every 30 seconds
  3. Wait up to 5 minutes
  4. Output output/search_results.json

Output file structure:

{
  "queries": ["问题1", "问题2", ...],
  "platforms": ["doubao", "kimi", "deepseek", "yuanbao", "qianwen", "baidu"],
  "total_tasks": 30,
  "completed": 28,
  "failed": 2,
  "results": [
    {
      "question": "问题1",
      "query_index": 0,
      "platform": "doubao",
      "content": "AI回答全文...",
      "sources": [{"title": "...", "url": "...", "domain": "..."}],
      "status": "completed"
    }
  ]
}

Waiting prompt: The search process takes about 3-5 minutes; tell the user to wait patiently. Some platform task timeouts are common; directly continue the analysis with the completed answers.

Step 3: Deterministic analysis

Run the analysis script to perform deterministic analysis (brand mention detection, domain extraction, frequency statistics):

python3 scripts/geo_analyze.py \
  --brand "品牌名" \
  --aliases '["别名1","别名2"]' \
  --competitors '["竞品A","竞品B"]' \
  --search-results output/search_results.json

Output two files:

  • output/deterministic.json — deterministic analysis results (mention rate, domain statistics, etc.)
  • output/ai_analysis_template.json — AI analysis template (to be filled)

Step 4: AI analysis (Agent execution)

This is the core step. The Agent needs to read the search results and perform in-depth analysis on each AI answer.

4.1 Read search results

Read output/search_results.json, to obtain all 30 AI answers.

4.2 Analyze one by one

For each answer whose status is completed , analyze the following fields:

  1. brand_rank (int | null): The brand's position in the answer's recommendation list or ranking. If the answer lists "recommend 5 brands", what rank is the brand? If not mentioned, it is null.
  2. brand_context (str): A one-sentence context summary of when the brand is mentioned. If not mentioned, it is an empty string.
  3. sentiment (str): The answer's overall sentiment tendency toward the brand.
    • "positive": positive/recommended/emphasizes advantages
    • "neutral": neutral/objective description
    • "negative": negative/emphasizes disadvantages/not recommended
    • If not mentioned, it is "neutral"
  4. sentiment_reason (str): The basis for the sentiment judgment, quoting the original text from the answer or summarizing the reason.
  5. competitors_mentioned (list[str]): All competitor brand names mentioned in the answer. Not limited to known competitors; list newly discovered competitors as well.
  6. competitor_details (list[dict]): For each mentioned competitor, provide its ranking and sentiment information. The format is a list, with each item containing:
    • name (str): Competitor brand name
    • rank (int | null): The competitor's rank in the recommendation list; if there is no rank, it is null
    • sentiment (str): The competitor's sentiment tendency (positive/neutral/negative)
  7. key_claims (list[str]): Key descriptions or evaluations about the brand (2-3 brief summaries).

Analysis rules:

  • Sentiment judgment is based on the overall description of the brand in the answer, not a single sentence
  • If the answer only lists the brand name without evaluation, sentiment is "neutral"
  • If the answer explicitly recommends the brand or emphasizes its advantages, sentiment is "positive"
  • If the answer points out the brand's shortcomings or does not recommend it, sentiment is "negative"
  • competitors_mentioned should include all brands in the same category that appear in the answer, even if the user did not list them as competitors
  • In competitor_details, each competitor's rank and sentiment are determined based on the description of the competitor in the answer
  • brand_rank is only filled in when the answer has an explicit brand ranking (e.g., "first place is XX, second place is YY"); if there is no ranking, it is null
  • Ranks within the same answer must not be duplicated: brand_rank and each competitor's rank must be different from one another; when presented side by side in the answer, the one presented first/more recommended is ranked ahead, increasing in order (there must not be two tied for 1st)

4.3 Write AI analysis results

Write all analysis results to output/ai_analysis.json, format as follows:

[
  {
    "question": "问题1",
    "query_index": 0,
    "platform": "doubao",
    "brand": "品牌名",
    "competitors": ["竞品A", "竞品B"],
    "brand_rank": 3,
    "brand_context": "品牌被提及时的上下文摘要",
    "sentiment": "positive",
    "sentiment_reason": "回答中明确推荐该品牌",
    "competitors_mentioned": ["竞品A", "竞品C"],
    "competitor_details": [
      {"name": "竞品A", "rank": 1, "sentiment": "positive"},
      {"name": "竞品C", "rank": null, "sentiment": "neutral"}
    ],
    "key_claims": ["关键描述1", "关键描述2"]
  }
]

Key rules:

  • Include only answers with status completed
  • One JSON object per answer
  • query_index and platform must correspond to those in search_results.json
  • Must output valid JSON

Step 5: Merge analysis and report generation

5.1 Merge analysis

Merge the deterministic analysis with the AI analysis, and calculate complete metrics (GEO score, sentiment distribution, average rank, etc.):

python3 scripts/geo_analyze.py \
  --brand "品牌名" \
  --aliases '["别名1"]' \
  --competitors '["竞品A","竞品B"]' \
  --search-results output/search_results.json \
  --ai-analysis output/ai_analysis.json

Output output/analysis_result.json(containing all metric data).

5.2 Generate HTML report

python3 scripts/geo_report.py \
  --analysis output/analysis_result.json \
  --search-results output/search_results.json

Output output/geo_report.html(single-page interactive, top anchor navigation, scroll highlighting of the current section). Report structure:

Section Content
Top summary Brand name, GEO composite score, mention rate, platforms covered, generation time + AI text summary (overall assessment / performance by platform / areas to focus on)
Brand fingerprint Four major metric cards for GEO composite, mention rate, average rank, and positive rate + score cards by platform (score / grade badge / mention rate / count) + industry position (#rank · number of brands involved)
Mention matrix Question × platform heatmap: mentioned = number of occurrences, not mentioned = —, query failed = ✕
Sentiment analysis Overall distribution (positive / neutral / negative) + sentiment comparison bars by platform + positive/negative signal tags + detail cards for non-neutral answers (including the basis for judgment)
Source analysis Top 10 cited domains (with category tags, brand domains highlighted *) + Top 10 cited articles (clickable) + proportion of domain categories + prompt on whether the official website entered the Top 10
Competitor comparison This brand's row (highlighted with the "This brand" badge) + competitors in descending order of mention rate (up to 10), with columns for mention rate / average rank / positive rate; click a row to expand details by platform
Raw archive Display all original AI answers grouped by question (brand terms highlighted), each with a platform badge + sentiment badge, and failed tasks marked with [status]

Dependency notes: The sentiment analysis section relies on the ai_analysis.jsonwritten in Step 4. If missing, display the "No AI sentiment analysis data" placeholder, and the rest of the report sections are generated as usual.

Step 6: Delivery

  1. Deliver the HTML report file: output/geo_report.html
  2. Output a summary of key findings(3-5 core conclusions), format reference:
GEO 分析完成 — {品牌名} 在六大 AI 搜索引擎中的表现:

1. 跨平台提及率: {X}%({被提及数}/{总问题数})
   - 豆包: {X}% | Kimi: {X}% | DeepSeek: {X}% | 元宝: {X}% | 千问: {X}% | 百度: {X}%

2. GEO 综合得分: {X}/100
   - {最佳平台} 表现最佳({X}分),{最差平台} 表现最弱({X}分)

3. 情绪分布: 正面 {X}% | 中性 {X}% | 负面 {X}%
   - 正面率 = 1 − 负面率(中性计入正面)
   - {如果有负面,指出主要负面原因}

4. 竞品对比: 共发现 {N} 个竞品
   - 提及率最高的竞品: {竞品名}({X}%)
   - 您的品牌提及率排名: 第 {N} 位

5. 信源引用: TOP3 引用域名为 {域名1}、{域名2}、{域名3}
   - 品牌官网是否被引用: {是/否}(若某平台整体无信源数据,须说明该平台信源不可用,不要当作"官网未被引用")

完整报告: output/geo_report.html

Core metrics

For detailed definitions, see references/geo-metrics.md. Core formula:

GEO 得分 = 提及率得分 × 40% + 排名得分 × 30% + 情绪得分 × 30%
        = 提及率×100 × 40% + max(0, 100 - (均排名-1)×10) × 30%
          + 正面率×100 × 30%(正面率 = 1 − 负面率,中性计入正面)

Interpretation: 70+ Excellent / 50-69 Good / 30-49 Fair / <30 Insufficient.

Error handling

Situation Handling method
REDFOX_API_KEY not configured Prompt the user to go to Redfox Hub to obtain an API Key
Some search tasks failed/timed out This is a common occurrence (DeepSeek/Kimi may queue for a long time). Wait up to 5 min; after timeout, continue the analysis directly with the completed responses, mark the failed items in the report, and do not retry repeatedly
All searches timed out Prompt the user to try again later; the API load may be too high
AI analysis results missing Generate only the deterministic analysis report (mention rate, domain statistics); mark modules such as sentiment as "pending analysis"
Brand name too short causing false matches Prompt the user to provide brand aliases to improve matching accuracy

File structure

geo-analyzer/
├── SKILL.md                        # 本文件
├── scripts/
│   ├── geo_search.py               # 批量搜索调度器
│   ├── geo_analyze.py              # 分析编排器
│   ├── geo_report.py               # 报告生成器
│   └── lib/
│       ├── platforms.py            # 6平台适配器
│       ├── analyzer.py             # 分析逻辑库
│       └── report_template.py      # HTML 模板库
├── output/                         # 输出目录
│   ├── search_results.json         # 搜索结果
│   ├── deterministic.json          # 确定性分析
│   ├── ai_analysis_template.json   # AI 分析模板
│   ├── ai_analysis.json            # AI 分析结果(Agent 写入)
│   ├── analysis_result.json        # 完整分析结果
│   └── geo_report.html             # 最终报告
└── references/
    └── geo-metrics.md              # GEO 指标定义说明