{
  "name": "DeepSeek R1 AI Agent",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "id": "98eadf9c-a8f8-41f9-a6f4-cf2fc2e2ad3e",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        60,
        760
      ],
      "webhookId": "5b04dea3-1a5d-4ac5-9866-8d3af35e9e7f"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.deepseek.com/chat/completions",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer sk-a336f0db883d4ae990845b40b15fcc52"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"messages\": [\n    {\n      \"content\": \"You are a helpful assistant who is tasked with creating a step by step plan of action for a personal assistant\",\n      \"role\": \"system\"\n    },\n    {\n      \"content\": \"{{ $json.chatInput }}\",\n      \"role\": \"user\"\n    }\n  ],\n  \"model\": \"deepseek-chat\",\n  \"frequency_penalty\": 0,\n  \"max_tokens\": 2048,\n  \"presence_penalty\": 0,\n  \"response_format\": {\n    \"type\": \"text\"\n  },\n  \"stop\": null,\n  \"stream\": false,\n  \"stream_options\": null,\n  \"temperature\": 1,\n  \"top_p\": 1,\n  \"tools\": null,\n  \"tool_choice\": \"none\",\n  \"logprobs\": false,\n  \"top_logprobs\": null\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        360,
        1400
      ],
      "id": "fb417cb6-d1a7-4615-8fcb-a4f3c536d9bb",
      "name": "DeepSeek R1 Planner"
    },
    {
      "parameters": {
        "content": "## HTTP Request Alternative",
        "height": 540,
        "width": 1180,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        1220
      ],
      "typeVersion": 1,
      "id": "d819af4b-18e1-404e-a969-db76f86e27ac",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## DeepSeek R1 Appointment booking",
        "height": 560,
        "width": 1180
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        620
      ],
      "typeVersion": 1,
      "id": "e93f9686-e19c-4bcc-be35-9efc4b716afa",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "model": "deepseek-reasoner",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        240,
        980
      ],
      "id": "ba74aba6-558c-417f-ab5c-eda83443b5af",
      "name": "DeepSeek Chat Model",
      "credentials": {
        "deepSeekApi": {
          "id": "vucvZJKa1QLoZ5nn",
          "name": "DeepSeek account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        620,
        980
      ],
      "id": "2b0e5f51-f49c-4f40-834a-9d9cbd947f66",
      "name": "DeepSeek Chat Model1",
      "credentials": {
        "deepSeekApi": {
          "id": "vucvZJKa1QLoZ5nn",
          "name": "DeepSeek account"
        }
      }
    },
    {
      "parameters": {
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        380,
        980
      ],
      "id": "902860fb-047f-435b-bfe0-f38de0564ec1",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "sendTo": "={{ $fromAI('EmailAdress') }}",
        "subject": "={{ $fromAI('EmailSubject') }}",
        "emailType": "text",
        "message": "={{ $fromAI('Message') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmailTool",
      "typeVersion": 2.1,
      "position": [
        760,
        980
      ],
      "id": "234c9a5f-c272-4137-aa75-3d1750129ff9",
      "name": "Gmail",
      "webhookId": "324c1a9d-1e66-4536-b283-5dea2ae925e4",
      "credentials": {
        "gmailOAuth2": {
          "id": "lFEqkhcaTtYQk41l",
          "name": "Gmail account 2"
        }
      }
    },
    {
      "parameters": {
        "calendar": {
          "__rl": true,
          "value": "krystian7431@gmail.com",
          "mode": "list",
          "cachedResultName": "krystian7431@gmail.com"
        },
        "start": "={{ $fromAI('startDate') }}",
        "end": "={{ $fromAI('endDate') }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        900,
        980
      ],
      "id": "85f805b9-faf8-45f0-b130-079263fba79d",
      "name": "Google Calendar",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "E24Ck47tmpvRr0Yb",
          "name": "Google Calendar account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.choices[0].message.content }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        620,
        1400
      ],
      "id": "e897cb46-b3be-46c4-87ac-f950d6a28497",
      "name": "Tools Agent1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        540,
        1580
      ],
      "id": "5f7f082e-a01f-4c64-9c5c-114d4ae7b0fd",
      "name": "DeepSeek Chat Model2",
      "credentials": {
        "deepSeekApi": {
          "id": "vucvZJKa1QLoZ5nn",
          "name": "DeepSeek account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $fromAI('EmailAdress') }}",
        "subject": "={{ $fromAI('EmailSubject') }}",
        "emailType": "text",
        "message": "={{ $fromAI('Message') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmailTool",
      "typeVersion": 2.1,
      "position": [
        660,
        1580
      ],
      "id": "9fe5119b-b315-4854-851d-213b6a17a500",
      "name": "Gmail1",
      "webhookId": "324c1a9d-1e66-4536-b283-5dea2ae925e4",
      "credentials": {
        "gmailOAuth2": {
          "id": "lFEqkhcaTtYQk41l",
          "name": "Gmail account 2"
        }
      }
    },
    {
      "parameters": {
        "calendar": {
          "__rl": true,
          "value": "krystian7431@gmail.com",
          "mode": "list",
          "cachedResultName": "krystian7431@gmail.com"
        },
        "start": "={{ $fromAI('startDate') }}",
        "end": "={{ $fromAI('endDate') }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        780,
        1580
      ],
      "id": "2a81b81c-d36d-419f-b923-d41f5b38cde4",
      "name": "Google Calendar1",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "E24Ck47tmpvRr0Yb",
          "name": "Google Calendar account"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=** Mission **\nYou are an AI tasked with drafting clear, practical prompts that help a personal assistant complete any job at hand.\n\n** Operating Scope **\n\n- No external tools or references.\n- Keep every instruction brief, ordered, and unmistakable.\n- Jobs can be simple or complex, but your wording must remain straightforward.\n\n** Workflow **\n\n- Receive the user’s request.\n- Decompose the request into a short series of logical actions.\n- Write each action so it can be executed immediately—no guesswork.\n- Note prerequisites or context the assistant needs to know.\n- Proof-read the prompt for clarity and fullness before sending it.\n\n\n** Illustrative Scenarios **\n\nExample 1:\n\n--------User Request\n“Book a doctor’s appointment for next week.”\n\n--------Prompt You Produce\n1. Find open slots with the doctor next week. 2. Pick a time that doesn’t clash with existing events. 3. Book the slot by phone or online. 4. Confirm and add the appointment to the calendar.\n\nExample 2:\n\n--------User Request\n“Get ready for John’s birthday party.”\t\n\n--------Prompt You Produce\n1. Select a date and time for the party. 2. Draft a guest list. 3. Buy and set up decorations beforehand. 4. Arrange food and drinks. 5. Send invitations and track RSVPs.\n\n\n** Operating Checklist (SOP) **\n\n- Hear the goal.\n- Break it into clear, ordered, actionable steps.\n- Supply any needed background details.\n- Double-check that the plan is complete and plain.\n- Deliver the polished prompt to the assistant.\n\n\n** Closing Reminders **\n- Favor simplicity over flourish.\n- Omit anything irrelevant or overly wordy.\n- Hand over a ready-to-execute plan that needs no further clarification.\n- Current date/time: {{ $now }}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        280,
        760
      ],
      "id": "4258ddec-7547-4e69-a081-54cfc89df699",
      "name": "Planner AI Agent"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.output }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        640,
        760
      ],
      "id": "bfc4b9e9-87f9-4e83-9593-1c9c9160cd8f",
      "name": "Executive AI Agent"
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Planner AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek R1 Planner": {
      "main": [
        [
          {
            "node": "Tools Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Planner AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Executive AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Planner AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "ai_tool": [
        [
          {
            "node": "Executive AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Executive AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Tools Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "ai_tool": [
        [
          {
            "node": "Tools Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar1": {
      "ai_tool": [
        [
          {
            "node": "Tools Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Planner AI Agent": {
      "main": [
        [
          {
            "node": "Executive AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Executive AI Agent": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b1469211-731d-4d11-b40e-734559de14fb",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f96a7e8659163312cbaf16ad76688747ea79fa6bf8e4ec720c14444abdf2c12c"
  },
  "id": "LL9iHAkANKobgXKo",
  "tags": []
}