{
  "id": "fvS4yEM8Nq0Q8D67",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "CHATBOT",
  "tags": [],
  "nodes": [
    {
      "id": "7bdc55b4-b0d5-4f82-b2b0-4af9cde0fa0d",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "22fab90f-41fe-4fb3-b126-d01c5c06890c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        0
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "5a5098a2-7fa3-4cf1-ba59-4b47ede7cd78",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        120,
        220
      ],
      "parameters": {
        "model": "llama-3.1-8b-instant",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fdd9b74d-a468-49fe-a837-b4504ca5a5c1",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        300,
        220
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "bf17d6c2-a113-4ce5-92c4-34d3e9e5dc40",
      "name": "SerpAPI",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        500,
        220
      ],
      "parameters": {
        "options": {
          "google_domain": "google.com"
        }
      },
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1e0a591d-04e6-44d0-8b51-0fb6bc9ea1e4",
      "name": "StreamElements Text-to-Speech",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        0
      ],
      "parameters": {
        "url": "https://api.streamelements.com/kappa/v2/speech",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "voice",
              "value": "Matthew"
            },
            {
              "name": "text",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c38ee9aa-e448-492e-bace-430965e71ac0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -80
      ],
      "parameters": {
        "color": 5,
        "width": 1020,
        "height": 440,
        "content": "## PA CHATBOT USING GROQ"
      },
      "typeVersion": 1
    },
    {
      "id": "9b965ee9-9379-45fe-9775-5784707b9ec1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -380
      ],
      "parameters": {
        "width": 520,
        "height": 1140,
        "content": "# \ud83d\udcac Free Personal Assistant using Groq\n\n# \ud83c\udfa5 **Watch the Tutorial**  \n[![Watch on YouTube](https://img.youtube.com/vi/PIMjjB3tAhA/hqdefault.jpg)](https://youtu.be/PIMjjB3tAhA?si=27e2a2vAsoavWJj3)\n\nBuild your own **AI-powered chatbot** that listens, thinks, searches, and speaks \u2014 all inside **n8n**.  \nThis workflow connects **Groq AI**, **LangChain Agent**, and **SerpAPI** to enable real-time responses with **conversation memory** and **voice output** using **StreamElements Text-to-Speech (TTS)**.\n\n### \u2699\ufe0f How It Works  \n1. The chatbot receives a new message trigger.  \n2. Groq AI processes the query and uses SerpAPI for web results.  \n3. Memory node keeps track of conversation context.  \n4. StreamElements API converts the AI\u2019s response into a realistic voice reply.\n\n### \ud83d\udcbc Use Cases  \n- Voice-enabled AI assistants  \n- Interactive customer-support chatbots  \n- Smart chat widgets with real-time web awareness  \n\nSetup takes under 10 minutes \u2014 just connect your **Groq AI**, **SerpAPI**, and **StreamElements** accounts.\n\n\ud83d\udd17 **Created by:** Muhammad Shaheer  \n\ud83d\udca1 **YouTube Channel:** [https://www.youtube.com/@BOTNEXA](https://www.youtube.com/@ShaheerAutomation)  \n\ud83d\udce7 **For collaborations:** shaheerawan001@gmail.com  \n\ud83d\udd17 **LinkedIn:** www.linkedin.com/in/muhammad-shaheer-898513192\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a3d41eaf-c0a9-4b4b-96f7-42f19816a606",
  "connections": {
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "StreamElements Text-to-Speech",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}