{
  "name": "BCA - Marketing Article writter",
  "nodes": [
    {
      "parameters": {
        "resource": "rag",
        "operation": "image",
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-agent-brains.agentBrainsTool",
      "typeVersion": 1,
      "position": [
        176,
        2016
      ],
      "id": "71853628-3901-4e8c-9143-66cb9d031018",
      "name": "Image Retrieval",
      "credentials": {
        "agentBrainsIntegrationApi": {
          "id": "OXX19UWa1c40zWVn",
          "name": "Demo Key"
        }
      }
    },
    {
      "parameters": {
        "resource": "rag",
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "options": {
          "topK": 15
        }
      },
      "type": "n8n-nodes-agent-brains.agentBrainsTool",
      "typeVersion": 1,
      "position": [
        352,
        2016
      ],
      "id": "18b8629b-cfb6-48f5-bb4d-e5f242fd28f6",
      "name": "Knowledge Retrieval",
      "credentials": {
        "agentBrainsIntegrationApi": {
          "id": "OXX19UWa1c40zWVn",
          "name": "Demo Key"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('AgentBrains Trigger').item.json.data.message }}",
        "options": {
          "systemMessage": "={{ $('AgentBrains Trigger').item.json.data.custom.role }}\n\n---\n\n## Tools\n\nYou have access to two tools. Use them on **every single query** — no exceptions.\n\n### 1. Knowledge Retrieval\n\n- **What it does:** Pulls detailed information from BCA's internal knowledge base — product specs, features, pricing, comparisons, use cases, brand messaging, and competitive positioning.\n- **When to use it:** ALWAYS. Before you write a single word, you MUST call Knowledge Retrieval to get the latest, most accurate information on the product the user is asking about. Never rely on assumptions or general knowledge alone. Every claim, spec, and feature you mention in an article must be grounded in what this tool returns.\n- **How to use it:** Query the product name (and any related product lines or accessories) to pull all relevant specs, selling points, and positioning info. If the user mentions a competitor or comparison angle, also retrieve BCA's competitive positioning data.\n\n### 2. Image Retrieval\n\n- **What it does:** Searches BCA's labeled image database and returns relevant product photos, lifestyle shots, field images, and graphics.\n- **When to use it:** ALWAYS. Every article needs visuals. After you understand the product and article angle, call Image Retrieval to find images that support the story you're telling. Pull a mix of:\n  - **Product shots** — clean images of the product itself\n  - **Lifestyle / field shots** — hunters using the product in real scenarios (hog hunting, coyote calling, night hunts, etc.)\n  - **Feature close-ups** — images that highlight specific features you're writing about (displays, mounting, app connectivity, etc.)\n- **Image placement:** Integrate images naturally throughout the article. Place them at logical breakpoints — after the intro, alongside key feature sections, and near the conclusion. Every image should have a brief, descriptive caption.\n\n---\n\n{{ $('AgentBrains Trigger').item.json.data.custom.instruction }}\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -336,
        1760
      ],
      "id": "03261a91-15e6-4342-8830-8736b111ad29",
      "name": "Article Writer"
    },
    {
      "parameters": {
        "content": "## Agent Brains Trigger Node\n\nAdd this node to create a new Agent Brains employee with the same name as the workflow.\n\nThis node is executed every time a user sends a message to the bot or a conversion completes.\n\nWhen executed, the output contains:\n* employeeName - Name of Agent Brains Employee\n* custom - Custom Configuration of Agent Brains Employee\n* tenant_id - Your ID in Agent Brains\n* event_type - Type of notification. Possible two values: *message* - incoming new user message, *close* - ending conversation\n* message - user's message, exists only for *message* event type\n* conversation_id - id of conversation, suitable attribute for memory's key\n* history - all user's and bot's messages in chronological order\n",
        "height": 592,
        "width": 464,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -912,
        1344
      ],
      "id": "3dfb838c-bc69-4633-9ae8-f9afbd99119f",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Last Node\nThe last node must return JSON with a `message` attribute. You can use the Edit Fields node and add a `message` field containing the bot's response.",
        "height": 304,
        "width": 416,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        96,
        1344
      ],
      "id": "e7d3305a-921c-4262-b581-4946e4a254c9",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('AgentBrains Trigger').item.json.data.conversation_id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -240,
        2000
      ],
      "id": "e24f8dbb-b10a-4d45-b6ac-cc2c8b21c114",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "content": "## AI Agent\n\nUse user's *message* from AgentBrains Trigger as AI Agent User Message\n\nAdd a system message. Use the attributes from the Custom Configuration AgentBrains Employee to quickly configure the chatbot.\n\nUse *conversation_id* from AgentBrains Trigger in the AI Agent Memory key.",
        "height": 560,
        "width": 368,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -400,
        1376
      ],
      "id": "717768dc-5db7-45b9-aee3-a8c325fa4e72",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## AI Agent Tools \nUse AgentBrains RAG tools to access vectorized data. This will make your answers more accurate.\n\nUsing these tools, you can search both \n- text data. To do this, select **Retrieve Text** and the index in which you want to search.\n\n- images. To do this, select **Retrieve Image**. Adding images to the response makes it more informative. However, to ensure images display correctly in the response, you must specify the embedded image format in Markdown format `![Image Description](<url-of-image>)` in the system prompt.",
        "height": 432,
        "width": 672
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        64,
        1712
      ],
      "id": "69772a94-0983-4851-a6c6-a246cc33ad3c",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "responseMode": "lastNode",
        "options": {}
      },
      "type": "n8n-nodes-agent-brains.integrationTrigger",
      "typeVersion": 1,
      "position": [
        -736,
        1760
      ],
      "id": "9bbf827c-e7d8-4e43-8b51-81bc452c1e48",
      "name": "AgentBrains Trigger",
      "webhookId": "758f6863-63ce-44f2-8a7b-e388649d0cfe",
      "credentials": {
        "agentBrainsIntegrationApi": {
          "id": "OXX19UWa1c40zWVn",
          "name": "Demo Key"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -400,
        2000
      ],
      "id": "8916001c-2ae7-42e1-aa39-9bf6a79f43dc",
      "name": "Google Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "xcWLC3esEOzPhBn0",
          "name": "Google Gemini DEMO"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0fc672a6-2d66-4b58-9c13-0da07ee85c2f",
              "name": "message",
              "value": "={{ $json.output }}",
              "type": "string"
            }
          ]
        },
        "options": {
          "dotNotation": false
        }
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        1488
      ],
      "id": "3571ce92-7450-4733-925e-0051455f138c",
      "name": "response"
    }
  ],
  "pinData": {},
  "connections": {
    "Image Retrieval": {
      "ai_tool": [
        [
          {
            "node": "Article Writer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Knowledge Retrieval": {
      "ai_tool": [
        [
          {
            "node": "Article Writer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Article Writer": {
      "main": [
        [
          {
            "node": "response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Article Writer",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AgentBrains Trigger": {
      "main": [
        [
          {
            "node": "Article Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Article Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "d4bf9c37-583a-43e0-ba42-055e125b4f86",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "3cd2afbf7c8d48879c5fac1fab7c9add61152ad0c0997bde291f08e69f0889e5"
  },
  "id": "8vj0zwbS8DrQCFZhCqcIO",
  "tags": []
}