{
  "id": "ipjuNfsmlCZSD52V",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "LLM Brand Visibility Monitor - blankarray",
  "tags": [],
  "nodes": [
    {
      "id": "101cf1a0-1877-4cc4-9b88-45287f2ec7ab",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 784,
        "content": "## LLM Brand Visibility Monitor - blankarray\n\n### How it works\n\n1. The workflow triggers daily and loads the specified brand and competitor configuration. 2. It generates a bank of prompts using a Gemini model and prepares them for processing. 3. Multiple AI agents powered by different models and search tools gather responses for each prompt. 4. The responses are analyzed and scored, and the results are appended to a Google Sheet. 5. The statistics are summarized into an overall visibility digest which is posted to a Slack channel.\n\n### Setup steps\n\n- [ ] Configure API credentials for Google Gemini, Groq, OpenRouter, and Tavily Search.\n- [ ] Set up Google Sheets credentials and select the target spreadsheet for saving result rows.\n- [ ] Authenticate the Slack node and specify the channel for the daily digest.\n- [ ] Update the Brand & Competitor Config node with your brand details.\n\n### Customization\n\nYou can adjust the schedule trigger frequency, swap out the AI models used in the agent nodes, or modify the Slack message layout to match your reporting needs."
      },
      "typeVersion": 1
    },
    {
      "id": "6b3ec488-3190-4a52-9b83-1f3e4f018f8f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 320,
        "content": "## Initialize Configuration\n\nTriggers the workflow daily and establishes the target brand, domain, industry, and competitors."
      },
      "typeVersion": 1
    },
    {
      "id": "59a982ed-9c8c-43a8-a390-dbb71c3cd37f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 304,
        "content": "## Generate Prompt Bank\n\nCalls the Gemini API to create search prompts, parses the resulting JSON, and splits the prompts into individual items for processing."
      },
      "typeVersion": 1
    },
    {
      "id": "c3323b2f-dd03-49b1-8893-32831bf0424e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 1152,
        "height": 496,
        "content": "## Execute AI Search Queries\n\nRuns the generated prompts through multiple AI agents equipped with Tavily Search capabilities to gather varied responses."
      },
      "typeVersion": 1
    },
    {
      "id": "958270b9-2af4-49e0-873d-af7ea5317170",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 304,
        "content": "## Analyze Responses and Save Data\n\nUses Gemini to evaluate and score the AI responses, flattens the output data structure, and records findings."
      },
      "typeVersion": 1
    },
    {
      "id": "4b1d6086-c0f3-4ab7-b091-6979de087780",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3760,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 304,
        "content": "## Summarize and Notify Slack\n\nAggregates the daily visibility statistics and sends a summary digest to a Slack channel."
      },
      "typeVersion": 1
    },
    {
      "id": "edf2de0b-d428-4c4e-85e8-ff95cf0446e1",
      "name": "Daily 7AM Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        608,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5827550c-e5db-4253-9c92-884caa29fd51",
      "name": "Set Brand Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c1",
              "name": "brand_name",
              "type": "string",
              "value": "enter-your-brand-name"
            },
            {
              "id": "c2",
              "name": "brand_domain",
              "type": "string",
              "value": "enter-your-brand-domain"
            },
            {
              "id": "c3",
              "name": "industry",
              "type": "string",
              "value": "enter-your-brand-industry"
            },
            {
              "id": "c4",
              "name": "competitors",
              "type": "string",
              "value": "enter-your-brand-competitors"
            },
            {
              "id": "c5",
              "name": "target_market",
              "type": "string",
              "value": "enter-your-brand-target-market"
            },
            {
              "id": "c6",
              "name": "prompt_count",
              "type": "number",
              "value": 15
            },
            {
              "id": "c7",
              "name": "run_id",
              "type": "string",
              "value": "={{ $now.format('yyyy-MM-dd') }}"
            },
            {
              "id": "c8",
              "name": "alert_threshold_pct",
              "type": "number",
              "value": 30
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c85e38e5-383e-49bc-808b-986d7c1421c0",
      "name": "Generate Prompts via Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1056,
        160
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={{\n  {\n    \"contents\": [\n      {\n        \"role\": \"user\",\n        \"parts\": [\n          {\n            \"text\": `You are building a test-prompt bank for an LLM brand visibility audit.\\nBrand: ${$json.brand_name} (${$json.brand_domain})\\nIndustry: ${$json.industry}\\nTarget buyer: ${$json.target_market}\\nCompetitors to watch for: ${$json.competitors}\\n\\nGenerate ${$json.prompt_count} realistic prompts that a real buyer would type into ChatGPT, Gemini, or Perplexity while researching this category. Cover this mix of intents:\\n- direct brand lookup (2)\\n- 'best tool for X' recommendation asks (4)\\n- head-to-head comparison vs named competitors (3)\\n- problem/pain-point phrased asks with no brand named (4)\\n- 'alternatives to <competitor>' asks (2)\\nReturn ONLY JSON matching the schema.`\n          }\n        ]\n      }\n    ],\n    \"generationConfig\": {\n      \"responseMimeType\": \"application/json\",\n      \"responseSchema\": {\n        \"type\": \"OBJECT\",\n        \"properties\": {\n          \"prompts\": {\n            \"type\": \"ARRAY\",\n            \"items\": {\n              \"type\": \"OBJECT\",\n              \"properties\": {\n                \"id\": {\n                  \"type\": \"STRING\"\n                },\n                \"category\": {\n                  \"type\": \"STRING\"\n                },\n                \"prompt_text\": {\n                  \"type\": \"STRING\"\n                }\n              },\n              \"required\": [\n                \"id\",\n                \"category\",\n                \"prompt_text\"\n              ]\n            }\n          }\n        },\n        \"required\": [\n          \"prompts\"\n        ]\n      }\n    }\n  }\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b188850f-00a1-4363-b021-b4e9488b8f7e",
      "name": "Parse Prompt Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        160
      ],
      "parameters": {
        "jsCode": "const raw = $input.first().json.candidates[0].content.parts[0].text;\nconst parsed = JSON.parse(raw);\nreturn [{ json: { prompts: parsed.prompts } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "2e656bad-b62c-4fb3-8026-25603d2a8db4",
      "name": "Split Prompts List",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1504,
        160
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "prompts"
      },
      "typeVersion": 1
    },
    {
      "id": "538d2783-21f6-4fee-a4b2-627fee044849",
      "name": "Gemini Search Agent Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2720,
        384
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-3.1-flash-lite"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "3be665ee-2736-4f42-966b-dd32de04f502",
      "name": "Tavily Search Tool Alpha",
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "position": [
        2928,
        384
      ],
      "parameters": {
        "query": "={{ $('Limit to 10 Prompts').item.json.prompt_text }}",
        "options": {
          "chunks_per_source": 3
        }
      },
      "credentials": {
        "tavilyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b4fa9688-6e23-421d-9ce3-30321f18bc25",
      "name": "Search Grounded Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2736,
        160
      ],
      "parameters": {
        "text": "={{ $('Limit to 10 Prompts').item.json.prompt_text }}",
        "options": {
          "systemMessage": "You are a search-grounded answer engine, similar to Perplexity. Answer the user's question directly and concisely, using the search tool to ground your answer in current web sources. Always mention which brands/tools you are recommending and cite the domains your answer is based on."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "51583e64-ca40-425d-ba1f-eaf989afac66",
      "name": "Analyze Scores with Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3136,
        160
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={{\n  {\n    \"contents\": [\n      {\n        \"role\": \"user\",\n        \"parts\": [\n          {\n            \"text\": \"You are auditing brand visibility for \" + $('Set Brand Configuration').first().json.brand_name + \" in LLM answers. Be strict and skeptical \u2014 do not let confident tone fool you into thinking a model actually knows the brand. Use ONLY the brand information given below; do not assume any industry, niche, or business type that isn't explicitly stated.\\n\\nBrand being audited: \" + $('Set Brand Configuration').first().json.brand_name + \"\\nWhat this brand actually does (ground truth): \" + ($('Set Brand Configuration').first().json.brand_description ? $('Set Brand Configuration').first().json.brand_description : 'NOT PROVIDED \u2014 be extra conservative. Only mark genuinely_recognized true if a model states specific, internally-consistent, plausible facts about the brand.') + \"\\nKnown real competitors: \" + ($('Set Brand Configuration').first().json.competitors ? $('Set Brand Configuration').first().json.competitors : 'NOT PROVIDED') + \"\\nOriginal prompt asked: \" + $('Limit to 10 Prompts').item.json.prompt_text + \"\\n\\nYou are evaluating THREE answers from different AI agents. Two are UNGROUNDED (no live web access), and one is GROUNDED (used live web search):\\n\\n--- 1. Groq (ungrounded) ---\\n\" + $('Query Groq Llama Agent').first().json.output + \"\\n\\n--- 2. OpenRouter (ungrounded) ---\\n\" + $('Query OpenRouter Agent').first().json.output + \"\\n\\n--- 3. Search Agent (grounded via web search) ---\\n\" + $('Search Grounded Agent').first().json.output + \"\\n\\nFor EACH of the three agents (Groq, OpenRouter, and Search Agent), evaluate the following:\\n\\n1. genuinely_recognized: true ONLY if the agent demonstrates real, specific, factually plausible knowledge of \" + $('Set Brand Configuration').first().json.brand_name + \". If the agent says it has never heard of it, is unsure, or gives generic 'how to vet an unknown provider' advice, that is HALLUCINATED SPECULATION. In those cases, genuinely_recognized MUST be false.\\n2. mentioned: true if the brand name explicitly appears anywhere in the model's text. A model can hallucinate the facts (genuinely_recognized = false) but still successfully mention the brand (mentioned = true). If the name is nowhere in the text, it is false.\\n3. position: headline/body/footnote/not_mentioned \u2014 evaluate this based on where the mention occurs if mentioned is true.\\n4. sentiment: -1 to 1 \u2014 evaluate the tone if mentioned is true; otherwise 0.\\n5. competitors: ONLY real business competitors operating in the SAME category as \" + $('Set Brand Configuration').first().json.brand_name + \". Do NOT include generic underlying tools unless recommended as a direct alternative.\\n6. hallucinated_guess: true if the agent admitted uncertainty and then fabricated guesses about what the brand might be, or if it got the facts completely wrong while confidently using the brand name.\\n\\nFor the Search Agent specifically: extract cited source domains into search_agent_citations, and set search_agent_used_real_grounding: true if the answer reflects actual retrieved facts.\\n\\nFinally, compute the overall_visibility_score (0-100) by averaging the MENTIONS across ALL THREE answers:\\n- Treat mentioned: false as a score of 0 for that model.\\n- Treat mentioned: true as a score of 100 for that model.\\n- Weight the Search Agent double.\\nFormula: (Groq_Mention_Score + OpenRouter_Mention_Score + (Search_Agent_Mention_Score * 2)) / 4.\\n\\nReturn ONLY JSON matching the schema.\"\n          }\n        ]\n      }\n    ],\n    \"generationConfig\": {\n      \"responseMimeType\": \"application/json\",\n      \"responseSchema\": {\n        \"type\": \"OBJECT\",\n        \"properties\": {\n          \"groq_genuinely_recognized\": { \"type\": \"BOOLEAN\" },\n          \"groq_mentioned\": { \"type\": \"BOOLEAN\" },\n          \"groq_position\": { \"type\": \"STRING\", \"enum\": [\"headline\", \"body\", \"footnote\", \"not_mentioned\"] },\n          \"groq_sentiment\": { \"type\": \"NUMBER\" },\n          \"groq_competitors\": { \"type\": \"ARRAY\", \"items\": { \"type\": \"STRING\" } },\n          \"groq_hallucinated_guess\": { \"type\": \"BOOLEAN\" },\n          \"openrouter_genuinely_recognized\": { \"type\": \"BOOLEAN\" },\n          \"openrouter_mentioned\": { \"type\": \"BOOLEAN\" },\n          \"openrouter_position\": { \"type\": \"STRING\", \"enum\": [\"headline\", \"body\", \"footnote\", \"not_mentioned\"] },\n          \"openrouter_sentiment\": { \"type\": \"NUMBER\" },\n          \"openrouter_competitors\": { \"type\": \"ARRAY\", \"items\": { \"type\": \"STRING\" } },\n          \"openrouter_hallucinated_guess\": { \"type\": \"BOOLEAN\" },\n          \"search_agent_genuinely_recognized\": { \"type\": \"BOOLEAN\" },\n          \"search_agent_mentioned\": { \"type\": \"BOOLEAN\" },\n          \"search_agent_position\": { \"type\": \"STRING\", \"enum\": [\"headline\", \"body\", \"footnote\", \"not_mentioned\"] },\n          \"search_agent_sentiment\": { \"type\": \"NUMBER\" },\n          \"search_agent_competitors\": { \"type\": \"ARRAY\", \"items\": { \"type\": \"STRING\" } },\n          \"search_agent_citations\": { \"type\": \"ARRAY\", \"items\": { \"type\": \"STRING\" } },\n          \"search_agent_used_real_grounding\": { \"type\": \"BOOLEAN\" },\n          \"search_agent_hallucinated_guess\": { \"type\": \"BOOLEAN\" },\n          \"overall_visibility_score\": { \"type\": \"NUMBER\" }\n        },\n        \"required\": [\n          \"groq_genuinely_recognized\",\n          \"groq_mentioned\",\n          \"openrouter_genuinely_recognized\",\n          \"openrouter_mentioned\",\n          \"search_agent_genuinely_recognized\",\n          \"search_agent_mentioned\",\n          \"overall_visibility_score\"\n        ]\n      }\n    }\n  }\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "00a35d35-6761-4b53-93f3-c0d5f623a3e8",
      "name": "Flatten Scoring JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        3360,
        160
      ],
      "parameters": {
        "jsCode": "const raw = $input.first().json.candidates[0].content.parts[0].text;\nconst s = JSON.parse(raw);\n\nreturn [{ \n  json: {\n    run_id: $('Set Brand Configuration').first().json.run_id,\n    \n    // Changed from 'Loop Over Prompts' to 'Limit' to match your workflow\n    prompt_id: $('Limit to 10 Prompts').first().json.id,\n    category: $('Limit to 10 Prompts').first().json.category,\n    prompt_text: $('Limit to 10 Prompts').first().json.prompt_text,\n    \n    // Groq\n    groq_genuinely_recognized: s.groq_genuinely_recognized,\n    groq_mentioned: s.groq_mentioned, \n    groq_position: s.groq_position,\n    groq_sentiment: s.groq_sentiment, \n    groq_competitors: (s.groq_competitors || []).join(', '),\n    groq_hallucinated_guess: s.groq_hallucinated_guess,\n    \n    // OpenRouter\n    openrouter_genuinely_recognized: s.openrouter_genuinely_recognized,\n    openrouter_mentioned: s.openrouter_mentioned, \n    openrouter_position: s.openrouter_position,\n    openrouter_sentiment: s.openrouter_sentiment, \n    openrouter_competitors: (s.openrouter_competitors || []).join(', '),\n    openrouter_hallucinated_guess: s.openrouter_hallucinated_guess,\n    \n    // Search Agent\n    search_agent_genuinely_recognized: s.search_agent_genuinely_recognized,\n    search_agent_mentioned: s.search_agent_mentioned, \n    search_agent_position: s.search_agent_position,\n    search_agent_sentiment: s.search_agent_sentiment,\n    search_agent_competitors: (s.search_agent_competitors || []).join(', '),\n    search_agent_citations: (s.search_agent_citations || []).join(', '),\n    search_agent_used_real_grounding: s.search_agent_used_real_grounding,\n    search_agent_hallucinated_guess: s.search_agent_hallucinated_guess,\n    \n    // Overall\n    overall_visibility_score: s.overall_visibility_score,\n    timestamp: new Date().toISOString()\n  } \n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "7aa5ef73-3356-4555-9b32-d593b03f0aaa",
      "name": "Append Results to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3584,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "run_id": "={{ $json.run_id }}-{{ $now.toMillis() }}-{{ Math.random().toString(36).substring(2, 10) }}-{{ Math.floor(Math.random() * 90000) + 10000 }}",
            "category": "={{ $json.category }}",
            "prompt_id": "={{ $json.prompt_id }}",
            "timestamp": "={{ $json.timestamp }}",
            "prompt_text": "={{ $json.prompt_text }}",
            "groq_position": "={{ $json.groq_position }}",
            "groq_mentioned": "={{ $json.groq_mentioned }}",
            "groq_sentiment": "={{ $json.groq_sentiment }}",
            "groq_competitors": "={{ $json.groq_competitors }}",
            "gemini_competitors": "={{ $json.gemini_competitors }}",
            "openrouter_position": "={{ $json.openrouter_position }}",
            "openrouter_mentioned": "={{ $json.openrouter_mentioned }}",
            "openrouter_sentiment": "={{ $json.openrouter_sentiment }}",
            "search_agent_position": "={{ $json.search_agent_position }}",
            "openrouter_competitors": "={{ $json.openrouter_competitors }}",
            "search_agent_citations": "={{ $json.search_agent_citations }}",
            "search_agent_mentioned": "={{ $json.search_agent_mentioned }}",
            "search_agent_sentiment": "={{ $json.search_agent_sentiment }}",
            "overall_visibility_score": "={{ $json.overall_visibility_score }}",
            "search_agent_competitors": "={{ $json.search_agent_competitors }}"
          },
          "schema": [
            {
              "id": "run_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "run_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "prompt_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "prompt_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "prompt_text",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "prompt_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "gemini_competitors",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "gemini_competitors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "groq_mentioned",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "groq_mentioned",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "groq_position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "groq_position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "groq_sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "groq_sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "groq_competitors",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "groq_competitors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "openrouter_mentioned",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "openrouter_mentioned",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "openrouter_position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "openrouter_position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "openrouter_sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "openrouter_sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "openrouter_competitors",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "openrouter_competitors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_agent_mentioned",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_agent_mentioned",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_agent_position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_agent_position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_agent_sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_agent_sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_agent_competitors",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_agent_competitors",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_agent_citations",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_agent_citations",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "overall_visibility_score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "overall_visibility_score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1717582554,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LR8TKqvn9Q2pCCYgey7owRYKcqAUZDkafCrwRuGDm7s/edit#gid=1717582554",
          "cachedResultName": "llm_tracking"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1LR8TKqvn9Q2pCCYgey7owRYKcqAUZDkafCrwRuGDm7s",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LR8TKqvn9Q2pCCYgey7owRYKcqAUZDkafCrwRuGDm7s/edit?usp=drivesdk",
          "cachedResultName": "llm_tracking"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "128b8173-36a0-4326-baac-1f149913b3e6",
      "name": "Summarize Visibility Stats",
      "type": "n8n-nodes-base.summarize",
      "position": [
        3808,
        160
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "overall_visibility_score",
              "aggregation": "average"
            },
            {
              "field": "gemini_sentiment",
              "aggregation": "average"
            },
            {
              "field": "groq_sentiment",
              "aggregation": "average"
            },
            {
              "field": "openrouter_sentiment",
              "aggregation": "average"
            },
            {
              "field": "search_agent_sentiment",
              "aggregation": "average"
            },
            {
              "field": "prompt_id"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "3ad2a1e2-98b7-4d01-8e59-a6cc6856e964",
      "name": "Post Digest to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        4256,
        160
      ],
      "parameters": {
        "text": "={{ $json.data.map(item => `*Average Overall Visibility Score:* ${item.average_overall_visibility_score}\nAverage Gemini Sentiment: ${item.average_gemini_sentiment ?? 'N/A'}\nAverage Groq Sentiment: ${item.average_groq_sentiment ?? 'N/A'}\nAverage Openrouter Sentiment: ${item.average_openrouter_sentiment ?? 'N/A'}\nAverage Search Agent Sentiment: ${item.average_search_agent_sentiment ?? 'N/A'}\nCount Prompt Id: ${item.count_prompt_id}`).join('\\n\\n---------------------------\\n\\n') }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C0B8VH1M5PX",
          "cachedResultName": "general"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f3c87bc3-fd3b-49cf-8da8-41eb9da7dfe0",
      "name": "Groq Llama Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        1952,
        400
      ],
      "parameters": {
        "model": "llama-3.3-70b-versatile",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "be5fb3d5-cc8b-4ead-ac06-0810b2e84730",
      "name": "Tavily Search Tool Beta",
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "position": [
        2544,
        384
      ],
      "parameters": {
        "query": "={{ $('Limit to 10 Prompts').item.json.prompt_text }}",
        "options": {
          "chunks_per_source": 3
        }
      },
      "credentials": {
        "tavilyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3e04b693-5272-4d14-895c-999698297059",
      "name": "Tavily Search Tool Gamma",
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "position": [
        2176,
        384
      ],
      "parameters": {
        "query": "={{ $json.prompt_text }}",
        "options": {
          "chunks_per_source": 3
        }
      },
      "credentials": {
        "tavilyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f5ffff01-031e-4822-b488-09a1e1c55407",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2352,
        384
      ],
      "parameters": {
        "model": "inclusionai/ling-3.0-flash:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "01479eb8-5e38-426c-8aac-84a5e227f0e2",
      "name": "Query Groq Llama Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2032,
        160
      ],
      "parameters": {
        "text": "={{ $json.prompt_text }}",
        "options": {
          "systemMessage": "You are a search-grounded answer engine, similar to Perplexity. Answer the user's question directly and concisely, using the search tool to ground your answer in current web sources. Always mention which brands/tools you are recommending and cite the domains your answer is based on."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "b18ff4a6-00a2-44f0-b936-731678a4a4b9",
      "name": "Limit to 10 Prompts",
      "type": "n8n-nodes-base.limit",
      "position": [
        1728,
        160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0b127555-d941-47df-81bd-0ad187a8c354",
      "name": "Query OpenRouter Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2384,
        160
      ],
      "parameters": {
        "text": "={{ $('Limit to 10 Prompts').item.json.prompt_text }}",
        "options": {
          "systemMessage": "You are a search-grounded answer engine, similar to Perplexity. Answer the user's question directly and concisely, using the search tool to ground your answer in current web sources. Always mention which brands/tools you are recommending and cite the domains your answer is based on.\n\n\nuse only max 2 searches.... and answer the question"
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "40bcce55-751b-4f8e-8283-95a022261763",
      "name": "Aggregate Digest Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        4032,
        160
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "30975257-d6c2-4e64-934b-7e5c93b0684b",
  "nodeGroups": [],
  "connections": {
    "Groq Llama Model": {
      "ai_languageModel": [
        [
          {
            "node": "Query Groq Llama Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Daily 7AM Trigger": {
      "main": [
        [
          {
            "node": "Set Brand Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Prompt Data": {
      "main": [
        [
          {
            "node": "Split Prompts List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Prompts List": {
      "main": [
        [
          {
            "node": "Limit to 10 Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit to 10 Prompts": {
      "main": [
        [
          {
            "node": "Query Groq Llama Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Digest Data": {
      "main": [
        [
          {
            "node": "Post Digest to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Query OpenRouter Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search Grounded Agent": {
      "main": [
        [
          {
            "node": "Analyze Scores with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Groq Llama Agent": {
      "main": [
        [
          {
            "node": "Query OpenRouter Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query OpenRouter Agent": {
      "main": [
        [
          {
            "node": "Search Grounded Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Brand Configuration": {
      "main": [
        [
          {
            "node": "Generate Prompts via Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tavily Search Tool Beta": {
      "ai_tool": [
        [
          {
            "node": "Query OpenRouter Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Append Results to Sheets": {
      "main": [
        [
          {
            "node": "Summarize Visibility Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tavily Search Tool Alpha": {
      "ai_tool": [
        [
          {
            "node": "Search Grounded Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Tavily Search Tool Gamma": {
      "ai_tool": [
        [
          {
            "node": "Query Groq Llama Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Search Agent Model": {
      "ai_languageModel": [
        [
          {
            "node": "Search Grounded Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Visibility Stats": {
      "main": [
        [
          {
            "node": "Aggregate Digest Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Prompts via Gemini": {
      "main": [
        [
          {
            "node": "Parse Prompt Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}