{ "id": "Telr6HU0ltH7s9f7", "meta": { "instanceId": "31e69f7f4a77bf465b805824e303232f0227212ae922d12133a0f96ffeab4fef" }, "name": "πŸ—¨οΈOllama Chat", "tags": [], "nodes": [ { "id": "9560e89b-ea08-49dc-924e-ec8b83477340", "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [ 280, 60 ], "webhookId": "4d06a912-2920-489c-a33c-0e3ea0b66745", "parameters": { "options": {} }, "typeVersion": 1.1 }, { "id": "c7919677-233f-4c48-ba01-ae923aef511e", "name": "Basic LLM Chain", "type": "@n8n/n8n-nodes-langchain.chainLlm", "onError": "continueErrorOutput", "position": [ 640, 60 ], "parameters": { "text": "=Provide the users prompt and response as a JSON object with two fields:\n- Prompt\n- Response\n\nAvoid any preample or further explanation.\n\nThis is the question: {{ $json.chatInput }}", "promptType": "define" }, "typeVersion": 1.5 }, { "id": "b9676a8b-f790-4661-b8b9-3056c969bdf5", "name": "Ollama Model", "type": "@n8n/n8n-nodes-langchain.lmOllama", "position": [ 740, 340 ], "parameters": { "model": "llama3.2:latest", "options": {} }, "credentials": { "ollamaApi": { "id": "IsSBWGtcJbjRiKqD", "name": "Ollama account" } }, "typeVersion": 1 }, { "id": "61dfcda5-083c-43ff-8451-b2417f1e4be4", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -380, -380 ], "parameters": { "color": 4, "width": 520, "height": 860, "content": "# πŸ¦™ Ollama μ±„νŒ… μ›Œν¬ν”Œλ‘œμš°\n\nκ°„λ‹¨ν•œ N8N μ›Œν¬ν”Œλ‘œμš°λ‘œ, Ollama LLM을 μ±„νŒ… λ©”μ‹œμ§€ μ²˜λ¦¬μ— ν†΅ν•©ν•˜μ—¬ κ΅¬μ‘°ν™”λœ JSON 객체λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.\n\n## κ°œμš”\n이 μ›Œν¬ν”Œλ‘œμš°λŠ” Ollamaλ₯Ό 톡해 Llama 3.2 λͺ¨λΈμ„ μ‚¬μš©ν•˜μ—¬ λ©”μ‹œμ§€λ₯Ό μ²˜λ¦¬ν•˜λŠ” μ±„νŒ… μΈν„°νŽ˜μ΄μŠ€λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€. μ±„νŒ… λ©”μ‹œμ§€κ°€ μˆ˜μ‹ λ˜λ©΄ κΈ°λ³Έ LLM 체인을 톡해 처리되고 응닡이 λ°˜ν™˜λ©λ‹ˆλ‹€.\n\n## ꡬ성 μš”μ†Œ\n- **트리거 λ…Έλ“œ**\n- **처리 λ…Έλ“œ**\n- **λͺ¨λΈ λ…Έλ“œ**\n- **JSON to Object λ…Έλ“œ**\n- **κ΅¬μ‘°ν™”λœ 응닡 λ…Έλ“œ**\n- **였λ₯˜ 응닡 λ…Έλ“œ**\n\n## μ›Œν¬ν”Œλ‘œμš° ꡬ쑰\n1. μ±„νŒ… 트리거 λ…Έλ“œκ°€ λ“€μ–΄μ˜€λŠ” λ©”μ‹œμ§€λ₯Ό μˆ˜μ‹ ν•©λ‹ˆλ‹€.\n2. λ©”μ‹œμ§€κ°€ κΈ°λ³Έ LLM 체인으둜 μ „λ‹¬λ©λ‹ˆλ‹€.\n3. Ollama λͺ¨λΈμ΄ Llama 3.2λ₯Ό μ‚¬μš©ν•˜μ—¬ μž…λ ₯을 μ²˜λ¦¬ν•©λ‹ˆλ‹€.\n4. 응닡이 체인을 톡해 λ°˜ν™˜λ©λ‹ˆλ‹€.\n\n## μ „μ œ 쑰건\n- N8N μ„€μΉ˜\n- Llama 3.2 λͺ¨λΈμ΄ ν¬ν•¨λœ Ollama μ„€μ •\n- μœ νš¨ν•œ Ollama API 자격 증λͺ…\n\n## ꡬ성\n1. N8Nμ—μ„œ Ollama API 자격 증λͺ…을 μ„€μ •ν•©λ‹ˆλ‹€.\n2. Ollama μ„€μΉ˜μ— Llama 3.2 λͺ¨λΈμ΄ μ‚¬μš© κ°€λŠ₯ν•˜λ„λ‘ ν•©λ‹ˆλ‹€." }, "typeVersion": 1 }, { "id": "64f60ee1-7870-461e-8fac-994c9c08b3f9", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 340, 280 ], "parameters": { "width": 560, "height": 200, "content": "## λͺ¨λΈ λ…Έλ“œ\n- 이름: Ollama Model\n- μœ ν˜•: LangChain Ollama Integration\n- λͺ¨λΈ: llama3.2:latest\n- λͺ©μ : μ–Έμ–΄ λͺ¨λΈ κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€" }, "typeVersion": 1 }, { "id": "bb46210d-450c-405b-a451-42458b3af4ae", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 200, -160 ], "parameters": { "color": 6, "width": 280, "height": 400, "content": "## 트리거 λ…Έλ“œ\n- 이름: μ±„νŒ… λ©”μ‹œμ§€ μˆ˜μ‹  μ‹œ\n- μœ ν˜•: μ±„νŒ… 트리거\n- λͺ©μ : μƒˆ μ±„νŒ… λ©”μ‹œμ§€κ°€ 도착할 λ•Œ μ›Œν¬ν”Œλ‘œλ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€" }, "typeVersion": 1 }, { "id": "7f21b9e6-6831-4117-a2e2-9c9fb6edc492", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 520, -380 ], "parameters": { "color": 3, "width": 500, "height": 620, "content": "## 처리 λ…Έλ“œ\n- 이름: κΈ°λ³Έ LLM 체인\n- μœ ν˜•: LangChain LLM 체인\n- λͺ©μ : μ–Έμ–΄ λͺ¨λΈμ„ 톡해 λ©”μ‹œμ§€μ˜ 처리λ₯Ό μ²˜λ¦¬ν•˜κ³  κ΅¬μ‘°ν™”λœ JSON 객체λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€." }, "typeVersion": 1 }, { "id": "871bac4e-002f-4a1d-b3f9-0b7d309db709", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 560, -200 ], "parameters": { "color": 7, "width": 420, "height": 200, "content": "### ν”„λ‘¬ν”„νŠΈ (μ‚¬μš© 사둀에 맞게 λ³€κ²½ν•˜μ„Έμš”)\nμ‚¬μš©μžμ˜ ν”„λ‘¬ν”„νŠΈμ™€ 응닡을 두 ν•„λ“œλ₯Ό κ°€μ§„ JSON 객체둜 μ œκ³΅ν•˜μ„Έμš”:\n- ν”„λ‘¬ν”„νŠΈ\n- 응닡\n\nμ–΄λ– ν•œ μ„œλ¬Έμ΄λ‚˜ μΆ”κ°€ μ„€λͺ…도 ν”Όν•˜μ„Έμš”.\n이것은 μ§ˆλ¬Έμž…λ‹ˆλ‹€: {{ $json.chatInput }}\n\n### 좜λ ₯" }, "typeVersion": 1 }, { "id": "c9e1b2af-059b-4330-a194-45ae0161aa1c", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1060, -280 ], "parameters": { "color": 5, "width": 420, "height": 520, "content": "## JSON을 객체 λ…Έλ“œλ‘œ\n- μœ ν˜•: Set λ…Έλ“œ\n- λͺ©μ : μ›Œν¬ν”Œλ‘œμš°λ₯Ό 톡해 보내기 전에 응닡 데이터λ₯Ό νŠΉμ • ν˜•μ‹μœΌλ‘œ λ³€ν™˜ν•˜κ³  κ΅¬μ‘°ν™”ν•˜λ„λ‘ μ„€κ³„λœ λ…Έλ“œ. μˆ˜λ™ λ§€ν•‘ λͺ¨λ“œμ—μ„œ μž‘λ™ν•˜μ—¬ 응닡 ν˜•μ‹μ— λŒ€ν•œ μ •λ°€ν•œ μ œμ–΄λ₯Ό ν—ˆμš©ν•©λ‹ˆλ‹€.\n\n**μ£Όμš” κΈ°λŠ₯**\n- μˆ˜λ™ ν•„λ“œ λ§€ν•‘ κΈ°λŠ₯\n- 객체 λ³€ν™˜ 및 μž¬κ΅¬μ„±\n- JSON 데이터 ν˜•μ‹ 지원\n- ν•„λ“œ κ°„ κ°’ λ§€ν•‘\n- μΆ”κ°€ μž…λ ₯ ν•„λ“œ μΆ”κ°€ μ˜΅μ…˜ 포함" }, "typeVersion": 1 }, { "id": "3fb912b8-86ac-42f7-a19c-45e59898a62e", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 1520, -180 ], "parameters": { "color": 6, "width": 460, "height": 420, "content": "## κ΅¬μ‘°ν™”λœ 응닡 λ…Έλ“œ\n- μœ ν˜•: Set Node\n- λͺ©μ : μ›Œν¬ν”Œλ‘œμš°κ°€ μ‚¬μš©μž μ±„νŒ… ν”„λ‘¬ν”„νŠΈμ— μ–΄λ–»κ²Œ μ‘λ‹΅ν•˜λŠ”μ§€λ₯Ό μ œμ–΄ν•©λ‹ˆλ‹€.\n\n**응닡 λͺ¨λ“œ**\n- μˆ˜λ™ λ§€ν•‘: 응닡 λ°μ΄ν„°μ˜ 맞좀 ν˜•μ‹ν™”λ₯Ό ν—ˆμš©ν•©λ‹ˆλ‹€.\n- μ„€μ • ν•„λ“œ: 응닡에 포함할 데이터 ν•„λ“œλ₯Ό μ§€μ •ν•©λ‹ˆλ‹€." }, "typeVersion": 1 }, { "id": "fdfd1a5c-e1a6-4390-9807-ce665b96b9ae", "name": "Structured Response", "type": "n8n-nodes-base.set", "position": [ 1700, 60 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "13c4058d-2d50-46b7-a5a6-c788828a1764", "name": "text", "type": "string", "value": "=Your prompt was: {{ $json.response.Prompt }}\n\nMy response is: {{ $json.response.Response }}\n\nThis is the JSON object:\n\n{{ $('Basic LLM Chain').item.json.text }}" } ] } }, "typeVersion": 3.4 }, { "id": "76baa6fc-72dd-41f9-aef9-4fd718b526df", "name": "Error Response", "type": "n8n-nodes-base.set", "position": [ 1460, 660 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "13c4058d-2d50-46b7-a5a6-c788828a1764", "name": "text", "type": "string", "value": "=There was an error." } ] } }, "typeVersion": 3.4 }, { "id": "bde3b9df-af55-451b-b287-1b5038f9936c", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 1240, 280 ], "parameters": { "color": 2, "width": 540, "height": 560, "content": "## 였λ₯˜ 응닡 λ…Έλ“œ\n- μœ ν˜•: Set λ…Έλ“œ\n- λͺ©μ : Basic LLM Chain이 μ±„νŒ… λ©”μ‹œμ§€λ₯Ό μ œλŒ€λ‘œ μ²˜λ¦¬ν•˜μ§€ λͺ»ν•  λ•Œ 였λ₯˜ 사둀λ₯Ό μ²˜λ¦¬ν•©λ‹ˆλ‹€. μ΄λŠ” μ›Œν¬ν”Œλ‘œκ°€ κ²¬κ³ ν•˜κ²Œ μœ μ§€λ˜λ„λ‘ λŒ€μ²΄ 응닡 λ©”μ»€λ‹ˆμ¦˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€.\n\n**μ£Όμš” κΈ°λŠ₯**\n- κΈ°λ³Έ 였λ₯˜ λ©”μ‹œμ§€λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€\n- μΌκ΄€λœ 응닡 ꡬ쑰λ₯Ό μœ μ§€ν•©λ‹ˆλ‹€\n- LLM Chain의 였λ₯˜ 좜λ ₯ λΈŒλžœμΉ˜μ— μ—°κ²°ν•©λ‹ˆλ‹€\n- μš°μ•„ν•œ μ‹€νŒ¨ 처리λ₯Ό 보μž₯ν•©λ‹ˆλ‹€\n\n였λ₯˜ 응닡 λ…Έλ“œλŠ” μ£Ό 처리 체인에 λ¬Έμ œκ°€ λ°œμƒν•  λ•Œ ν™œμ„±ν™”λ˜μ–΄, μ–Έμ–΄ λͺ¨λΈ μ²˜λ¦¬μ—μ„œ 였λ₯˜κ°€ λ°œμƒν•˜λ”λΌλ„ μ‚¬μš©μžκ°€ 항상 ν”Όλ“œλ°±μ„ 받을 수 μžˆλ„λ‘ ν•©λ‹ˆλ‹€." }, "typeVersion": 1 }, { "id": "b9b2ab8d-9bea-457a-b7bf-51c8ef0de69f", "name": "JSON to Object", "type": "n8n-nodes-base.set", "position": [ 1220, 60 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "12af1a54-62a2-44c3-9001-95bb0d7c769d", "name": "response", "type": "object", "value": "={{ $json.text }}" } ] } }, "typeVersion": 3.4 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "5175454a-91b7-4c57-890d-629bd4e8d2fd", "connections": { "Ollama Model": { "ai_languageModel": [ [ { "node": "Basic LLM Chain", "type": "ai_languageModel", "index": 0 } ] ] }, "JSON to Object": { "main": [ [ { "node": "Structured Response", "type": "main", "index": 0 } ] ] }, "Basic LLM Chain": { "main": [ [ { "node": "JSON to Object", "type": "main", "index": 0 } ], [ { "node": "Error Response", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "Basic LLM Chain", "type": "main", "index": 0 } ] ] } } }