{
  "name": "Telegram SerpAPI Bot DEMO",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "47fcea5e-9266-4c6d-b7bf-7cb144971a8a",
      "name": "Telegram Trigger",
      "webhookId": "f3d170ee-fadb-471f-8ea6-78ffff9687f0",
      "credentials": {
        "telegramApi": {
          "id": "lTlHWPSnobDOgvl3",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "You are a lead researcher helpful assistant - use the SerpAPI tool to find out more information that would be helpful for me before a sales call."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        220,
        0
      ],
      "id": "8b661e9e-123c-42ac-9ca3-9e48649b881d",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        140,
        260
      ],
      "id": "0984d5d6-b664-4e32-b4de-a56f92be0773",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "MzIepidaRw9ZqcPB",
          "name": "OpenAi account Credentials"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        260,
        260
      ],
      "id": "5b4f3094-cbe7-4ae4-af3f-b7607da1fd98",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        580,
        0
      ],
      "id": "220543c2-9f96-4102-89f4-dbee14e9896d",
      "name": "Telegram",
      "webhookId": "8b81bcae-bb47-4ef3-803f-809dfb9bf3bb",
      "credentials": {
        "telegramApi": {
          "id": "lTlHWPSnobDOgvl3",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "typeVersion": 1,
      "position": [
        420,
        260
      ],
      "id": "b550ba78-c638-45af-aa06-d93a8c3c47d7",
      "name": "SerpAPI",
      "credentials": {
        "serpApi": {
          "id": "34xHCdUSlwWizCL8",
          "name": "SerpAPI account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9538aebd-4db5-46bc-843d-209f5adb1077",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "4aabc0aa2e160dafa4f9d9bcedde563b5af29598cd16960f637ae2fb99aea720"
  },
  "id": "G29mgO7izu5TmfYG",
  "tags": []
}