Hermes Desktop

repository·main·Indexed 12 days ago

https://github.com/fathah/hermes-desktop

A native desktop application for installing, configuring, and interacting with the Hermes Agent. It provides a GUI for managing AI agent workflows, including chat with 22 slash commands, memory, tool use, and multi-platform messaging. Supports local and remote modes, a wide range of LLM providers (OpenRouter, Anthropic, OpenAI, Ollama, etc.), and secure secret management via a command provider. Version 0.7.4 includes support for MCP servers, skill management, and per-conversation context folders.

Tokens
79.8K
Snippets
166
Records
371
Agent score
96%

What's inside Hermes Desktop

  1. Overview of Hermes Desktop features

    main

    Hermes Desktop is a native desktop application designed to manage, configure, and chat with Hermes Agent. It provides a GUI for managing the CLI-based Hermes environment, including installation, provider setup, and daily usage.

    Key Capabilities:

    • Guided Installation: Automates Hermes Agent installation and dependency resolution (Git, uv, Python 3.11+).
    • Local & Remote Modes: Run Hermes locally on 127.0.0.1:8642 or connect to a remote Hermes API server via URL and API key.
    • Multi-Provider Support: Connect to OpenRouter, Anthropic, OpenAI, Google (Gemini), xAI (Grok), Nous Portal, Qwen, MiniMax, Hugging Face, Groq, or local OpenAI-compatible endpoints (LM Studio, Ollama, vLLM, llama.cpp).
    • Advanced Chat UI: Supports SSE streaming, tool progress indicators, Markdown rendering, and syntax highlighting.
    • Slash Commands: Over 20 commands available (e.g., /usage, /tools, /model, /memory, /persona).
    • Session & Profile Management: Full-text search (SQLite FTS5) for history and isolated environments via Profiles.
    • Toolsets & Memory: Access to 14 toolsets (Web, Browser, Terminal, etc.) and integration with various memory providers (Honcho, Mem0, etc.).
    • Messaging Gateways: Connect to 16 platforms including Telegram, Discord, Slack, WhatsApp, and more.
    • Scheduling: A cron job builder for tasks ranging from minute-by-minute to weekly intervals.
  2. Current Kanban Implementation in hermes-desktop

    main

    The current hermes-desktop implementation is split between the Main process and the Renderer process.

    Main Process (src/main/kanban.ts) Capabilities: Executes hermes kanban (local) or sshRunKanban (remote). It exposes: listBoards, currentBoard, switchBoard, createBoard, removeBoard, listTasks, getTask, createTask, assignTask, completeTask, blockTask, unblockTask, archiveTask, specifyTask, reclaimTask, commentTask, listClaw3dHqTasks, dispatchOnce.

    Renderer Process (Kanban.tsx) Capabilities:

    • Columns: triage, todo, ready, running, blocked, done.
    • Polling: Updates every 6 seconds.
    • Features: Board switcher, Claw3D HQ virtual board (read-only), create-task/create-board modals, and a read-only detail modal.
    • Card Actions: specify, mark-done, reclaim, unblock, block, archive.
    • Drag-drop transitions: →done, →blocked (from todo/ready/running), and blocked→ready.
  3. Understand the Hermes Desktop interface

    main

    Hermes Desktop provides several specialized screens for managing agentic workflows:

    • Chat: Streaming conversation UI with support for slash commands, tool progress, and token tracking.
    • Sessions: Browse, search, and resume past conversations.
    • Agents: Create, delete, and switch between Hermes profiles.
    • Skills: View, install, and manage bundled or installed skills.
    • Models: Manage model settings saved per provider.
    • Memory: View/edit memory entries and user profiles; configure memory providers.
    • Soul: Edit the active profile's persona via SOUL.md.
    • Tools: Enable or disable individual toolsets.
    • Schedules: Create and manage cron jobs with specified delivery destinations.
    • Gateway: Configure and control messaging platform integrations.
    • Office: Set up and manage the Claw3d visual interface.
    • Settings: Manage provider settings, credential pools, backups/imports, log viewer, network, and themes.
  4. How collapsible code blocks work in Agent messages

    main

    To prevent large file dumps from burying conversation history, long fenced code blocks in agent messages are automatically collapsed behind a "Show more" / "Show less" toggle.

    A code block is considered "long" and subject to collapsing if it meets either of these criteria:

    • Exceeds 15 lines
    • Exceeds 800 characters
  5. Manage Hermes configuration files

    main

    Hermes manages its data and configuration in the ~/.hermes directory. Key files and folders include:

    • ~/.hermes/.env: Environment variables.
    • ~/.hermes/config.yaml: Main configuration.
    • ~/.hermes/hermes-agent: The core agent binary/files.
    • ~/.hermes/profiles/: Directories for named profiles.
    • ~/.hermes/state.db: SQLite database for session history.
    • ~/.hermes/cron/jobs.json: Scheduled tasks configuration.
  6. How Chat Reconciliation works (Dashboard vs HTTP)

    main

    Hermes Desktop manages chat state through two primary transport methods:

    1. HTTP Transport (Legacy/Fallback): Uses database polling. It is prone to issues where DB rows only appear upon finalization, and content-key reconciliation can occasionally misplace local errors or split text. It does not support reliable live tool results or live reasoning streaming for all providers.

    2. Dashboard/WebSocket Transport (Modern): Uses a live JSON-RPC stream. It implements an Ordered Turn Timeline where events (message.delta, tool.start, etc.) are processed into an active-turn state machine. This ensures that reasoning, tool calls, and prose are rendered in the correct sequence. Once a turn is complete, the state is hydrated from the database to ensure persistence.

  7. Reconcile streamed text with final responses

    main

    To prevent tool-call metadata or intermediate reasoning from clobbering the final user-facing text, the desktop performs a reconciliation step on message.complete.

    Reconciliation Logic

    The system compares the text streamed via message.delta with the final_response using mergeStreamedWithFinal. It uses the following rules:

    1. Containment: If the final text contains the streamed text, use the final text. If the streamed text contains the final text (preserving pre-tool-call content), keep the streamed text.
    2. Lossy Stream Detection: If the stream is identified as a "lossy chunk-dropped copy" (using isLossyChunkCopy), the system replaces the garbled stream with the clean final_response.
    3. Boundary Stitching: When merging a re-streamed boundary, it drops duplicated word-aligned seams.
    4. Convergence: If a mangled stream (e.g., corrupted CJK) ends with the same substantial suffix as the final text, the system replaces the stream with the final text.
    5. Fallback: If none of the above apply, it concatenates the two segments with a blank-line separator.

    Note: On remote/SSH paths where renderAssistantDeltas: false, the bubble starts empty and the final text is used verbatim.

  8. Understand SSH dashboard vs. Gateway transports

    main

    When using SSH mode, the desktop connects to a remote machine using one of two distinct transport methods depending on what is available on the remote:

    1. Dashboard Transport (Preferred):

      • Purpose: Serves the model library, session lists (/api/*), and chat via WebSocket (/api/ws).
      • Port: Typically 9119 (or a dynamic port stored in HERMES_DESKTOP_DASHBOARD_PORT).
      • Authentication: Uses a HERMES_DASHBOARD_SESSION_TOKEN found in the remote .env.
      • Requirement: Requires a web distribution (Node/web dist) to be built on the remote.
    2. Gateway /v1 Transport (Fallback):

      • Purpose: A "no-build" transport used when the dashboard is unavailable or the remote is a gateway-only install.
      • Port: 8642.
      • Authentication: Uses an API_SERVER_KEY found in the remote .env.
      • Capabilities: Serves /v1 chat endpoints (/v1/chat/completions, /v1/responses, /v1/runs) and /health.

    Important: The dashboard is not a superset of the /v1 API. The gateway api_server does not proxy /v1 routes to the dashboard, and the dashboard provides surfaces (like the model library) that the gateway does not.

  9. Known limitations of SSH Tunnel mode

    main

    The following features are currently limited or behave differently in SSH Tunnel mode:

    • Kanban: The Kanban screen is not yet supported for remote/SSH mode. The UI will explicitly indicate that remote support is coming in a future update.
    • Office (Claw3D): The Office screen detects Claw3D on your local desktop host, not the remote VPS. If you want to use the Office service running on your VPS, access it directly at http://<vps>:3000.
  10. Understand the slash command routing pipeline

    main

    Every slash command is classified into a discriminated union with a target that determines how it is handled:

    • desktop: Local UI actions or information displays (e.g., /settings, /new, /clear). These are handled by the Electron/renderer and do not send prompts upstream. Pure UI actions (flagged uiAction: true) suppress the echoed user bubble.
    • agent: Commands that are forwarded upstream to the gateway via JSON-RPC.
    • model: Commands (including Agent send/skill directives) that pass through a specific preparation layer before entering the standard chat transport. This is the only route allowed to submit model content.

    Attachment Guard: Commands that route content upstream (agent or model) are gated and will be rejected if run with staged attachments unless they explicitly declare supportsAttachments. desktop commands are exempt from this guard.

  11. Understand the Office 3D Traffic simulation

    main

    The Office 3D Traffic system provides a deterministic backdrop of vehicles (cars and trucks) looping on city roads within the Office tab.

    Key behaviors:

    • Lifecycle: The TrafficLayer is only mounted in the city view. Entering a building interior unmounts the layer, pausing the simulation and draw calls. It resumes from the last state upon exiting.
    • Deterministic Generation: Traffic is generated using fixed seeds via makeTraffic. Every load produces the same fleet, tints, and starting positions.
    • Road Network: The simulation uses 8 two-way roads. Configuration for ROADS, ROAD_WIDTH, and TRAFFIC_LEN is sourced from src/renderer/src/screens/Office/office3d/core/cityPlan.ts.
    • Collision Avoidance: Vehicles follow the car ahead in their lane, yield at junctions, and avoid pedestrians/players.