{
    "nodes": [
        {
            "parameters": {
                "options": []
            },
            "id": "54c59cae-fbd0-4f0d-b633-6304e6c66d89",
            "name": "When chat message received",
            "type": "@n8n\/n8n-nodes-langchain.chatTrigger",
            "position": [
                600,
                400
            ],
            "webhookId": "b740bd14-1b9e-4b1b-abd2-1ecf1184d53a",
            "typeVersion": 1.1
        },
        {
            "parameters": {
                "agent": "conversationalAgent",
                "options": {
                    "systemMessage": "You are a helpful assistant."
                }
            },
            "id": "ef85680e-569f-4e74-a1b4-aae9923a0dcb",
            "name": "AI Agent",
            "type": "@n8n\/n8n-nodes-langchain.agent",
            "position": [
                1120,
                1180
            ],
            "retryOnFail": true,
            "typeVersion": 1.7,
            "alwaysOutputData": true,
            "onError": "continueErrorOutput"
        },
        {
            "parameters": {
                "model": "=deepseek-reasoner",
                "options": []
            },
            "id": "07a8c74c-768e-4b38-854f-251f2fe5b7bf",
            "name": "DeepSeek",
            "type": "@n8n\/n8n-nodes-langchain.lmChatOpenAi",
            "position": [
                1080,
                1360
            ],
            "typeVersion": 1.1,
            "credentials": []
        },
        {
            "parameters": [],
            "id": "a6d58a8c-2d16-4c91-adde-acac98868150",
            "name": "Window Buffer Memory",
            "type": "@n8n\/n8n-nodes-langchain.memoryBufferWindow",
            "position": [
                1220,
                1360
            ],
            "typeVersion": 1.3
        },
        {
            "parameters": {
                "messages": {
                    "messageValues": [
                        {
                            "message": "You are a helpful assistant."
                        }
                    ]
                }
            },
            "id": "401a5932-9f3e-4b17-a531-3a19a6a7788a",
            "name": "Basic LLM Chain2",
            "type": "@n8n\/n8n-nodes-langchain.chainLlm",
            "position": [
                1120,
                340
            ],
            "typeVersion": 1.5
        },
        {
            "parameters": {
                "content": "## DeepSeek using HTTP Request\n### DeepSeek Reasoner R1\nhttps:\/\/api-docs.deepseek.com\/\nRaw Body",
                "height": 340,
                "width": 420,
                "color": 5
            },
            "id": "215dda87-faf7-4206-bbc3-b6a6b1eb98de",
            "name": "Sticky Note",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1000,
                680
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "content": "## DeepSeek with Ollama Local Model",
                "height": 400,
                "width": 580,
                "color": 4
            },
            "id": "6457c0f7-ad02-4ad3-a4a0-9a7a6e8f0f7f",
            "name": "Sticky Note1",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1000,
                240
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "model": "deepseek-r1:14b",
                "options": {
                    "temperature": 0.6,
                    "numCtx": 16384,
                    "format": "default"
                }
            },
            "id": "2ac8b41f-b27d-4074-abcc-430a8f5928e8",
            "name": "Ollama DeepSeek",
            "type": "@n8n\/n8n-nodes-langchain.lmChatOllama",
            "position": [
                1120,
                500
            ],
            "typeVersion": 1,
            "credentials": []
        },
        {
            "parameters": {
                "content": "## DeepSeek Conversational Agent w\/Memory\n",
                "height": 460,
                "width": 600,
                "color": 3
            },
            "id": "37a94fc0-eff3-4226-8633-fb170e5dcff2",
            "name": "Sticky Note2",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1000,
                1060
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "content": "## DeepSeek using HTTP Request\n### DeepSeek Chat V3\nhttps:\/\/api-docs.deepseek.com\/\nJSON Body",
                "height": 340,
                "width": 420,
                "color": 6
            },
            "id": "52b484bb-1693-4188-ba55-643c40f10dfc",
            "name": "Sticky Note3",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1460,
                680
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "method": "POST",
                "url": "https:\/\/api.deepseek.com\/chat\/completions",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "sendBody": true,
                "specifyBody": "json",
                "jsonBody": "={\n  \"model\": \"deepseek-chat\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"{{ $json.chatInput }}\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello!\"\n    }\n  ],\n  \"stream\": false\n}",
                "options": []
            },
            "id": "ec46acef-60f6-4d34-b636-3654125f5897",
            "name": "DeepSeek JSON Body",
            "type": "n8n-nodes-base.httpRequest",
            "position": [
                1600,
                820
            ],
            "typeVersion": 4.2,
            "credentials": []
        },
        {
            "parameters": {
                "method": "POST",
                "url": "https:\/\/api.deepseek.com\/chat\/completions",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "sendBody": true,
                "contentType": "raw",
                "rawContentType": "application\/json",
                "body": "={\n        \"model\": \"deepseek-reasoner\",\n        \"messages\": [\n          {\"role\": \"user\", \"content\": \"{{ $json.chatInput.trim() }}\"}\n        ],\n        \"stream\": false\n      }",
                "options": []
            },
            "id": "e5295120-57f9-4e02-8b73-f00e4d6baa48",
            "name": "DeepSeek Raw Body",
            "type": "n8n-nodes-base.httpRequest",
            "position": [
                1140,
                820
            ],
            "typeVersion": 4.2,
            "credentials": []
        },
        {
            "parameters": {
                "content": "# Your First DeepSeek API Call\n\nThe DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.\n\nhttps:\/\/api-docs.deepseek.com\/\n\n## Configuration Parameters\n\n| Parameter | Value |\n|-----------|--------|\n| base_url | https:\/\/api.deepseek.com |\n| api_key | https:\/\/platform.deepseek.com\/api_keys |\n\n\n\n## Important Notes\n\n- To be compatible with OpenAI, you can also use `https:\/\/api.deepseek.com\/v1` as the base_url. Note that the v1 here has NO relationship with the model's version.\n\n- The deepseek-chat model has been upgraded to DeepSeek-V3. The API remains unchanged. You can invoke DeepSeek-V3 by specifying `model='deepseek-chat'`.\n\n- deepseek-reasoner is the latest reasoning model, DeepSeek-R1, released by DeepSeek. You can invoke DeepSeek-R1 by specifying `model='deepseek-reasoner'`.",
                "height": 840,
                "width": 580,
                "color": 7
            },
            "id": "571dc713-ce54-4330-8bdd-94e057ecd223",
            "name": "Sticky Note4",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                380,
                680
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "content": "## Four Examples for Connecting to DeepSeek\nhttps:\/\/api-docs.deepseek.com\/\nhttps:\/\/platform.deepseek.com\/api_keys",
                "height": 400,
                "width": 580,
                "color": 2
            },
            "id": "f0ac3f32-218e-4488-b67f-7b7f7e8be130",
            "name": "Sticky Note5",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                380,
                240
            ],
            "typeVersion": 1
        },
        {
            "parameters": {
                "content": "### Ollama Local\nhttps:\/\/ollama.com\/\nhttps:\/\/ollama.com\/library\/deepseek-r1",
                "height": 120,
                "width": 300,
                "color": 7
            },
            "id": "91642d68-ab5d-4f61-abaf-8cb7cb991c29",
            "name": "Sticky Note6",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1260,
                500
            ],
            "typeVersion": 1
        }
    ],
    "connections": {
        "When chat message received": {
            "main": [
                [
                    {
                        "node": "Basic LLM Chain2",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "AI Agent": {
            "main": [
                []
            ]
        },
        "DeepSeek": {
            "ai_languageModel": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        },
        "Window Buffer Memory": {
            "ai_memory": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_memory",
                        "index": 0
                    }
                ]
            ]
        },
        "Ollama DeepSeek": {
            "ai_languageModel": [
                [
                    {
                        "node": "Basic LLM Chain2",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "pinData": {
        "When chat message received": [
            {
                "action": "sendMessage",
                "chatInput": "provide 10 sentences that end in the word apple.",
                "sessionId": "68cb82d504c14f5eb80bdf2478bd39bb"
            }
        ]
    },
    "meta": {
        "instanceId": "a236cbf78baec350b7b1b9bc3bf24c3bf25ae01ddba61bc868db3cfe8ff22bed"
    }
}