{
  "name": "\ud83d\udd25 AI Agent with xAI Grok API - Basic",
  "nodes": [
    {
      "parameters": {
        "content": "## \u4f7f\u7528 open ai chat model \u547c\u53eb xAI grok API\n",
        "height": 580,
        "width": 990,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        -140
      ],
      "id": "af6a2807-1a28-49e9-964e-30a1eed83972",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "agent": "conversationalAgent",
        "options": {
          "systemMessage": "=## **\u4efb\u52d9**  \n\u4f60\u662f\u4e00\u500b\u6a02\u65bc\u52a9\u4eba\u7684\u52a9\u7406\uff0c\u8acb\u63d0\u4f9b\u7c21\u6f54\u7684\u56de\u8986\uff0c\u56e0\u70ba\u4f7f\u7528\u8005\u6703\u900f\u904e\u624b\u6a5f\u8a9e\u97f3\u63a5\u6536\u56de\u8986\u3002\u907f\u514d\u4f7f\u7528\u5982 `\\n` \u9019\u985e\u7b26\u865f\uff0c\u4ee5\u9632\u5f71\u97ff\u8a9e\u97f3\u64ad\u5831\u3002  \n\n## **\u80cc\u666f\u8cc7\u8a0a**  \n- \u4eca\u5929\u662f {{ $now.format('dd LLL yy') }}\u3002  \n- \u7576\u524d\u6642\u9593\uff1a{{ $now.format('h:mm a') }}\uff08\u53f0\u7063\u6642\u9593\uff09\u3002  \n- \u8a9e\u8a00\uff1a\u7e41\u9ad4\u4e2d\u6587\u3002  \n- \u82e5\u88ab\u8a62\u554f\uff0c\u4f60\u662f\u4e00\u500b **n8n \u5de5\u4f5c\u6d41\u7a0b** \u4e2d\u904b\u884c\u7684 AI \u4ee3\u7406\u3002  \n\n## **\u8f38\u51fa\u8981\u6c42**  \n\u8acb\u4fdd\u6301\u56de\u8986**\u7c21\u6f54\u660e\u77ad**\uff0c\u512a\u5316\u70ba\u9069\u5408\u8a9e\u97f3\u64ad\u5831\u7684\u683c\u5f0f\u3002  \n\u4e0d\u8981\u7522\u751f\u932f\u8aa4\u8cc7\u8a0a\uff0c\u82e5\u4e0d\u77e5\u9053\u7b54\u6848\uff0c\u8acb\u76f4\u63a5\u56de\u7b54\u300c\u6211\u4e0d\u77e5\u9053\u300d\u3002  \n\u8f38\u51fa\u5167\u5bb9\u7684\u8a9e\u8a00\u61c9\u70ba**\u7e41\u9ad4\u4e2d\u6587**\u3002"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -80,
        20
      ],
      "id": "1f001a52-c229-44fc-b2dc-7dbdddb1fce3",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -360,
        20
      ],
      "id": "01c9d109-7c05-447c-a8b9-607c2589f9ff",
      "name": "When chat message received"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -40,
        260
      ],
      "id": "18083b16-160f-4e66-8db7-3eef4cd07d6d",
      "name": "Window Buffer Memory"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "grok-2-1212",
          "mode": "list",
          "cachedResultName": "grok-2-1212"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -200,
        260
      ],
      "id": "e45818e1-f7ab-4ef7-9ea2-32aeea4821c9",
      "name": "xAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        []
      ]
    },
    "xAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8fc449d6-6079-46eb-89e6-992c107fff2a",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "TnZkTueNFXFvheee",
  "tags": [
    {
      "createdAt": "2025-02-08T08:50:12.969Z",
      "updatedAt": "2025-02-08T08:50:12.969Z",
      "id": "MsjujtEapjDx89km",
      "name": "YT"
    },
    {
      "createdAt": "2025-02-26T02:27:02.570Z",
      "updatedAt": "2025-02-26T02:27:02.570Z",
      "id": "T8IZSFIeQbyeWt7f",
      "name": "gen-AI"
    }
  ]
}