{
  "name": "WhatsApp virtual agent with Gemini AI - handles text & voice with knowledge base",
  "nodes": [
    {
      "id": "ca19699e-15fd-4366-8aa0-2f26a8f0b2bb",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        720,
        496
      ]
    },
    {
      "id": "29da8178-4c2b-4da6-87e3-87bbeb51f4d4",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        656,
        736
      ]
    },
    {
      "id": "e48c4c7a-6285-497c-8a65-3d7b132cadee",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        784,
        736
      ]
    },
    {
      "id": "9b267a71-5eff-4a09-9b00-26c1924d60f2",
      "name": "Answer questions with a vector store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        912,
        736
      ]
    },
    {
      "id": "56ee6e8c-2087-4b0a-8182-d4e09ca1070f",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        816,
        944
      ]
    },
    {
      "id": "800013cf-a0fc-4fc9-9aab-e7fca168ce07",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1104,
        944
      ]
    },
    {
      "id": "5356b124-d55b-4a95-bebf-da34d258e4b5",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        896,
        1152
      ]
    },
    {
      "id": "60bbd3ad-9cc5-4314-accf-63443742566f",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -880,
        480
      ]
    },
    {
      "id": "62fbdacb-50a4-4ca2-87e1-ecb4277e13fc",
      "name": "Get Audio URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -464,
        304
      ]
    },
    {
      "id": "4e830f8a-a674-4dd7-ad32-39671f5f23cf",
      "name": "Audio Download",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -240,
        304
      ]
    },
    {
      "id": "f1d1d1ab-d058-4852-8f74-5ac60a8e49e0",
      "name": "Audio Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        304
      ]
    },
    {
      "id": "6de808f7-75a9-4bcf-9bb9-c5cacaa4c128",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1312,
        496
      ]
    },
    {
      "id": "87c6c269-cf17-4645-ac05-0c8872895d00",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        320
      ],
      "parameters": {
        "width": 256,
        "height": 384,
        "content": "\n💬 Workflow Overview\nThis workflow acts as an AI-powered WhatsApp agent that can handle both text and voice messages.\nWhen a customer sends a message, it automatically detects the type, processes it, "
      }
    },
    {
      "id": "17502cf4-64bc-4726-83ce-351af9b487b3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -48
      ],
      "parameters": {
        "width": 528,
        "height": 272,
        "content": "🎧 Voice Message Handling\nWhen a customer sends a voice note, the workflow:\n\nRetrieves the audio file from WhatsApp.\n\nConverts it to Base64 format.\n\nSends it to Google Gemini’s API for transcription.\n\n"
      }
    },
    {
      "id": "a018416b-d5fe-4509-b5c0-920282eef62d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        176
      ],
      "parameters": {
        "width": 368,
        "height": 224,
        "content": "🧠 AI Agent + Knowledge Base\nThe AI Agent is connected to Google Gemini and a Pinecone vector database that stores company product and service information.\nIt uses this data to answer questions accurat"
      }
    },
    {
      "id": "b47ef7d2-6885-42e5-a37c-b8e1c3d5ecb1",
      "name": "Audio/Message",
      "type": "n8n-nodes-base.switch",
      "position": [
        -688,
        480
      ]
    },
    {
      "id": "d2038571-24f9-42d7-9412-09c6ad12efa9",
      "name": "Audio Convert",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        304
      ]
    },
    {
      "id": "2d5a44f6-7fe5-4363-966f-f8bfb7ad9db4",
      "name": "Gemini speech to text",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        304
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio Prompt": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio Convert": {
      "main": [
        [
          {
            "node": "Gemini speech to text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio/Message": {
      "main": [
        [
          {
            "node": "Get Audio URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio URL": {
      "main": [
        [
          {
            "node": "Audio Download",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Audio Download": {
      "main": [
        [
          {
            "node": "Audio Convert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Audio/Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini speech to text": {
      "main": [
        [
          {
            "node": "Audio Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}