# Archivar Deployment-Runbook für .45 Bare-VM ## Voraussetzungen - Ubuntu/Debian .45 Bare-VM - Python 3.10+ - Rocket.Chat Server (selbst gehostet) - Ollama (lokal oder remote) ## 1. System-Abhängigkeiten ```bash sudo apt update sudo apt install -y python3 python3-pip python3-venv git curl ``` ## 2. Repository klonen ```bash cd /opt git clone https://github.com/your-org/Hermes_rocket.chat_Plugin.git cd Hermes_rocket.chat_Plugin ``` ## 3. Python-Umgebung ```bash python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` ## 4. room-map.json Pfad-Korrektur **KRITISCH:** Auf .45 Bare-VM liegt das Hermes-Datenverzeichnis unter `/var/lib/hermes-agent/data/`, NICHT unter `~/.hermes/hermes-agent/data/`. ```bash # Korrekten Pfad setzen export ARCHIVAR_ROOM_MAP_PATH="/var/lib/hermes-agent/data/room-map.json" export ARCHIVAR_STATE_PATH="/var/lib/hermes-agent/data/archivar_state.json" # Verzeichnis anlegen falls nicht vorhanden mkdir -p /var/lib/hermes-agent/data/ ``` ## 5. room-map.json erstellen ```bash cp room-map.schema.json /var/lib/hermes-agent/data/room-map.json # Bearbeite die Datei mit deinen Raum-IDs: nano /var/lib/hermes-agent/data/room-map.json ``` ## 6. Environment-Variablen ```bash # In /etc/hermes-agent/hermes.env oder systemd EnvironmentFile: ROCKETCHAT_URL=https://chat.example.com ROCKETCHAT_USER=archivar-bot ROCKETCHAT_PASSWORD=your-password ROCKETCHAT_TOKEN=your-resume-token ARCHIVAR_ROOM_MAP_PATH=/var/lib/hermes-agent/data/room-map.json ARCHIVAR_STATE_PATH=/var/lib/hermes-agent/data/archivar_state.json ARCHIVAR_EMBEDDING_BASE_URL=http://localhost:11434 ARCHIVAR_LLM_BASE_URL=http://localhost:11434 ARCHIVAR_ENABLE_LLM=true # V8.2.1: Feature-Flags ARCHIVAR_STRATEGY_AUTO_DETECT=false # Default AUS (Rainer Auflage P1) MULTIROOM_AGENT=true ``` ## 7. Ollama sicherstellen ```bash # Ollama installieren falls nicht vorhanden curl -fsSL https://ollama.com/install.sh | sh # Modelle pullen ollama pull nomic-embed-text ollama pull qwen2.5:7b ``` ## 8. Gateway-Start ```bash cd /opt/Hermes_rocket.chat_Plugin source venv/bin/activate python3 -m gateway --platform rocketchat ``` ## 9. Verifikation ```bash # Kompilierung prüfen python3 -m py_compile plugin/adapter.py plugin/archivar/*.py # Tests ausführen cd plugin && python3 -m pytest archivar/tests/ -q # Gateway-Logs prüfen tail -f /var/log/hermes-agent/gateway.log | grep -E "Archivar|ROUTING|FAISS" ``` ## 10. Troubleshooting ### room-map.json nicht gefunden → Prüfe `ARCHIVAR_ROOM_MAP_PATH` und ob die Datei existiert. → Auf .45 Bare-VM: `/var/lib/hermes-agent/data/room-map.json` ### Ollama nicht erreichbar → `curl http://localhost:11434/api/tags` → Falls remote: `ARCHIVAR_EMBEDDING_BASE_URL` und `ARCHIVAR_LLM_BASE_URL` anpassen ### Gateway startet nicht → `python3 -m py_compile plugin/adapter.py` — muss ohne Fehler durchlaufen → Prüfe ob alle Env-Vars gesetzt sind ### Strategie-Modus funktioniert nicht → `ARCHIVAR_STRATEGY_AUTO_DETECT=false` ist Default (manuelle Nachklärung) → Auto-Detection erst aktivieren wenn manuelle Nachklärung stabil läuft