docs: README + Community-Post komplett überarbeitet

README.md (13026 bytes):
- Archivar v3 dokumentiert (3-stage classifier, User-Flow C, Button-Garantie)
- Move-Request mit nativen Buttons (✅Ja/📍Hier/📌Generell)
- Auto-Onboarding, FAKT→Obsidian, Sticky Rooms
- Deployment-Pfad-Klärung (~/.hermes/... vs /usr/local/lib/...)
- Troubleshooting um 5 neue Einträge erweitert (Discovery Bug, __pycache__,
  install.sh path mismatch, Button-Text-Fallback, ENOTFOUND https)
- Button-Garantie als eigenes Feature hervorgehoben

COMMUNITY_POST.md (6857 bytes) — NEU:
- Use-Case-getriebener Community-Beitrag (DevOps, Personal Assistant, PM)
- Button-Garantie als Alleinstellungsmerkmal
- FAQ-Sektion (SaaS, Multi-User, Permissions, Gateway-Restarts)
- Quick-Start mit install.sh
This commit is contained in:
Hermes Agent
2026-06-12 08:30:32 +02:00
parent 6348578678
commit 6eda62b94c
2 changed files with 307 additions and 192 deletions
+122 -163
View File
@@ -1,63 +1,75 @@
# Hermes Rocket.Chat Plugin — Community Release
# Hermes Agent × Rocket.Chat — Your AI Assistant, Now in Every Room
> **Nützliches Add-on für [Hermes Agent](https://hermes-agent.nousresearch.com/)**
> Verbindet Hermes Agent mit einem selbst-gehosteten Rocket.Chat-Server.
**Connect your Hermes Agent to a self-hosted Rocket.Chat server and talk to it from any channel, group, or DM — with native buttons, smart room routing, and file sharing.**
---
## ⚠️ HAFTUNGSAUSSCHLUSS
## What This Plugin Does
**DIESES PLUGIN WIRD OHNE JEGLICHE GEWÄHRLEISTUNG BEREITGESTELLT.**
You run [Hermes Agent](https://github.com/NousResearch/hermes-agent) — a personal AI agent that remembers across sessions, delegates to subagents, and drives a real terminal and browser. Normally you talk to it through a CLI or TUI.
- Die Nutzung erfolgt **ausschließlich auf eigene Gefahr**.
- Der Autor übernimmt **keinerlei Haftung** für Schäden, Datenverluste, Sicherheitsvorfälle, fehlerhafte Konfigurationen oder sonstige Nachteile, die aus der Installation oder Nutzung dieses Plugins entstehen können.
- Dieses Plugin ist ein **inoffizielles Community-Projekt**. Es steht in keiner Verbindung zu Rocket.Chat (Rocket.Chat Technologies Corp.) oder Nous Research.
- Vor dem Produktiveinsatz sind **eigene Sicherheitsprüfungen und Tests** zwingend erforderlich.
- Das Plugin wird unter der [Unlicense](LICENSE) veröffentlicht — es kommt **wie gesehen ("as-is")**, ohne Mängelgewähr und ohne Support-Garantie.
This plugin connects Hermes to **Rocket.Chat**, so you can talk to your agent from **any room** on your self-hosted chat server. One agent, all rooms, one memory.
**Wer dieses Plugin installiert oder einsetzt, erklärt sich mit diesen Bedingungen einverstanden.**
### The Experience
```
You (in #devops): "What's the status of the BAT stack?"
Agent (in #devops): "5/5 containers UP. API :3001, Web :3003, DB healthy.
Gateway connected to rocketchat.thomander.de."
You (in DM): "StartObsidian"
Agent (in DM): "Vault clean. No new FAKT files. Last daily: 08.06.
BAT: 5/5 UP, RC-Plugin: Archivar v3 deployed."
You (in #general): "Deploy the new adapter fix"
Agent (in #general): "Dein Auftrag passt thematisch besser in #rocketchat-plugin."
[✅Ja] [📍Hier] [📌Generell]
```
The agent knows what happened in ALL rooms. It routes tasks to the right room. It asks before moving things. And you always click buttons — never type numbers.
---
## Was ist das?
## Key Features
Dieses Plugin verwandelt Hermes Agent in einen **nativen Rocket.Chat-Benutzer** — mit Echtzeit-Nachrichten über das Hermes Gateway, Präsenz-Status und interaktiven Buttons.
### 🎯 Button-Garantie (Button Guarantee)
**Das Besondere:** Ein einziger Agent kann in beliebig vielen Räumen gleichzeitig präsent sein — Kanäle, Gruppen, DMs — und behält trotzdem den Überblick. Inhalte landen automatisch im richtigen Raum, Themen bleiben sauber getrennt, und nichts geht im Multi-Room-Chaos unter.
**Every user interaction uses native Rocket.Chat buttons.** No raw text input, no "type 1/2/3", no confusion.
- **Eingehend**: WebSocket/DDP (`stream-room-messages`) für sofortige Nachrichten
- **Ausgehend**: REST-API für Antworten, Buttons, Dateien
- **Gateway-nativ**: Registriert sich als `rocketchat-platform` im Hermes Gateway — kein Standalone-Daemon mehr
- **Multi-Room-fähig**: Ein Agent-Session für alle Räume mit geteiltem Kontext
- Built-in templates: Yes/No, Confirm/Cancel, OK, Multi-Choice
- Custom buttons with emoji labels: `✅Ja`, `❌Nein`, `🟡Später`
- Structured payloads: `question_id::choice` — the agent always knows what you clicked
- REST-first: native buttons always tried first; text fallback only on HTTP error
### 🧭 Smart Room Routing (Archivar v3)
The agent understands **where messages belong**, not just what category they are.
- **3-stage classifier:** Keyword → Embedding → LLM (optional)
- **Bidirectional routing:** Messages flow between rooms, but answers always stay where you asked
- **Move-Requests with buttons:** When a task belongs elsewhere, you get clickable options — not text prompts
- **Sticky rooms:** Tell the agent "always stay here" and it remembers
- **Catch-All room:** Nothing gets lost — unclassified messages land in a designated fallback
### 🆕 Auto-Onboarding
Add the bot to a new room and it introduces itself, asks for a room name and topic, and configures routing automatically. No manual config files.
### 📚 Knowledge Integration
Pure facts and documentation are automatically saved to your Obsidian Vault — not dumped in chat rooms. Your morning `StartObsidian` routine processes them into themed documents.
### 📎 File Attachments
Upload files to rooms, download files users attach, browse room file lists — all with native Rocket.Chat rendering.
### 🌐 Multi-Room, One Memory
The agent maintains a single context across all rooms. Knowledge from `#devops` is available in `#general`. You never have to re-explain.
---
## Features
| Feature | Beschreibung |
|---------|-------------|
| 🚀 Echtzeit-Streaming | DDP/WebSocket für instant eingehende Nachrichten |
| 🟢 Präsenz | Grüner Online-Status im Rocket.Chat |
| 🌐 Multi-Room | Ein Agent über alle Räume — Kanäle, Gruppen, DMs. Geteilter Kontext, kein Kontext-Verlust beim Raumwechsel |
| 🧭 Smart Room Routing | Der Agent lernt beim ersten Start, welche Themen in welchen Raum gehören. Kein manuelles Konfigurieren — ein kurzes Interview, danach landet alles automatisch am richtigen Ort |
| ✍️ Markdown | Fett, kursiv, `Code`, Blöcke, Links |
| 🔘 Interaktive Buttons | Ja/Nein, Bestätigen/Abbrechen, Mehrfachauswahl |
| 🔌 7 REST-Tools | `rocketchat_rooms`, `rocketchat_users`, `rocketchat_dm`, `rocketchat_send`, `rocketchat_upload`, `rocketchat_download`, `rocketchat_files` |
| 📎 Datei-Anhänge | Upload, Download, Datei-Listing — nativ im Rocket.Chat gerendert |
| 🌍 Bilingual | Installer auf Deutsch & Englisch (`--lang de|en`), Agent erkennt Systemsprache automatisch |
| 📦 Zero-Dependency | Nutzt ausschließlich Python-Standardbibliothek |
---
## Schnellstart
### 1. Voraussetzungen
- Hermes Agent installiert ([Setup-Guide](https://hermes-agent.nousresearch.com/docs))
- Laufender Rocket.Chat-Server (v5+ empfohlen)
- Bot-Benutzer auf Rocket.Chat mit Login-Daten
### 2. Plugin herunterladen & installieren
## Quick Start
```bash
git clone https://gitea.myowntools.org/andreas/Hermes_rocket.chat_Plugin.git
@@ -65,147 +77,94 @@ cd Hermes_rocket.chat_Plugin
./install.sh
```
Der Installer führt interaktiv durch:
- Rocket.Chat Server URL
- **Bot Username** (der Bot-Account auf dem Server)
- Bot Passwort
- Home Channel (Name oder ID)
The installer walks you through:
1. Rocket.Chat server URL
2. Bot username and password
3. Home channel
Bei bestehender Installation werden alle Werte angezeigt und können bestätigt (ENTER) oder geändert werden.
**Optionen:**
**That's it.** The gateway restarts, the bot appears online (green dot), and you can start talking.
```bash
./install.sh --help # Alle Optionen anzeigen
./install.sh --lang en # Englisch
./install.sh --lang de # Deutsch (Standard)
./install.sh --non-interactive # Batch-Mode (RC_URL, RC_BOT_USER, RC_BOT_PASS, RC_HOME_CHANNEL)
```
# Update without reconfiguring
./install.sh --update-only
### 3. Pairing
Nach der Installation gibt der Gateway einen **Pairing-Code** aus. Diesen im Home-Channel eingeben, um den Bot zu aktivieren. (Identisch zum Telegram-Integrations-Pattern.)
---
## Architektur
```
┌─────────────┐ ┌─────────────────┐
│ Hermes Agent│ Hermes Gateway │ Rocket.Chat │
│ (Plugin) │◄── DDP/WebSocket ──────►│ Server │
│ │◄── REST API ──────►│ (v5+) │
└─────────────┘ └─────────────────┘
```
**Plugin-Dateien:**
| Datei | Größe | Funktion |
|-------|-------|----------|
| `plugin/adapter.py` | ~27 KB | DDP-Client, Session-Handling, Nachrichten-Parsing, Reconnect, Button-Rendering |
| `plugin/__init__.py` | ~4,5 KB | Plugin-Registrierung, Interaction Templates |
| `plugin/tools.py` | ~43 KB | 7 Rocket.Chat REST-Tools für Agent-Kontext |
| `plugin/plugin.yaml` | 0,8 KB | Metadaten, Env-Vars |
---
## Button-Templates
| Template | Nutzung |
|----------|---------|
| `yes_no` | ✅ Ja / ❌ Nein |
| `confirm_cancel` | ✅ Bestätigen / 🚫 Abbrechen |
| `ok` | 👍 OK |
| `multi_choice_3` | 1. Links / 2. Rechts / 3. Zwei Runden |
| `custom` | Beliebige Labels via `custom_buttons` |
**Button-Label-Regeln:**
- Desktop-App schneidet bei **~5–7 Zeichen** ab
- **NIEMALS Underscores (`_`)** in Button-Texten — zerstört Rendering
- Leerzeichen sind erlaubt: `1. Links`
- Pattern: Lange Optionen im Text, Buttons mit Kurzreferenz (`1. Links`, `2. Rechts`)
Details: [docs/BUTTON_GUIDE.md](docs/BUTTON_GUIDE.md)
---
## Konfiguration (Referenz)
`install.sh` schreibt automatisch. Manuelle Referenz:
```yaml
# ~/.hermes/config.yaml
plugins:
enabled:
- rocketchat-platform
gateway:
platforms:
rocketchat:
enabled: true
extra:
base_url: "https://rocketchat.example.com"
home_channel:
platform: rocketchat
chat_id: "69f4e..."
name: "ki-assistent"
toolsets:
- rocketchat
```
```bash
# ~/.config/hermes/rocketchat.env (chmod 600)
ROCKETCHAT_BASE_URL=https://rocketchat.example.com
ROCKETCHAT_USER=botuser
ROCKETCHAT_PASSWORD=...
ROCKETCHAT_ALLOW_ALL_USERS=true
GATEWAY_ALLOW_ALL_USERS=true
# Non-interactive (CI/CD, scripts)
./install.sh --non-interactive
```
---
## Aktueller Status
## Requirements
- **Version**: 2.3.0
- **Stabilität**: Produktiv im Einsatz (seit Mai 2026)
- **Getestet mit**: Rocket.Chat v5.x, Hermes Agent Gateway
- **Lizenz**: [Unlicense](LICENSE) — Public Domain
- **Hermes Agent** installed and running
- **Self-hosted Rocket.Chat** (v5+)
- A **bot user account** on your Rocket.Chat server
- Python 3.10+ (comes with Hermes)
**Optional but recommended:**
- `nomic-embed-text` via Ollama — enables embedding-based room routing
- `qwen2.5:7b` via Ollama — enables LLM-based routing for borderline cases
---
## Changelog
## Why This Exists
### v2.3.0 (30. Mai 2026)
- **Attachment-Tools:** `rocketchat_upload`, `rocketchat_download`, `rocketchat_files`
- **Upload-Fix:** 2-Step-Flow für RC 8.4.1 — `rooms.media` + `chat.postMessage` mit `title_link`
- **DDP-Adapter:** Erkennt eingehende Attachments automatisch (`file`/`attachments` im Event)
Hermes Agent is powerful — but the CLI isn't where conversations happen. Teams live in Rocket.Chat. This plugin brings your AI assistant to where you already are.
### v2.2.0 (30. Mai 2026)
- **Room Topic Discipline:** Agent trennt Inhalte strikt nach Raum-Thema
- **Catch-All-Raum:** Interaktive Erstinitialisierung bei >1 Raum
**Use cases:**
- **DevOps team:** Ask the agent for container status, deploy fixes, check logs — from your team channel
- **Personal assistant:** Morning briefing (`StartObsidian`), knowledge capture, task routing
- **Project management:** Multi-room coordination — the agent knows what's happening across all project channels
- **Self-hosted everything:** No cloud dependencies. Your agent, your chat server, your data.
### v2.1.0 (29. Mai 2026)
- **Cross-Room Session Sharing:** Ein Agent über alle Räume, gemeinsamer Kontext. Zero Core Changes — rein plugin-basiert
---
### v2.0.0 (Mai 2026)
- Gateway-natives Plugin (kein Standalone-Daemon mehr)
- `tools.py`: 4 Rocket.Chat REST-Tools für Agent-Kontext
- Neuer bilingualer `install.sh` (DE/EN, `--help`, `--non-interactive`, Re-Install-Erkennung)
- "Bot Username"-Prompt statt "Username"
- `BasePlatformAdapter`-Vererbung, DDP `added`-Events, case-insensitive Filter
## Current Status
### v1.0.0 (Mai 2026)
- Initialer Standalone-Daemon-Release
**Active development — production-ready core, expanding features.**
| Feature | Status |
|---------|--------|
| Real-time DDP messaging | ✅ Stable |
| 7 REST API tools | ✅ Stable |
| Interactive buttons | ✅ Stable |
| Button-Garantie | ✅ Enforced |
| Archivar v3 room routing | ✅ Deployed |
| Auto-onboarding | ✅ Stable |
| FAKT → Obsidian Vault | ✅ Stable |
| File upload/download/list | ✅ Stable |
| `install.sh` one-click setup | ✅ Stable |
**In progress:** `install.sh` deployment path alignment, button verification tests.
---
## Links
- **Hermes Agent**: https://hermes-agent.nousresearch.com/
- **Rocket.Chat**: https://www.rocket.chat/
- **Dieses Repo**: https://gitea.myowntools.org/andreas/Hermes_rocket.chat_Plugin
- **Repository:** [gitea.myowntools.org/andreas/Hermes_rocket.chat_Plugin](https://gitea.myowntools.org/andreas/Hermes_rocket.chat_Plugin)
- **Hermes Agent:** [github.com/NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent)
- **Rocket.Chat:** [rocket.chat](https://rocket.chat)
- **License:** Public Domain (Unlicense)
---
> *Erstellt von der Hermes Agent Community — für die Rocket.Chat Community.*
## FAQ
**Q: Does this work with Rocket.Chat SaaS (cloud.rocket.chat)?**
A: It's designed for self-hosted instances. SaaS may work but hasn't been tested — the plugin needs WebSocket/DDP access which SaaS tiers may restrict.
**Q: Can multiple users talk to the same bot?**
A: Yes — the bot listens in all subscribed rooms. One agent session handles all users. Each user's rooms are collapsed into a virtual `user:username` session so the agent maintains per-user context.
**Q: Does the bot need admin permissions?**
A: No. A regular user with `bot` role is sufficient. The bot needs `create-d`, `create-p`, and `upload-file` permissions (standard for bot role).
**Q: What happens if the gateway restarts?**
A: The bot reconnects automatically. Sticky room preferences are in-memory (reset on restart). The room-map.json persists. There's a known Discovery Bug where Rocket.Chat may not reconnect after SIGTERM — workaround is clearing state files before restart.
**Q: Is this an official Nous Research product?**
A: No — it's a community plugin maintained independently. Public Domain license.
---
*Built with ❤️ for the self-hosting community. Zero external dependencies. Pure Python + WebSocket.*