{
  "id": "QNRmujxuRedJ4sCy",
  "name": "Universal ai assistant",
  "tags": [],
  "nodes": [
    {
      "id": "a3a31971-a601-4a0a-a306-d5e63a7e33f5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        920,
        -40
      ],
      "parameters": {
        "text": "You are a helpful AI assistant designed to provide accurate, concise, and friendly responses to user queries. Your goal is to understand the user's needs and provide relevant information, guidance, or solutions. Always maintain a professional yet approachable tone. If you're unsure about something, acknowledge it honestly and suggest alternative approaches when possible.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "921ac636-0297-4b7a-aeb1-6c68e9af6885",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        948,
        180
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "afcdf33e-bce6-4b80-bfee-f6707e307a03",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        700,
        -40
      ],
      "parameters": {
        "path": "45cec96e-962d-4e27-ab75-34d25b837032",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "317a9c30-7651-47e1-b6aa-64ce4162aa16",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1296,
        -40
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "5f0d884e-3a75-49f9-babb-22fff9fb8a87",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1068,
        180
      ],
      "parameters": {
        "sessionKey": "={{ $json.body.sessionId }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a5ff29b4-5a46-4716-bd3b-a29c40923e63",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -140
      ],
      "parameters": {
        "width": 280,
        "height": 440,
        "content": "## Webhook Entry Point\n\n**Receives requests from:**\n- Website chat widgets\n- Mobile apps\n- Third-party platforms\n- Custom integrations\n\n**Expected payload:**\n```json\n{\n  \"message\": \"user question\",\n  \"sessionId\": \"unique-session-id\"\n}\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "6799e102-74fe-49a3-8696-178143b5c7f7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        280
      ],
      "parameters": {
        "width": 220,
        "height": 260,
        "content": "## AI Processing Core\n\n**Powered by Google Gemini 2.0 Flash**\n- Fast response times\n- Context-aware conversations\n- Natural language understanding\n- Maintains conversation history per session"
      },
      "typeVersion": 1
    },
    {
      "id": "e299b1f8-c6e7-4816-878d-60d3ff8edf14",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        280
      ],
      "parameters": {
        "color": 5,
        "width": 180,
        "height": 340,
        "content": "## Session Memory\n\n**Conversation Context:**\n- Remembers previous messages\n- Maintains context per sessionId\n- Enables natural follow-up questions\n- Auto-manages conversation history"
      },
      "typeVersion": 1
    },
    {
      "id": "b926b0ea-11d6-4773-83bd-ce12c7be40c1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -140
      ],
      "parameters": {
        "width": 160,
        "height": 100,
        "content": "## Response Output\n\n**Returns structured response:**\n- AI-generated answer\n- Consistent formatting\n- Ready for frontend display\n- JSON format compatible"
      },
      "typeVersion": 1
    },
    {
      "id": "456572e3-0abf-408d-a5ab-36cb0e2d5911",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 320,
        "content": "## \ud83d\ude80 AI Assistant Workflow\n\n**This workflow creates a conversational AI assistant that can be integrated anywhere:**\n\n\u2705 Website chat widgets\n\u2705 Mobile applications  \n\u2705 WhatsApp/Telegram bots\n\u2705 Custom dashboards\n\u2705 Third-party platforms\n\n**Simply send POST requests to the webhook URL with your message and sessionId!**"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3453d230-0017-4f82-8942-346e34867c63",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}