Files
n8n-compose/docs/superpowers/plans/2026-03-16-ai-support-automation-plan.md

1024 lines
23 KiB
Markdown
Raw Normal View History

# AI-gestützte IT-Support-Automatisierung Implementation Plan
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Ein produktives Hybrid-System bauen, das Freescout-Mails analysiert, KI-Vorschläge macht, Mensch-Approval einholt, und eine selbstlernende Wissensdatenbank aufbaut.
**Architecture:** 4-phasiger Ansatz:
1. **Phase 1 (Setup):** Docker Compose + Vector DB + Freescout Custom Fields
2. **Phase 2 (Workflows):** n8n Workflows A (Mail-Processing), B (Approval), C (KB-Update)
3. **Phase 3 (Integration):** End-to-End Testing + API Connections
4. **Phase 4 (Production):** Monitoring + Dokumentation + Go-Live
**Tech Stack:**
- **Orchestrierung:** n8n (vorhanden, Docker)
- **Vector DB:** Milvus (Docker)
- **KI:** LiteLLM API (extern: http://llm.eks-ai.apps.asgard.eks-lnx.fft-it.de)
- **Mail-Source:** Freescout API (extern: https://ekshelpdesk.fft-it.de)
- **Job-Execution:** Baramundi Management Server API (extern)
- **Audit Trail:** PostgreSQL (Docker)
---
## Chunk 1: Infrastructure & Setup
### Task 1.1: Vector Database in Docker Compose integrieren
**Files:**
- Modify: `compose.yaml`
- Create: `.env.example` (aktualisieren mit neuen Vars)
- [ ] **Step 1: compose.yaml lesen und Struktur verstehen**
Schau dir die aktuelle Struktur an (Traefik, n8n).
- [ ] **Step 2: Milvus Service zu compose.yaml hinzufügen**
```yaml
milvus:
image: milvusdb/milvus:latest
restart: always
environment:
COMMON_STORAGETYPE: local
COMMON_LOG_LEVEL: info
ports:
- "127.0.0.1:19530:19530"
- "127.0.0.1:9091:9091"
volumes:
- milvus_data:/var/lib/milvus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
timeout: 10s
retries: 5
postgres:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_DB: n8n_kb
POSTGRES_USER: kb_user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U kb_user"]
interval: 10s
timeout: 5s
retries: 5
volumes:
traefik_data:
n8n_data:
milvus_data:
postgres_data:
```
- [ ] **Step 3: .env mit neuen Variablen aktualisieren**
```bash
# Existing
SSL_EMAIL=your-email@example.com
SUBDOMAIN=n8n
DOMAIN_NAME=example.com
GENERIC_TIMEZONE=Europe/Berlin
# New für KB
POSTGRES_PASSWORD=secure_password_change_me
MILVUS_API_URL=http://milvus:19530
```
- [ ] **Step 4: Services starten und healthcheck testen**
```bash
docker-compose up -d milvus postgres
docker-compose logs -f milvus
# Expected: "Milvus is ready to serve"
curl http://127.0.0.1:9091/healthz
# Expected: 200 OK
```
- [ ] **Step 5: Commit**
```bash
git add compose.yaml .env.example
git commit -m "infra: add Milvus vector DB and PostgreSQL for KB audit trail"
```
---
### Task 1.2: PostgreSQL Audit Schema erstellen
**Files:**
- Create: `sql/01-audit-schema.sql`
- [ ] **Step 1: Erstelle SQL Schema Datei**
```sql
-- Audit Trail für KB Updates
CREATE TABLE knowledge_base_updates (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
ticket_id INTEGER NOT NULL,
problem_text TEXT NOT NULL,
kategorie VARCHAR(100),
lösung TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
approved_at TIMESTAMP,
executed_at TIMESTAMP,
status VARCHAR(50) CHECK (status IN ('PENDING', 'APPROVED', 'REJECTED', 'EXECUTED')),
freescout_note TEXT
);
CREATE INDEX idx_kbu_ticket ON knowledge_base_updates(ticket_id);
CREATE INDEX idx_kbu_status ON knowledge_base_updates(status);
CREATE INDEX idx_kbu_kategorie ON knowledge_base_updates(kategorie);
CREATE TABLE kb_feedback (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
kb_entry_id VARCHAR(255) NOT NULL,
feedback VARCHAR(50) CHECK (feedback IN ('helpful', 'not_helpful')),
reason TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_kbf_entry ON kb_feedback(kb_entry_id);
CREATE TABLE workflow_executions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
workflow_name VARCHAR(255),
ticket_id INTEGER,
status VARCHAR(50),
error_message TEXT,
execution_time_ms INTEGER,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_we_ticket ON workflow_executions(ticket_id);
CREATE INDEX idx_we_workflow ON workflow_executions(workflow_name);
```
- [ ] **Step 2: Initialisiere PostgreSQL mit Schema**
```bash
docker-compose exec postgres psql -U kb_user -d n8n_kb < sql/01-audit-schema.sql
# Expected: CREATE TABLE, CREATE INDEX messages
```
- [ ] **Step 3: Teste Schema**
```bash
docker-compose exec postgres psql -U kb_user -d n8n_kb -c "\dt"
# Expected: 3 tables angezeigt
```
- [ ] **Step 4: Commit**
```bash
git add sql/01-audit-schema.sql
git commit -m "infra: PostgreSQL audit schema for KB tracking"
```
---
### Task 1.3: Freescout Custom Fields erstellen (manuell)
**Dokumentation:** Freescout API Docs
- [ ] **Step 1: Freescout API Key vorbereiten**
Erstelle `.env` Eintrag:
```bash
FREESCOUT_API_KEY=your_api_key_here
FREESCOUT_API_BASE=https://ekshelpdesk.fft-it.de/api/v1
FREESCOUT_MAILBOX_ID=1
```
- [ ] **Step 2: Test Freescout API Verbindung**
```bash
curl -H "Authorization: Bearer $FREESCOUT_API_KEY" \
https://ekshelpdesk.fft-it.de/api/v1/mailboxes/1
# Expected: Mailbox JSON angezeigt
```
- [ ] **Step 3: Erstelle Setup-Skript für Custom Fields**
Datei: `scripts/setup-freescout-fields.sh`
```bash
#!/bin/bash
API_BASE="${FREESCOUT_API_BASE}"
API_KEY="${FREESCOUT_API_KEY}"
MAILBOX_ID="${FREESCOUT_MAILBOX_ID}"
echo "Creating Freescout Custom Fields..."
# Field 1: AI_SUGGESTION (Text für JSON)
curl -X POST "$API_BASE/mailboxes/$MAILBOX_ID/custom-fields" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "AI_SUGGESTION",
"title": "KI-Vorschlag",
"type": "text",
"required": false
}' && echo "✅ AI_SUGGESTION created"
# Field 2: AI_SUGGESTION_STATUS (Dropdown)
curl -X POST "$API_BASE/mailboxes/$MAILBOX_ID/custom-fields" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "AI_SUGGESTION_STATUS",
"title": "KI-Status",
"type": "select",
"required": false,
"options": ["PENDING", "APPROVED", "REJECTED", "EXECUTED"]
}' && echo "✅ AI_SUGGESTION_STATUS created"
# Field 3: PROCESSED_BY_AI (Boolean)
curl -X POST "$API_BASE/mailboxes/$MAILBOX_ID/custom-fields" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "PROCESSED_BY_AI",
"title": "Von KI verarbeitet",
"type": "checkbox",
"required": false
}' && echo "✅ PROCESSED_BY_AI created"
echo "✅ All custom fields created!"
```
- [ ] **Step 4: Führe Setup Skript aus**
```bash
bash scripts/setup-freescout-fields.sh
# Expected: 3x ✅ created
```
- [ ] **Step 5: Commit**
```bash
git add scripts/setup-freescout-fields.sh
git commit -m "scripts: setup Freescout custom fields"
```
---
## Chunk 2: n8n Workflows Setup & Workflow A (Mail Processing)
### Task 2.1: n8n Credentials & Collections vorbereiten
**Files:**
- Create: `n8n-workflows/00-SETUP.md`
- Create: `n8n-workflows/workflow-a-mail-processing.json`
- [ ] **Step 1: Verstehe n8n Workflow Export Format**
n8n Workflows werden als JSON exportiert. Struktur:
```json
{
"name": "Workflow Name",
"nodes": [...],
"connections": {...},
"active": true
}
```
- [ ] **Step 2: Erstelle Setup-Dokumentation**
Datei: `n8n-workflows/00-SETUP.md`
```markdown
# n8n Workflows Setup
## Benötigte Credentials
1. **Freescout API:**
- Type: HTTP Request (Generic Credentials)
- Base URL: https://ekshelpdesk.fft-it.de/api/v1
- Auth: Bearer Token (von .env FREESCOUT_API_KEY)
2. **LiteLLM API:**
- Type: HTTP Request
- Base URL: http://llm.eks-ai.apps.asgard.eks-lnx.fft-it.de
- No auth needed (lokal)
3. **PostgreSQL:**
- Host: postgres (Docker)
- Port: 5432
- Database: n8n_kb
- User: kb_user
- Password: (von .env POSTGRES_PASSWORD)
4. **Milvus:**
- Host: milvus
- Port: 19530
- No auth
## Workflow Import
Importiere folgende Workflows in n8n:
1. workflow-a-mail-processing.json
2. workflow-b-approval-execution.json
3. workflow-c-kb-update.json
Schalte sie in dieser Reihenfolge an:
1. Workflow A (Mail Processing) hauptziel
2. Workflow B (Approval) triggered bei Field-Änderung
3. Workflow C (KB Update) triggered nach Workflow B
```
- [ ] **Step 3: Commit Setup Dokumentation**
```bash
git add n8n-workflows/00-SETUP.md
git commit -m "docs: n8n setup and credential configuration"
```
---
### Task 2.2: Workflow A Mail Processing (Polling + KI-Analyse)
**Files:**
- Create: `n8n-workflows/workflow-a-mail-processing.json`
**Logik:**
1. Trigger: Cron (alle 5 Min)
2. Freescout API: neue Tickets fetchen
3. Für jedes Ticket: Vector DB Query + LLM Call
4. Speichere Vorschlag in Freescout
- [ ] **Step 1: Workflow-Struktur in n8n UI bauen**
Node 1: **Cron Trigger**
- Cron: `*/5 * * * *` (alle 5 Min)
Node 2: **Freescoot API Get Conversations**
- Method: GET
- URL: `https://ekshelpdesk.fft-it.de/api/v1/mailboxes/1/conversations?status=active`
- Auth: Bearer Token
- Params: `status=active&limit=20&processed_by_ai=false`
Node 3: **Loop through Conversations**
- Use: Loop node über Array aus Node 2
Node 4: **Extract Conversation Details**
- Use: Set node um Subject, Body zu extrahieren
```javascript
{
ticket_id: item.id,
subject: item.subject,
body: item.threads[0].body,
customer_email: item.customer.email
}
```
Node 5: **Vector DB Query (Milvus)**
- Python node um ähnliche KB-Einträge zu finden
```python
from pymilvus import Collection
# Connect to Milvus
collection = Collection("knowledge_base")
# Search for similar problems
results = collection.search(
data=[embedding_vector], # zu erzeugen via LLM
anns_field="embedding",
param={
"metric_type": "L2",
"params": {"nprobe": 10}
},
limit=3,
output_fields=["problem_text", "kategorie", "lösung"]
)
return results
```
Node 6: **LLM Call (LiteLLM)**
- HTTP Request zu LiteLLM
- Method: POST
- URL: `http://llm.eks-ai.apps.asgard.eks-lnx.fft-it.de/v1/chat/completions`
- Body:
```json
{
"model": "available-model",
"messages": [
{
"role": "system",
"content": "Du bist IT-Support-Assistent..."
},
{
"role": "user",
"content": "Ticket: [subject]\n[body]\n\nÄhnliche Lösungen aus KB: [top 3 results]"
}
],
"temperature": 0.3
}
```
Node 7: **Parse LLM Response**
- Extract JSON aus response
```javascript
{
kategorie: json.kategorie,
lösung_typ: json.lösung_typ,
vertrauen: json.vertrauen,
antwort_text: json.antwort_text,
begründung: json.begründung
}
```
Node 8: **Save to Freescout (Custom Fields)**
- HTTP Request
- Method: PUT
- URL: `https://ekshelpdesk.fft-it.de/api/v1/conversations/{ticket_id}`
- Body:
```json
{
"custom_fields": {
"AI_SUGGESTION": "{{$node[\"Parse LLM Response\"].json}}",
"AI_SUGGESTION_STATUS": "PENDING",
"PROCESSED_BY_AI": true
}
}
```
- [ ] **Step 2: Exportiere Workflow als JSON**
In n8n: Menu → Export → Full Workflow JSON
Speichere als `n8n-workflows/workflow-a-mail-processing.json`
- [ ] **Step 3: Teste Workflow manuell**
- Starte Workflow manuell (Test-Button)
- Check Freescout UI: neue Custom Fields angezeigt?
- Check n8n Logs auf Fehler
- [ ] **Step 4: Aktiviere Cron Trigger**
Schalte Workflow an. Sollte jetzt alle 5 Min laufen.
- [ ] **Step 5: Commit**
```bash
git add n8n-workflows/workflow-a-mail-processing.json
git commit -m "feat: workflow A mail processing and KI analysis"
```
---
## Chunk 3: Workflow B & C (Approval + KB Update)
### Task 3.1: Workflow B Approval & Execution
**Files:**
- Create: `n8n-workflows/workflow-b-approval-execution.json`
**Logik:**
1. Trigger: Webhook oder Polling (wenn AI_SUGGESTION_STATUS geändert)
2. Validiere: APPROVED oder REJECTED
3. Wenn APPROVED: Branching
- Baramundi Job? → Baramundi API Call
- Automatische Antwort? → Email senden
4. Trigger Workflow C
- [ ] **Step 1: Baue Trigger Node**
Option A: **Webhook Trigger** (empfohlen)
- Freescout muss Webhook supportieren
- Trigger bei Field-Änderung
Option B: **Polling via HTTP**
- Alle 2 Min abfragen: welche Conversations haben AI_SUGGESTION_STATUS = APPROVED
- Fallback wenn Webhook nicht verfügbar
Für MVP: **Option B (Polling)**
- [ ] **Step 2: Baue Approval Check Node**
HTTP Request zu Freescout:
```
GET /api/v1/conversations?custom_field_AI_SUGGESTION_STATUS=APPROVED&processed_approval=false
```
- [ ] **Step 3: Baue Branching Logic**
Für jedes approved Ticket:
- Parse AI_SUGGESTION
- Check: ist `lösung_typ == "BARAMUNDI_JOB"` oder `"AUTOMATISCHE_ANTWORT"`?
- [ ] **Step 4: Baramundi Job Node**
Wenn Baramundi:
```
POST /api/jobs (Baramundi Management Server)
{
"name": "{{$node[...].json.baramundi_job.name}}",
"parameter": {...}
}
```
- [ ] **Step 5: Email/Reply Node**
Wenn Automatische Antwort:
```
POST /api/v1/conversations/{id}/threads
{
"from": "support@company.com",
"to": "{{customer_email}}",
"subject": "Re: {{subject}}",
"body": "{{antwort_text}}"
}
```
- [ ] **Step 6: Mark as Executed**
Nach Success: Update Custom Field
```
PUT /api/v1/conversations/{id}
{
"custom_fields": {
"AI_SUGGESTION_STATUS": "EXECUTED"
}
}
```
- [ ] **Step 7: Trigger Workflow C**
Webhook Call zu Workflow C:
```
POST http://n8n:5678/webhook/kb-update
{
"ticket_id": "...",
"status": "EXECUTED"
}
```
- [ ] **Step 8: Exportiere & Teste**
```bash
# Export Workflow B
# In n8n: Menu → Export
git add n8n-workflows/workflow-b-approval-execution.json
git commit -m "feat: workflow B approval gate and execution"
```
---
### Task 3.2: Workflow C Knowledge Base Update
**Files:**
- Create: `n8n-workflows/workflow-c-kb-update.json`
**Logik:**
1. Trigger: Webhook von Workflow B
2. Hole Lösungs-Details
3. Generiere Embedding (LLM)
4. Speichere in Milvus
5. Update Häufigkeit bestehender Einträge
6. Log in PostgreSQL
- [ ] **Step 1: Webhook Trigger Node**
```
POST http://n8n:5678/webhook/kb-update
```
Payload:
```json
{
"ticket_id": "123",
"problem_text": "...",
"kategorie": "Hardware",
"lösung": "Drucker-Treiber neu installiert"
}
```
- [ ] **Step 2: Embedding Generation Node**
LLM Call für Embedding:
```
POST http://llm.eks-ai.apps.asgard.eks-lnx.fft-it.de/v1/embeddings
{
"model": "available",
"input": "Hardware: {{kategorie}} + {{problem_text}}"
}
```
- [ ] **Step 3: Milvus Insert Node**
Python Node:
```python
from pymilvus import Collection
import json
collection = Collection("knowledge_base")
entity = {
"id": uuid4(),
"problem_text": "{{problem_text}}",
"kategorie": "{{kategorie}}",
"lösung": "{{lösung}}",
"häufigkeit": 1,
"embedding": embedding_vector,
"timestamp": datetime.now(),
"freescout_ticket_id": ticket_id
}
collection.insert([entity])
collection.flush()
return {"status": "inserted"}
```
- [ ] **Step 4: Update Häufigkeit (Optional)**
Suche ähnliche KB-Einträge und erhöhe deren Häufigkeit:
```python
results = collection.search(
data=[embedding_vector],
limit=5,
threshold=0.85
)
for result in results:
# Update entry
collection.delete(id=result.id)
result.häufigkeit += 1
collection.insert([result])
```
- [ ] **Step 5: PostgreSQL Audit Log Node**
PostgreSQL Node:
```sql
INSERT INTO knowledge_base_updates
(ticket_id, problem_text, kategorie, lösung, status, created_at, approved_at, executed_at)
VALUES
('{{ticket_id}}', '{{problem_text}}', '{{kategorie}}', '{{lösung}}', 'EXECUTED', NOW(), NOW(), NOW())
```
- [ ] **Step 6: Error Handling**
Wenn einer der Steps fehlschlägt:
- Log Error in PostgreSQL
- Notify Admin (optional Email)
- STOP (nicht crashen)
- [ ] **Step 7: Exportiere & Teste**
```bash
git add n8n-workflows/workflow-c-kb-update.json
git commit -m "feat: workflow C knowledge base auto-update"
```
---
## Chunk 4: Integration, Testing & Production
### Task 4.1: End-to-End Testing
**Files:**
- Create: `tests/e2e-test-scenario.md`
- Create: `tests/curl-test-collection.sh`
- [ ] **Step 1: Schreibe E2E Test Szenario**
```markdown
# E2E Test: Full Workflow
## Setup
- Milvus läuft
- PostgreSQL läuft
- n8n läuft
- Freescout erreichbar
- LiteLLM erreichbar
## Test Steps
1. **Create Test Ticket in Freescout**
- Subject: "Drucker funktioniert nicht"
- Body: "Jeder Druck-Befehl wird abgelehnt. Fehlercode 5."
- Customer: test@example.com
2. **Warte 5 Min** (Workflow A Cycle)
- Check n8n Logs: Mail verarbeitet?
- Check Freescout: Custom Field AI_SUGGESTION gefüllt?
3. **Approve Vorschlag**
- Freescout: AI_SUGGESTION_STATUS = APPROVED
4. **Warte 2 Min** (Workflow B Cycle)
- Check n8n: Job ausgelöst oder Email gesendet?
- Check Baramundi: Job erstellt?
5. **Warte 1 Min** (Workflow C Cycle)
- Check PostgreSQL: INSERT in knowledge_base_updates?
- Check Milvus: KB-Eintrag erstellt?
6. **Vector DB Search Test**
- Query Milvus mit ähnlichem Problem
- Sollte neuen Eintrag finden mit hoher Similarity
```
- [ ] **Step 2: Schreibe Test Curl Commands**
`tests/curl-test-collection.sh`:
```bash
#!/bin/bash
echo "=== E2E Test Collection ==="
# 1. Check Milvus Health
echo "✓ Testing Milvus..."
curl http://127.0.0.1:9091/healthz
# 2. Check PostgreSQL
echo "✓ Testing PostgreSQL..."
docker-compose exec postgres psql -U kb_user -d n8n_kb -c "SELECT COUNT(*) FROM knowledge_base_updates;"
# 3. Check Freescout API
echo "✓ Testing Freescout API..."
curl -H "Authorization: Bearer $FREESCOUT_API_KEY" \
https://ekshelpdesk.fft-it.de/api/v1/mailboxes/1/conversations?limit=5
# 4. Check LiteLLM
echo "✓ Testing LiteLLM..."
curl -X POST http://llm.eks-ai.apps.asgard.eks-lnx.fft-it.de/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "any",
"messages": [{"role": "user", "content": "test"}]
}'
echo "=== All tests passed ==="
```
- [ ] **Step 3: Führe Tests aus**
```bash
bash tests/curl-test-collection.sh
# Expected: ✓ All tests passed
```
- [ ] **Step 4: Erstelle echtes Test-Ticket in Freescout**
Manuell oder via Freescout UI:
- Subject: "Drucker funktioniert nicht"
- Body: "Fehlercode 5 beim Drucken"
Überwache:
- n8n Logs
- Freescout Custom Fields
- PostgreSQL
- [ ] **Step 5: Commit**
```bash
git add tests/
git commit -m "test: E2E test scenarios and curl collection"
```
---
### Task 4.2: Monitoring & Logging Setup
**Files:**
- Create: `docker-compose.override.yml` (für Logging)
- Create: `docs/MONITORING.md`
- [ ] **Step 1: Füge n8n Logging zu Compose hinzu**
`docker-compose.override.yml`:
```yaml
services:
n8n:
environment:
- N8N_LOG_LEVEL=debug
- N8N_LOG_OUTPUT=stdout
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
```
- [ ] **Step 2: Erstelle Monitoring Dokumentation**
`docs/MONITORING.md`:
```markdown
# Monitoring & Debugging
## Key Metrics
1. **Mail Processing Rate**
- N8N Logs: "processed X conversations"
- PostgreSQL: `SELECT COUNT(*) FROM workflow_executions WHERE workflow_name='workflow-a'`
2. **Approval Rate**
- PostgreSQL: `SELECT status, COUNT(*) FROM knowledge_base_updates GROUP BY status`
- Expected: Meiste APPROVED
3. **KB Growth**
- Milvus: `SELECT COUNT(*) FROM knowledge_base` (via Python)
- Expected: +1 pro appropierten Ticket
4. **Error Rate**
- PostgreSQL: `SELECT * FROM workflow_executions WHERE status='ERROR'`
- Expected: < 5%
## Troubleshooting
### Workflow A läuft nicht
- Check: Cron trigger aktiv?
- Check: n8n credentials valid?
- Check: Freescout API erreichbar?
### Workflow B triggert nicht
- Check: AI_SUGGESTION_STATUS im Freescout updatet?
- Check: Polling Interval (2 Min)?
### Workflow C speichert nicht in KB
- Check: Milvus läuft?
- Check: Embedding generiert?
## Logs
```bash
# n8n Logs
docker-compose logs -f n8n
# PostgreSQL
docker-compose exec postgres psql -U kb_user -d n8n_kb -c "SELECT * FROM workflow_executions LIMIT 10;"
# Milvus
docker-compose logs -f milvus
```
```
- [ ] **Step 3: Commit**
```bash
git add docker-compose.override.yml docs/MONITORING.md
git commit -m "infra: logging and monitoring setup"
```
---
### Task 4.3: Production Dokumentation & Go-Live Checklist
**Files:**
- Create: `docs/DEPLOYMENT.md`
- Create: `docs/GO-LIVE-CHECKLIST.md`
- [ ] **Step 1: Schreibe Deployment Guide**
`docs/DEPLOYMENT.md`:
```markdown
# Deployment Guide
## Prerequisites
- Docker & Docker Compose installed
- Freescout API Key
- Baramundi API Access
- PostgreSQL Backup Strategy
## Deployment Steps
1. Clone Repository
2. Setup .env (siehe .env.example)
3. Run Docker Services: `docker-compose up -d`
4. Run DB Schema: `sql/01-audit-schema.sql`
5. Setup Freescout Custom Fields: `bash scripts/setup-freescout-fields.sh`
6. Import n8n Workflows (manual via n8n UI)
7. Run E2E Tests: `bash tests/curl-test-collection.sh`
8. Enable Workflows (schalte alle 3 Workflows an)
## Monitoring
See docs/MONITORING.md
## Rollback
1. Deaktiviere alle n8n Workflows
2. Lösche PostgreSQL Daten (optional)
3. Setze KB zurück (optional)
```
- [ ] **Step 2: Go-Live Checklist**
`docs/GO-LIVE-CHECKLIST.md`:
```markdown
# Go-Live Checklist
## 1 Week Before
- [ ] E2E Tests durchgeführt (alle ✓)
- [ ] Staging Environment getestet
- [ ] Team Training abgeschlossen
- [ ] Backup-Strategie definiert
## Go-Live Day
- [ ] Alle Docker Services laufen
- [ ] All n8n Workflows aktiv
- [ ] Monitoring Dashboard aktiv
- [ ] Backup vor Go-Live
## Während Launch
- [ ] Monitor n8n Logs
- [ ] Monitor Freescout
- [ ] Monitor Baramundi Job Queue
- [ ] Alert System aktiv
## Nach 24h
- [ ] KI-Vorschläge angezeigt?
- [ ] Approvals funktionieren?
- [ ] Jobs werden ausgelöst?
- [ ] KB wächst?
## Nach 1 Woche
- [ ] Statistiken: Wie viele Mails verarbeitet?
- [ ] Wie viele Approvals?
- [ ] Wie viele Baramundi Jobs?
- [ ] Feedback vom Team sammeln
```
- [ ] **Step 3: Commit**
```bash
git add docs/DEPLOYMENT.md docs/GO-LIVE-CHECKLIST.md
git commit -m "docs: deployment and go-live documentation"
```
---
### Task 4.4: Final Testing & Acceptance
- [ ] **Step 1: Führe alle E2E Tests durch**
```bash
bash tests/curl-test-collection.sh
```
- [ ] **Step 2: Teste mit echtem Ticket (Staging)**
Erstelle Test-Ticket in Freescout:
- Subject: "Test: Drucker funktioniert nicht"
- Body: "Fehlercode 5"
Überwache 15 Min:
- Mail analysiert?
- KI-Vorschlag angezeigt?
- Approve Vorschlag
- Job ausgelöst oder Email gesendet?
- KB aktualisiert?
- [ ] **Step 3: Dokumentiere Ergebnisse**
Wenn alles ✓: Go-Live bereit!
- [ ] **Step 4: Final Commit**
```bash
git add .
git commit -m "feat: AI-support-automation MVP complete and tested"
```
---
## Summary
**Phase 1:** Milvus + PostgreSQL + Freescout Custom Fields
**Phase 2:** Workflow A (Mail Processing) + Workflow B (Approval) + Workflow C (KB Update)
**Phase 3:** E2E Testing + Monitoring
**Phase 4:** Production Ready
**Status:** Bereit für Implementation via `superpowers:subagent-driven-development` oder `superpowers:executing-plans`
---
## Next Steps
🚀 **Sollen wir starten?**
- Wenn ja: Nutze `superpowers:executing-plans` um den Plan zu implementieren
- Wenn nein: Änderungen an Plan vornehmen