UNPKG

overmind-mcp

Version:

Orchestrateur universel agents IA multi-modeles via MCP. Inclut le protocole 'Custom-Nickname' pour identifier vos agents avec des surnoms originaux (The Chaos Prophet, Shadow Sniper, etc.), l'isolation mรฉmoire (Private Memory Context) et le support pour

776 lines (620 loc) โ€ข 23.5 kB
# ๐Ÿ“ก Documentation โ€” Hermes Gateway > Gateway multi-plateforme de Hermes Agent par Nous Research > Version : 2.1+ | Derniรจre MAJ : 2026-05-30 --- ## 1. Architecture Gรฉnรฉrale ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ HERMES GATEWAY โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚Telegram โ”‚ โ”‚ Discord โ”‚ โ”‚ Slack โ”‚ โ”‚WhatsApp โ”‚ โ”‚ โ”‚ โ”‚ Adapter โ”‚ โ”‚ Adapter โ”‚ โ”‚ Adapter โ”‚ โ”‚ Adapter โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ SESSION ROUTER (state.db) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Route messages to agent sessions โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Channel โ†’ Session mapping โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Topic/Thread support โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ AGENT LOOP (run_agent.py) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข System prompt construction โ”‚ โ”‚ โ”‚ โ”‚ โ€ข LLM API calls (OpenAI format) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Tool dispatch (MCP + native) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Context compression โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ TOOL LAYER โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Terminal โ”‚ โ”‚ File I/O โ”‚ โ”‚ Browser โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Web/HTTP โ”‚ โ”‚ Cron โ”‚ โ”‚ Delegat. โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ MCP Servers (HTTP/stdio) โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ memory, discord, postgres, x, etc. โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ SERVICES ANNEXES โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Cron Scheduler (jobs.py + scheduler.py) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Curator (skill lifecycle) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Kanban (multi-agent work queue) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข TTS / STT โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### Composants clรฉs | Composant | Fichier | Rรดle | |-----------|---------|------| | Gateway runner | `gateway/run.py` | Boucle principale, dispatch messages | | Platform adapters | `gateway/platforms/*.py` | Un adapter par plateforme | | Session router | `hermes_state.py` | SQLite state.db, routing | | Agent loop | `run_agent.py` | Conversation LLM + tools | | Tool dispatch | `model_tools.py` | Appels outils natifs + MCP | | Cron scheduler | `cron/scheduler.py` | Jobs planifiรฉs | | Curator | `skills/curator.py` | Maintenance skills | --- ## 2. Plateformes Supportรฉes | Plateforme | Adapter | Auth requise | Features | |------------|---------|-------------|----------| | **Telegram** | `telegram.py` | Bot Token | Topics, DMs, groupes, inline | | **Discord** | `discord.py` | Bot Token | Embeds, threads, rรฉactions, boutons | | **Slack** | `slack.py` | Bot Token + Signing Secret | Channels, DMs, threads | | **WhatsApp** | `whatsapp.py` | WhatsApp Business API | Messages, mรฉdias | | **Signal** | `signal.py` | signal-cli | Messages, groupes | | **Email** | `email.py` | IMAP/SMTP | Envoi/rรฉception, piรจces jointes | | **SMS** | `sms.py` | Twilio / Vonage | Envoi/rรฉception SMS | | **Matrix** | `matrix.py` | Homeserver + Token | Rooms, DMs | | **Mattermost** | `mattermost.py` | Bot Token | Channels, DMs | | **Home Assistant** | `homeassistant.py` | HA Webhook | Intentions, contrรดle | | **DingTalk** | `dingtalk.py` | App Key/Secret | Messages, groupes | | **Feishu (Lark)** | `feishu.py` | App ID/Secret | Messages, docs | | **WeCom** | `wecom.py` | Corp ID + Secret | Messages | | **BlueBubbles** | `bluebubbles.py` | BB Server URL | iMessage | | **Weixin (WeChat)** | `weixin.py` | App ID/Secret | Messages | | **API Server** | `api_server.py` | Clรฉ API custom | REST endpoint | | **Webhooks** | `webhook.py` | Route config | POST entrants | | **Open WebUI** | via API Server | Clรฉ API | Interface web | ### Configuration plateforme ```bash # Setup interactif hermes gateway setup # Ou รฉdition manuelle hermes config edit ``` Exemple config Discord : ```yaml discord: bot_token: ${DISCORD_BOT_TOKEN} enabled: true prefix: "!" allowed_channels: [] # vide = tous ``` --- ## 3. Commandes CLI Gateway ```bash # Dรฉmarrer le gateway (foreground) hermes gateway run # Installer comme service systรจme hermes gateway install # Contrรดle du service hermes gateway start hermes gateway stop hermes gateway restart # ร‰tat du gateway hermes gateway status # Configuration initiale hermes gateway setup ``` ### Options avancรฉes ```bash # Lancer avec un profil spรฉcifique hermes gateway run --profile sniper # Mode verbose (debug) hermes gateway run --verbose # Port custom pour API server hermes gateway run --port 8080 ``` --- ## 4. Configuration (config.yaml) ### Sections pertinentes pour le gateway ```yaml # === MODรˆLE === model: default: glm-5.2 provider: z-ai context_length: 128000 # === AGENT === agent: max_turns: 90 tool_use_enforcement: true # Oblige ร  utiliser les outils # === TERMINAL === terminal: backend: local # local, docker, ssh timeout: 180 # === COMPRESSION === compression: enabled: true threshold: 0.50 # Dรฉclenche ร  50% du context target_ratio: 0.20 # Cible 20% du context # === TTS === tts: provider: elevenlabs voice: charlie voice_id: IKne3meq5aSn9XLyUdCD model: eleven_multilingual_v2 # === STT === stt: enabled: true provider: local # local, groq, openai, mistral local: model: base # === Mร‰MOIRE === memory: memory_enabled: true user_profile_enabled: true provider: built-in # built-in, honcho, mem0 # === Sร‰CURITร‰ === security: redact_secrets: false tirith_enabled: true website_blocklist: [] # === APPROBATIONS === approvals: mode: manual # manual, smart, off # === MCP === mcp_servers: memory-server: url: "http://localhost:3099/mcp" discord-server: url: "http://localhost:3141/mcp" # === Dร‰Lร‰GATION === delegation: max_concurrent_children: 3 max_spawn_depth: 1 # === CRON === # Gรฉrรฉ via l'outil cronjob, pas de config yaml directe # === CANVAS === display: skin: default tool_progress: true show_reasoning: false show_cost: false ``` --- ## 5. Slash Commands (Mode Gateway) ### Contrรดle de session ``` /new (/reset) Nouvelle session /clear Effacer + nouvelle session /retry Renvoyer dernier message /undo Annuler dernier รฉchange /title [name] Nommer la session /compress Compression manuelle du contexte /stop Tuer processus en arriรจre-plan /rollback [N] Restaurer checkpoint filesystem ``` ### Configuration ``` /config Afficher config /model [name] Changer de modรจle /personality [name] Changer personnalitรฉ /reasoning [level] Niveau de raisonnement (noneโ†’xhigh) /verbose Cycle verbose /voice [on|off|tts] Mode vocal /yolo Bypass approbations /status Info session ``` ### Outils & Skills ``` /tools Gรฉrer outils (CLI) /skills Installer skills /skill <name> Charger un skill /reload Recharger .env /reload-mcp Recharger serveurs MCP /cron Gรฉrer cron jobs ``` ### Gateway ``` /approve Approuver commande en attente /deny Refuser commande /restart Redรฉmarrer gateway /sethome Dรฉfinir canal home /update MAJ Hermes /platforms Statut plateformes ``` ### Info ``` /help Aide /commands Lister toutes les commandes /usage Utilisation tokens /insights [days] Analytics /debug Upload rapport debug /profile Info profil actif ``` --- ## 6. Cron Jobs ### Fonctionnement ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ CRON SCHEDULER โ”‚ โ”‚ โ”œโ”€โ”€ cron/jobs.py โ†’ Stockage jobs โ”‚ โ”‚ โ”œโ”€โ”€ cron/scheduler.py โ†’ Tick loop โ”‚ โ”‚ โ””โ”€โ”€ .tick.lock โ†’ Anti-doublon โ”‚ โ”‚ โ”‚ โ”‚ CHAQUE TICK : โ”‚ โ”‚ 1. Vรฉrifie .tick.lock โ”‚ โ”‚ 2. Charge jobs actifs โ”‚ โ”‚ 3. Pour chaque job รฉligible : โ”‚ โ”‚ โ†’ Nouvelle session fraรฎche โ”‚ โ”‚ โ†’ Injecte le prompt โ”‚ โ”‚ โ†’ Exรฉcute l'agent โ”‚ โ”‚ โ†’ Dรฉlivre le rรฉsultat โ”‚ โ”‚ โ†’ Dรฉtruit la session โ”‚ โ”‚ 4. Libรจre .tick.lock โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### Syntaxe de planification | Format | Exemple | Signification | |--------|---------|---------------| | Durรฉe | `30m` | Toutes les 30 minutes | | Every | `every 2h` | Toutes les 2 heures | | Every day | `every monday 9am` | Chaque lundi ร  9h | | Cron | `0 9 * * *` | Tous les jours ร  9h | | ISO timestamp | `2026-06-01T10:00:00` | Une seule fois | ### Options par job ```python cronjob( action="create", name="analyse_crypto", # Nom unique schedule="every 2h", # Planification prompt="Analyse BTC...", # Prompt auto-suffisant skills=["web", "terminal"], # Skills ร  charger deliver="origin", # Livraison (origin, all, platform:chat:thread) model={"model": "glm-5.2"}, # Override modรจle workdir="/path/to/project", # Rรฉpertoire de travail enabled_toolsets=["web", "terminal", "file"], # Restreindre outils context_from=["job_id_abc"], # Chaรฎner avec sortie d'un autre job script="collect_data.sh", # Script pre-run (data collection) no_agent=False, # True = script seul, pas d'agent repeat=None, # None = rรฉcurrent, int = nombre de runs ) ``` ### Invariants cron - **Timeout hard** : 3 minutes par run - **skip_memory=True** par dรฉfaut (pas de mรฉmoire auto) - **Pas de cron en chaรฎne** : un cron ne peut pas crรฉer d'autres cron - **Lock file** empรชche doubles ticks - **Session fraรฎche** ร  chaque tick (pas d'injection dans session active) --- ## 7. Intรฉgration MCP ### Architecture MCP dans le gateway ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AGENT SESSION โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ Outils natifs (terminal, file...) โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ MCP Servers โ”‚ โ”‚ โ”œโ”€โ”€ HTTP Stream โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ memory-server :3099 โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ discord-server :3141 โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ x-mcp-server :3142 โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ postgresql-server :5433 โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ stdio (si configurรฉ) โ”‚ โ”‚ โ””โ”€โ”€ custom-command --mcp โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### Configuration MCP **3 niveaux par agent :** 1. **`.mcp.json`** โ€” Dรฉclare les serveurs disponibles ```json { "mcpServers": { "memory-server": { "type": "http", "url": "http://localhost:3099/mcp" } } } ``` 2. **`settings.json`** โ€” Active/filtre les serveurs ```json { "enabledMcpjsonServers": ["memory-server", "discord-server"], "enableAllProjectMcpServers": false } ``` 3. **`config.yaml`** โ€” Gateway runtime ```yaml mcp_servers: memory-server: url: "http://localhost:3099/mcp" ``` ### Rechargement MCP ``` /reload-mcp # Recharger sans restart /restart # Restart complet du gateway ``` --- ## 8. Sรฉcuritรฉ ### Redaction des secrets ```bash # Masquer les API keys dans le context hermes config set security.redact_secrets true # Dรฉsactiver hermes config set security.redact_secrets false ``` โš ๏ธ **Restart requis** โ€” ne prend pas effet mid-session. ### Redaction PII ```bash # Hasher les user IDs, strip numรฉros de tรฉlรฉphone hermes config set privacy.redact_pii true ``` ### Modes d'approbation | Mode | Comportement | |------|-------------| | `manual` | Prompt avant chaque commande risquรฉe (dรฉfaut) | | `smart` | LLM auxiliaire auto-approuve les commandes safe | | `off` | Bypass total (รฉquivalent `--yolo`) | ```bash hermes config set approvals.mode smart ``` ### Allowlist shell hooks Fichier : `~/.hermes/shell-hooks-allowlist.json` Premiรจre exรฉcution d'un hook โ†’ prompt interactif. --- ## 9. Gestion des Sessions ### Architecture ``` ~/.hermes/ โ”œโ”€โ”€ state.db # Session store (SQLite + FTS5) โ”œโ”€โ”€ sessions/ โ”‚ โ”œโ”€โ”€ routing.json # Channel โ†’ Session mapping โ”‚ โ””โ”€โ”€ *.jsonl # Transcripts (optionnel) โ””โ”€โ”€ logs/ โ””โ”€โ”€ gateway.log # Logs gateway ``` ### Cycle de vie ``` Message entrant โ”‚ โ”œโ”€โ”€ Canal connu ? โ†’ Router vers session existante โ”‚ โ”œโ”€โ”€ Topic/Thread ? โ†’ Sous-session โ”‚ โ””โ”€โ”€ Canal principal โ†’ Session principale โ”‚ โ””โ”€โ”€ Nouveau canal โ†’ Crรฉer nouvelle session โ”œโ”€โ”€ Charger config agent โ”œโ”€โ”€ Initialiser outils + MCP โ””โ”€โ”€ Dรฉmarrer boucle agent ``` ### Commandes session ```bash hermes sessions list # Lister sessions rรฉcentes hermes sessions browse # Picker interactif hermes sessions export OUT # Exporter en JSONL hermes sessions rename ID T # Renommer hermes sessions delete ID # Supprimer hermes sessions prune # Nettoyer vieilles sessions hermes sessions stats # Statistiques du store ``` --- ## 10. Webhooks ### Configuration ```bash # Crรฉer une route webhook hermes webhook subscribe myhook # โ†’ Crรฉe /webhooks/myhook # Lister hermes webhook list # Supprimer hermes webhook remove myhook # Test hermes webhook test myhook ``` ### Payload entrant ```json POST /webhooks/myhook { "message": "Analyse le marchรฉ BTC", "source": "external_app", "metadata": { "priority": "high" } } ``` Le gateway traite le payload comme un message utilisateur normal. --- ## 11. Profils ### Concept Les profils permettent de faire tourner plusieurs instances Hermes isolรฉes : ``` ~/.hermes/ # Profil default ~/.hermes/profiles/ โ”œโ”€โ”€ sniper/ # Profil sniper โ”‚ โ”œโ”€โ”€ config.yaml โ”‚ โ”œโ”€โ”€ .env โ”‚ โ”œโ”€โ”€ skills/ โ”‚ โ””โ”€โ”€ sessions/ โ””โ”€โ”€ researcher/ # Profil researcher โ”œโ”€โ”€ config.yaml โ””โ”€โ”€ ... ``` ### Commandes ```bash hermes profile list # Lister profils hermes profile create sniper # Crรฉer (--clone, --clone-all) hermes profile use sniper # Dรฉfinir comme dรฉfaut hermes profile show sniper # Dรฉtails hermes profile delete sniper # Supprimer hermes profile rename A B # Renommer hermes profile export sniper # Export tar.gz hermes profile import file.tar.gz # Importer ``` ### Lancer avec un profil ```bash hermes --profile sniper hermes gateway run --profile sniper ``` --- ## 12. Credential Pools Rotation automatique des clรฉs API pour รฉviter les rate limits. ```bash hermes auth add # Ajouter credential (wizard) hermes auth list [PROVIDER] # Lister credentials hermes auth remove P INDEX # Supprimer par provider + index hermes auth reset PROVIDER # Reset exhaustion status ``` ### Comportement - Hermes essaie KEY_1 โ†’ si 429/401 โ†’ KEY_2 โ†’ si 429 โ†’ KEY_3 - Marque les clรฉs รฉpuisรฉes, les rรฉessaie aprรจs cooldown - Configurรฉ dans `.env` avec clรฉs numรฉrotรฉes --- ## 13. TTS / STT en Gateway ### TTS (Text โ†’ Voice) | Provider | Variable | Coรปt | |----------|----------|------| | Edge TTS | Aucune | Gratuit (dรฉfaut) | | ElevenLabs | `ELEVENLABS_API_KEY` | Freemium | | OpenAI | `VOICE_TOOLS_OPENAI_KEY` | Payant | | MiniMax | `MINIMAX_API_KEY` | Payant | | Mistral | `MISTRAL_API_KEY` | Payant | Commandes : ``` /voice on # Voice-to-voice /voice tts # Toujours voice /voice off # Dรฉsactiver ``` ### STT (Voice โ†’ Text) Transcription automatique des messages vocaux entrants. | Provider | Variable | Coรปt | |----------|----------|------| | Local faster-whisper | Aucune | Gratuit | | Groq Whisper | `GROQ_API_KEY` | Freemium | | OpenAI Whisper | `VOICE_TOOLS_OPENAI_KEY` | Payant | | Mistral Voxtral | `MISTRAL_API_KEY` | Payant | --- ## 14. Troubleshooting ### Gateway ne dรฉmarre pas ```bash hermes doctor # Diagnostic complet hermes gateway status # ร‰tat du service cat ~/.hermes/logs/gateway.log | tail -50 ``` ### Bot Discord silencieux 1. Vรฉrifier le **Message Content Intent** dans Discord Developer Portal 2. Vรฉrifier `discord.bot_token` dans config 3. Tester : `hermes gateway status` ### Bot Telegram silencieux 1. Vรฉrifier `telegram.bot_token` 2. Tester : `curl https://api.telegram.org/bot<TOKEN>/getMe` ### Gateway meurt aprรจs SSH logout ```bash sudo loginctl enable-linger $USER ``` ### Gateway crash loop (systemd) ```bash systemctl --user reset-failed hermes-gateway hermes gateway restart ``` ### Outils MCP non disponibles ```bash hermes mcp list # Voir serveurs configurรฉs hermes mcp test NAME # Tester connexion /reload-mcp # Recharger en session ``` ### Modรจle auxiliaire (vision, compression) ne fonctionne pas ```bash hermes config set auxiliary.vision.provider openrouter hermes config set auxiliary.vision.model anthropic/claude-sonnet-4 ``` ### Memory non persistante ```bash hermes memory status # ร‰tat du provider mรฉmoire hermes config set memory.memory_enabled true ``` --- ## 15. Variables d'Environnement (.env) Fichier : `~/.hermes/.env` ```bash # === PROVIDERS === OPENROUTER_API_KEY=sk-or-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_API_KEY=AIza... DEEPSEEK_API_KEY=sk-... XAI_API_KEY=xai-... GLM_API_KEY=xxx.zai... MINIMAX_API_KEY=xxx ELEVENLABS_API_KEY=sk_... # === CREDENTIAL POOL === OPENROUTER_API_KEY_2=sk-or-... OPENROUTER_API_KEY_3=sk-or-... # === PLATEFORMES === DISCORD_BOT_TOKEN=MTk... TELEGRAM_BOT_TOKEN=123456:ABC... SLACK_BOT_TOKEN=xoxb-... TWILIO_ACCOUNT_SID=AC... TWILIO_AUTH_TOKEN=... # === MCP === POSTGRES_CONNECTION_STRING=postgresql://... ``` --- ## 16. Chemins Importants | Chemin | Contenu | |--------|---------| | `~/.hermes/config.yaml` | Configuration principale | | `~/.hermes/.env` | Secrets et clรฉs API | | `~/.hermes/skills/` | Skills installรฉs | | `~/.hermes/sessions/` | Routing + transcripts | | `~/.hermes/state.db` | Session store SQLite | | `~/.hermes/logs/` | Logs gateway | | `~/.hermes/auth.json` | OAuth + credential pools | | `~/.hermes/hermes-agent/` | Code source | | `~/.hermes/shell-hooks-allowlist.json` | Allowlist hooks | --- ## 17. Flux de Message Complet ``` 1. Utilisateur envoie message sur Discord โ”‚ 2. Discord Adapter reรงoit via Gateway Intent โ”‚ 3. Session Router lookup (channel_id โ†’ session_id) โ”‚ โ”œโ”€โ”€ Session existe โ†’ Continue conversation โ””โ”€โ”€ Nouvelle session โ†’ Crรฉe session fraรฎche โ”‚ 4. Construction du system prompt โ”œโ”€โ”€ Config agent (model, tools, persona) โ”œโ”€โ”€ Memory injectรฉe (user profile + memory notes) โ”œโ”€โ”€ Skills chargรฉs โ””โ”€โ”€ MCP tools dรฉcouverts โ”‚ 5. Appel LLM (OpenAI format) โ”‚ 6. Si tool_calls โ†’ Dispatch via model_tools.py โ”œโ”€โ”€ Outils natifs (terminal, file, web...) โ””โ”€โ”€ MCP tools (HTTP request au serveur MCP) โ”‚ 7. Rรฉsultat outil โ†’ Ajoutรฉ au context โ†’ Retour รฉtape 5 โ”‚ 8. Rรฉponse texte finale โ”‚ 9. Gateway envoie via Platform Adapter โ”œโ”€โ”€ Texte simple โ†’ Message texte โ”œโ”€โ”€ Structurรฉ โ†’ Embed Discord / HTML Telegram โ”œโ”€โ”€ Mรฉdia โ†’ Upload fichier โ””โ”€โ”€ TTS โ†’ Audio + transcription โ”‚ 10. Logs + mรฉtriques mis ร  jour ``` --- *Documentation gรฉnรฉrรฉe par SniperBot Analyst โ€” Overmind Ecosystem* *Source : Hermes Agent v2.1+ by Nous Research*