feat: Chatbot-Workflows mit Ollama-Memory und Session-Management
- docker-compose: extra_hosts für host.docker.internal (Ollama-Zugang) - ollama-chatbot: Gesprächsverlauf per session_id in PostgreSQL - ollama-chat-cleanup: stündliche TTL-Bereinigung (2h Inaktivität) - ollama-chat-delete: DELETE /webhook/chat-session Endpoint Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
897b1ccf3d
commit
60143b8061
4 changed files with 246 additions and 0 deletions
59
imports/workflows/ollama-chat-delete.json
Normal file
59
imports/workflows/ollama-chat-delete.json
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"id": "1003",
|
||||
"name": "Chatbot Session löschen",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"httpMethod": "DELETE",
|
||||
"path": "chat-session",
|
||||
"responseMode": "responseNode",
|
||||
"options": {}
|
||||
},
|
||||
"id": "node-wh-002",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2,
|
||||
"position": [100, 300],
|
||||
"webhookId": "ollama-chat-delete"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "executeQuery",
|
||||
"query": "DELETE FROM chat_sessions WHERE session_id = $1 RETURNING session_id",
|
||||
"additionalFields": {
|
||||
"queryParams": "={{ JSON.stringify([$json.body.session_id]) }}"
|
||||
}
|
||||
},
|
||||
"id": "node-pg-004",
|
||||
"name": "Delete Session",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"typeVersion": 2.5,
|
||||
"position": [300, 300],
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "SETUP_REQUIRED",
|
||||
"name": "n8n PostgreSQL"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"respondWith": "json",
|
||||
"responseBody": "={{ JSON.stringify({ deleted: $input.first().json.session_id != null, session_id: $('Webhook').first().json.body.session_id }) }}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "node-rw-002",
|
||||
"name": "Respond",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"typeVersion": 1.1,
|
||||
"position": [500, 300]
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": { "main": [[{ "node": "Delete Session", "type": "main", "index": 0 }]] },
|
||||
"Delete Session": { "main": [[{ "node": "Respond", "type": "main", "index": 0 }]] }
|
||||
},
|
||||
"active": false,
|
||||
"settings": { "executionOrder": "v1" },
|
||||
"tags": []
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue