{
  "name": "Personal Telegram Bro",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -1152,
        192
      ],
      "id": "37f66925-51b5-441d-8645-da8fca252059",
      "name": "Telegram Trigger",
      "webhookId": "10263fd9-ee0f-4f04-b39c-8a3c5134a255",
      "credentials": {
        "telegramApi": {
          "id": "sTierXVZsJJk9VVM",
          "name": "content_farmer"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.caption }}",
        "options": {
          "systemMessage": "You are an AI assistant who talks to the user like a very close friend. Your tone must always be casual, relaxed, playful, and natural — like two best friends chatting and joking around.\n\nSpeak in Uzbek (Uzbek Latin or Cyrillic, whichever feels natural), and keep the vibe friendly, warm, humorous, and human-like. Use everyday expressions, light slang, and short natural sentences.\n\nAdd humor naturally:\n- Make light jokes\n- Use funny reactions\n- Be playful and a bit cheeky (but never rude or offensive)\n- Occasionally tease the user in a friendly way\n\nUse emojis moderately to make the conversation lively (e.g. 😂😄😅🔥). Do not overuse them — keep it natural like real chat.\n\nYou can:\n- React casually (\"haaa\", \"voy\", \"bo'ldi endi 😂\", \"gap yo'q 😎\")\n- Laugh (\"😂\", \"🤣\")\n- Make the conversation feel alive and fun\n- Ask casual follow-up questions\n\nYou must NOT:\n- Use formal or professional language\n- Sound like a teacher or assistant\n- Over-explain unless asked\n- Be offensive, aggressive, or inappropriate\n\nYour goal is to make the user feel like they are chatting with a funny, close best friend — natural, fun, and engaging."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        80,
        112
      ],
      "id": "4f754f01-cc6d-4680-859c-3e3c75b0292d",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.chat_id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        192,
        336
      ],
      "id": "a38dbfc2-7782-4090-be8d-509329f600de",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "chatId": "={{ $('Merge').item.json.chat_id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        416,
        112
      ],
      "id": "e6b386cb-0d2d-4f8d-945f-87108b3765c0",
      "name": "Send a text message",
      "webhookId": "f1d6d158-a109-4226-b27d-bc275face0e3",
      "credentials": {
        "telegramApi": {
          "id": "sTierXVZsJJk9VVM",
          "name": "content_farmer"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 3
          },
          "conditions": [
            {
              "id": "1809534a-dcc8-406b-be32-0cfacefae634",
              "leftValue": "={{ $json.message.voice }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -928,
        192
      ],
      "id": "0e71c098-0f34-4802-888c-084e2c5b06d3",
      "name": "If"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.voice.file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -704,
        16
      ],
      "id": "477e2118-2397-4960-9005-71ec6fd0f0d3",
      "name": "Get a file",
      "webhookId": "cb78c780-5acf-487b-a1f5-e404720792e4",
      "credentials": {
        "telegramApi": {
          "id": "sTierXVZsJJk9VVM",
          "name": "content_farmer"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "inputType": "binary",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.1,
      "position": [
        -528,
        16
      ],
      "id": "0fd2f0f1-f1e6-4872-a02a-4c23b961d5c9",
      "name": "Transcribe a recording",
      "credentials": {
        "googlePalmApi": {
          "id": "W62G3nKfXutVZbcQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8090e2ef-e73c-44be-a228-6704ddd5231f",
              "name": "caption",
              "value": "={{ $json.content.parts[0].text }}",
              "type": "string"
            },
            {
              "id": "d539d472-61fe-4191-b95f-37a5d6a15ac4",
              "name": "chat_id",
              "value": "={{ $('Telegram Trigger').item.json.message.from.id }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -368,
        16
      ],
      "id": "e04d7a65-d1be-46c3-bcdf-25d119f80365",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8090e2ef-e73c-44be-a228-6704ddd5231f",
              "name": "caption",
              "value": "={{ $json.message.text }}",
              "type": "string"
            },
            {
              "id": "d539d472-61fe-4191-b95f-37a5d6a15ac4",
              "name": "chat_id",
              "value": "={{ $json.message.chat.id }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -368,
        208
      ],
      "id": "8626a8d0-9e33-49d9-b0f3-1705ad850072",
      "name": "Edit Fields1"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        -112,
        112
      ],
      "id": "6b5164d2-1ebc-4547-9620-50748a1ee162",
      "name": "Merge"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        32,
        336
      ],
      "id": "b3470328-0d35-4b34-8e53-ff90e9c0e96d",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "W62G3nKfXutVZbcQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    }
  ],
  "pinData": {
    "Transcribe a recording": [
      {
        "json": {
          "content": {
            "parts": [
              {
                "text": "Wassup?"
              }
            ],
            "role": "model"
          },
          "finishReason": "STOP",
          "index": 0
        },
        "pairedItem": {
          "item": 0
        }
      }
    ]
  },
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "a2c2c1d7-e0f3-4a64-b769-26f4942d7459",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ef42a54863efe73ab3b593911f2514379898a114eb6ef2cde6f9c72178ea2b74"
  },
  "id": "BkFEnTFhBpg7uu6e",
  "tags": []
}