{
  "name": "Discord AI ChatBot : Context-Aware, Replies to Mentions AND also DMs",
  "nodes": [
    {
      "id": "b69efca3-f0b1-4b8d-8812-9bbc60d2c9c7",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        520,
        500
      ]
    },
    {
      "id": "c2461069-028e-4a6f-9670-c75e84f30d26",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        280,
        860
      ]
    },
    {
      "id": "87dfab19-9acc-48af-b786-1c20106f8e23",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        480,
        880
      ]
    },
    {
      "id": "74407b9a-d9ae-434e-9eee-17b68b487c2e",
      "name": "Mapping data for the Agent",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        500
      ]
    },
    {
      "id": "a2a7e4e9-084c-4bdf-80e0-5f909a53fe2d",
      "name": "Either the bot should reply in dm or in public channel",
      "type": "n8n-nodes-base.if",
      "position": [
        900,
        500
      ]
    },
    {
      "id": "d84d2f02-93b8-4459-82de-bff394ee7455",
      "name": "Reply in DM",
      "type": "n8n-nodes-base.discord",
      "position": [
        1240,
        360
      ]
    },
    {
      "id": "ff8b9e70-35d1-44de-aba0-e624b468b95f",
      "name": "Reply in public channel",
      "type": "n8n-nodes-base.discord",
      "position": [
        1240,
        640
      ]
    },
    {
      "id": "1abd9619-bd4c-493c-a90f-7db16b3cc72d",
      "name": "DM Received",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        260
      ]
    },
    {
      "id": "40fdef9c-e568-4e75-a93e-e20cc9601835",
      "name": "Public Mention",
      "type": "n8n-nodes-discord-trigger.discordTrigger",
      "position": [
        -80,
        720
      ]
    },
    {
      "id": "e1d15d1b-99cd-4b1d-8006-47af3b355143",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        140
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b3b58996-44f5-466e-aeaf-9a163e376e38",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "583e5a8d-d7f5-4bc6-8d3c-8b47c3d96799",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        500
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3f320db7-1109-4089-8bc9-3c26efe8cd46",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        40
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7bb34978-a5db-4d2d-9853-f8dbbe584c8a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        760
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "777c1988-3d18-454f-8310-3d647d0ff6ff",
      "name": "Read last public messages",
      "type": "n8n-nodes-base.discordTool",
      "position": [
        840,
        900
      ]
    },
    {
      "id": "10859678-99e8-4ac8-aa05-aeddb25bc816",
      "name": "Read last private messages",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        1020,
        900
      ]
    },
    {
      "id": "5d4bb3fb-b1be-4fcd-a5f3-fbe7cc4aa38f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        740
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b09f12af-1a4f-45ba-9073-d38dc5e93ad1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        200
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Either the bot should reply in dm or in public channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DM Received": {
      "main": [
        [
          {
            "node": "Mapping data for the Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Public Mention": {
      "main": [
        [
          {
            "node": "Mapping data for the Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Read last public messages": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Mapping data for the Agent": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read last private messages": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Either the bot should reply in dm or in public channel": {
      "main": [
        [
          {
            "node": "Reply in DM",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply in public channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}