GitHub - ahlfs/hermes-agent: Custom fork of Hermes Agent configured as the intelligence engine for LAM-Cyberlab, featuring an automated Second Brain and Autonomous Self-Learning pipeline · GitHub
Skip to content
 
 

Latest commit

 

History

17,826 Commits

Folders and files

Repository files navigation

Hermes Agent

Hermes Agent - Second Brain Edition

Hermes Agent | Hermes Desktop

Modified by Ahlfs License: MIT English Indonesia 中文 اردو Español

⚠️ CUSTOM FORK FOR LAM-CYBERLAB

This repository is a heavily modified version of Hermes Agent by Ahlfs. It is specifically designed to be fully compatible as the backend intelligence engine for LAM-Cyberlab. See the Second Brain Edition section below for details on custom features.

The self-improving AI agent built by Nous Research. It's the only agent with a built-in learning loop — it creates skills from experience, improves them during use, nudges itself to persist knowledge, searches its own past conversations, and builds a deepening model of who you are across sessions. Run it on a $5 VPS, a GPU cluster, or serverless infrastructure that costs nearly nothing when idle. It's not tied to your laptop — talk to it from Telegram while it works on a cloud VM.

Use any model you want — Nous Portal, OpenRouter, OpenAI, your own endpoint, and many others. Switch with hermes model — no code changes, no lock-in.

A real terminal interfaceFull TUI with multiline editing, slash-command autocomplete, conversation history, interrupt-and-redirect, and streaming tool output.
Lives where you doTelegram, Discord, Slack, WhatsApp, Signal, and CLI — all from a single gateway process. Voice memo transcription, cross-platform conversation continuity.
A closed learning loopAgent-curated memory with periodic nudges. Autonomous skill creation after complex tasks. Skills self-improve during use. FTS5 session search with LLM summarization for cross-session recall. Honcho dialectic user modeling. Compatible with the agentskills.io open standard.
Scheduled automationsBuilt-in cron scheduler with delivery to any platform. Daily reports, nightly backups, weekly audits — all in natural language, running unattended.
Delegates and parallelizesSpawn isolated subagents for parallel workstreams. Write Python scripts that call tools via RPC, collapsing multi-step pipelines into zero-context-cost turns.
Runs anywhere, not just your laptopSix terminal backends — local, Docker, SSH, Singularity, Modal, and Daytona. Daytona and Modal offer serverless persistence — your agent's environment hibernates when idle and wakes on demand, costing nearly nothing between sessions. Run it on a $5 VPS or a GPU cluster.
Research-readyBatch trajectory generation, trajectory compression for training the next generation of tool-calling models.

🧠 Second Brain Edition (Custom Fork)

This is a custom fork of Hermes Agent modified and maintained by Ahlfs, featuring an autonomous Second Brain pipeline and automated GitHub skills backups.

Features

  1. Automated Second Brain Pipeline
    • Audio Transcription: Drops an .mp3 into 01-Audio and Hermes automatically transcribes it using Whisper.
    • Document Parsing: Parses .pdf and performs OCR on images dropped into 02-Documents.
    • Wiki Generation: Synthesizes transcripts and documents into interlinked Wikipedia-style markdown files in 04-Wiki.
    • Git Backup: Automatically commits and pushes new knowledge to a private GitHub repository.
    • Full Source Cleanup Cascade: Safely deletes the raw source files (.mp3, .pdf, etc.) from 01-Audio and 02-Documents only after the final knowledge has been successfully backed up to GitHub, keeping your vault lean.
  2. Automated Skills Backup
    • Backs up your custom skills to a separate private GitHub repo via a scheduled cron job (default: every 24h).
  3. Dynamic Swarm Router (Intent-Based Routing)
    • Automatically intercepts and routes incoming messages to the most capable specialist sub-agent (builder, researcher, writer).
    • Uses zero-latency keyword classification to infer user intent, providing a frictionless swarm experience without manual profile switching.
  4. LAM-Cyberlab Native Integration
    • Real-time Streaming: Full support for progressive token streaming via SSE/WebSockets (stream_events.py), making it a zero-friction, plug-and-play intelligence backend for the LAM-Cyberlab UI.
    • Closed-Loop Learning: Synergizes flawlessly with the native Self-Healing Skill Generator. When faced with complex tasks from the Cyberlab UI, the agent can autonomously write, test, and save its own new .md skills for future use.
  5. Dynamic OS Memory Injection
    • Automatically detects your operating system, installed tools (Docker, PHP, Node, etc.), and sudo capabilities during setup.
    • Injects these hardware/OS facts directly into the Agent's permanent memory (MEMORY.md), completely eliminating AI hallucinations regarding your environment specifications.

Quick Install & Setup

Follow these steps to install the LAM-Cyberlab compatible version of Hermes Agent.

⚠️ WINDOWS USERS: This project heavily relies on Linux packages (like apt install ffmpeg) and Bash scripts. Git Bash or native PowerShell will not work for the Second Brain pipeline. You must install and use WSL2 (Windows Subsystem for Linux) to follow these steps.

Prerequisites

Before you begin, make sure you have the following installed on your system:

Requirement Required? Purpose Install
Git ✅ Required Clone repos, backup system Install Guide
Python 3.10+ ✅ Required Run Second Brain scripts Install Guide
curl ✅ Required Download Hermes installer Pre-installed on most systems
FFmpeg ✅ Required Audio transcription (Whisper) Install Guide
Tesseract OCR ✅ Required Image/PDF text extraction Install Guide
Obsidian ⭐ Optional Visual markdown viewer for your Second Brain Download
GitHub Account + SSH Key ⭐ Optional Automated cloud backup Guide

Note: You do not need Obsidian installed to use the Second Brain pipeline. The "Vault" is simply a folder of .md files on your disk. Any text editor (VS Code, Notepad, etc.) can read them. Obsidian is recommended for the best browsing experience with interlinked notes and graph view.

1. Install OS Dependencies

The Second Brain pipeline requires ffmpeg (for audio), tesseract-ocr (for images), and cron (for automated background backups). Run the command appropriate for your system:

Ubuntu / Debian / WSL2 (Default):

sudo apt update && sudo apt install ffmpeg tesseract-ocr cron -y
sudo systemctl enable --now cron

macOS (via Homebrew):

brew install ffmpeg tesseract
# cron is usually pre-installed on macOS

Fedora / RHEL / AlmaLinux:

sudo dnf install ffmpeg tesseract cronie -y
sudo systemctl enable --now crond

Arch Linux:

sudo pacman -S ffmpeg tesseract cronie
sudo systemctl enable --now cronie

2. Install Hermes Base & Swap to Custom Fork

First, use the official installer to set up the necessary runtimes (Node.js, uv, PATH wrapper), then replace the source code with this custom repository.

Linux / macOS / WSL2:

# Install the base environment
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

# Replace official repo with the Ahlfs custom fork
rm -rf ~/.hermes/hermes-agent
git clone https://github.com/ahlfs/hermes-agent.git ~/.hermes/hermes-agent

# Re-sync dependencies
cd ~/.hermes/hermes-agent
~/.hermes/bin/uv venv venv
~/.hermes/bin/uv pip install --python venv -e ".[all]"

Windows Native: Run iex (irm https://hermes-agent.nousresearch.com/install.ps1) in PowerShell, then delete %LOCALAPPDATA%\hermes\hermes-agent and git clone https://github.com/ahlfs/hermes-agent.git in its place.

3. Initialize Second Brain Environment

Run the setup script to create an isolated virtual environment specifically for the Second Brain tools:

cd ~/.hermes/hermes-agent
bash scripts/second-brain/setup-venv.sh

✨ NEW (Plug-and-Play): This script will now automatically initialize your Agent's persistent memory (MEMORY.md and USER.md) with highly-optimized Second Brain workflow rules AND dynamically inject your exact system environment specs (OS, Docker, PHP, sudo status) so the AI instantly understands your machine!

4. Configure Environment Variables & Auto-Backup (Optional)

If you want to enable the Auto-Backup system (synced to cloud/GitHub) to secure your custom skills and knowledge base, open your ~/.hermes/.env file and add the following settings:

# Directory of your Obsidian Vault (Second Brain)
OBSIDIAN_VAULT_DIR=/home/user/obsidian/memo

# GitHub Backup Settings
GITHUB_USERNAME=your_github_username
GITHUB_REPO_SKILLS=hermes-skills
GITHUB_REPO_SECONDBRAIN=second-brain

5. Setup GitHub Repositories & SSH Keys (Optional)

To allow the agent to automatically push backups in the background:

  1. Create 2 empty Private repositories on GitHub (e.g., second-brain and hermes-skills).
  2. Generate an SSH key on your VPS: ssh-keygen -t ed25519 -C "your_email@example.com"
  3. Display the public key with cat ~/.ssh/id_ed25519.pub and add it to your GitHub account (Settings > SSH and GPG keys > New SSH key).

6. Initialize Data Structures & First Sync

Let Hermes automatically build the empty folder structures and initialize the Git repositories. Run the sync scripts manually for the first time:

cd ~/.hermes/hermes-agent
bash scripts/second-brain/sync-second-brain.sh
bash scripts/second-brain/sync-skills.sh

(After this completes, you will find your 01-Audio, 02-Documents, etc. folders ready in the Vault, and your custom skills will be synced).

7. Automating the Sync & Daily Reflection (Cron Job) (Optional)

To make your VPS automatically sync and backup your Second Brain (every 12 hours), Custom Skills (every 24 hours), and execute Daily Reflection & Journaling (daily at 00:05) in the background, simply run the installation script:

cd ~/.hermes/hermes-agent
bash scripts/second-brain/install-cron.sh

8. Start Using It!

Reload your shell and start the agent:

source ~/.bashrc    # reload shell (or: source ~/.zshrc)
hermes              # start chatting!

9. Teaching Your Second Brain (Ingesting Knowledge)

To provide your agent with new knowledge (meeting recordings, books, research papers, etc.), simply place the raw files into your designated Obsidian Vault directory (OBSIDIAN_VAULT_DIR):

  1. Audio Files (.mp3, .m4a, .wav): Move them into the 01-Audio/ folder.
  2. Documents & Images (.pdf, .png, .jpg): Move them into the 02-Documents/ folder.

What happens next?

  • The agent automatically detects new files and runs the ingestion pipeline in the background. You can also force this manually by telling the agent: "Learn from my new files in the vault."
  • Audio is transcribed via Whisper; Documents and Images are parsed and OCR-ed.
  • The extracted information is synthesized into Wikipedia-style interconnected .md pages in your 04-Wiki/ folder.
  • Auto-Cleanup: Once the knowledge has been successfully converted into Wiki pages and safely backed up to your GitHub repository, the agent's Full Source Cleanup Cascade kicks in. It will automatically delete the large raw source files (.mp3, .pdf, etc.) from your 01-Audio and 02-Documents folders to keep your server lightweight.

Troubleshooting

Windows Defender or antivirus flags uv.exe as malware

If your antivirus (Bitdefender, Windows Defender, etc.) quarantines uv.exe from the Hermes bin folder (%LOCALAPPDATA%\hermes\bin\uv.exe), this is a false positive. The file is Astral's uv — the Rust Python package manager Hermes bundles to manage its Python environment. ML-based antivirus engines commonly flag unsigned Rust binaries that download and install packages.

To verify your copy is authentic:

# Install GitHub CLI if needed
winget install --id GitHub.cli

# Login to GitHub
gh auth login

# Run verification
$uv = "$env:LOCALAPPDATA\hermes\bin\uv.exe"
$ver = (& $uv --version).Split(' ')[1]
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$zip = "$env:TEMP\uv.zip"
Invoke-WebRequest "https://github.com/astral-sh/uv/releases/download/$ver/uv-x86_64-pc-windows-msvc.zip" -OutFile $zip -UseBasicParsing
gh attestation verify $zip --repo astral-sh/uv
Expand-Archive $zip "$env:TEMP\uv_x" -Force
(Get-FileHash "$env:TEMP\uv_x\uv.exe").Hash -eq (Get-FileHash $uv).Hash

If attestation says "Verification succeeded" and the last line prints True, you're good.

To whitelist Hermes:

  • Windows Defender: Run PowerShell as Admin → Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\hermes\bin"
  • Bitdefender: Add an exception in the Bitdefender console (Protection > Antivirus > Settings > Manage Exceptions)
  • Whitelist the folder, not the file hash — Hermes updates uv and the hash changes every version

For more context, see the upstream Astral reports: astral-sh/uv#13553, astral-sh/uv#15011, astral-sh/uv#10079.


Getting Started

hermes              # Interactive CLI — start a conversation
hermes model        # Choose your LLM provider and model
hermes tools        # Configure which tools are enabled
hermes config set   # Set individual config values
hermes config get   # Print individual config values
hermes gateway      # Start the messaging gateway (Telegram, Discord, etc.)
hermes setup        # Run the full setup wizard (configures everything at once)
hermes claw migrate # Migrate from OpenClaw (if coming from OpenClaw)
hermes update       # Update to the latest version
hermes doctor       # Diagnose any issues

📖 Full documentation →


Skip the API-key collection — Nous Portal

Hermes works with whatever provider you want — that's not changing. But if you'd rather not collect five separate API keys for the model, web search, image generation, TTS, and a cloud browser, Nous Portal covers all of them under one subscription:

  • 300+ models — pick any of them with /model <name>
  • Tool Gateway — web search (Firecrawl), image generation (FAL), text-to-speech (OpenAI), cloud browser (Browser Use), all routed through your sub. No extra accounts.

One command from a fresh install:

hermes setup --portal

That logs you in via OAuth, sets Nous as your provider, and turns on the Tool Gateway. Check what's wired up any time with hermes portal info. Full details on the Tool Gateway docs page.

You can still bring your own keys per-tool whenever you want — the gateway is per-backend, not all-or-nothing.


CLI vs Messaging Quick Reference

Hermes has two entry points: start the terminal UI with hermes, or run the gateway and talk to it from Telegram, Discord, Slack, WhatsApp, Signal, or Email. Once you're in a conversation, many slash commands are shared across both interfaces.

Action CLI Messaging platforms
Start chatting hermes Run hermes gateway setup + hermes gateway start, then send the bot a message
Start fresh conversation /new or /reset /new or /reset
Change model /model [provider:model] /model [provider:model]
Set a personality /personality [name] /personality [name]
Retry or undo the last turn /retry, /undo /retry, /undo
Compress context / check usage /compress, /usage, /insights [--days N] /compress, /usage, /insights [days]
Browse skills /skills or /<skill-name> /<skill-name>
Interrupt current work Ctrl+C or send a new message /stop or send a new message
Platform-specific status /platforms /status, /sethome

For the full command lists, see the CLI guide and the Messaging Gateway guide.


Documentation

All documentation lives at hermes-agent.nousresearch.com/docs:

Section What's Covered
Quickstart Install → setup → first conversation in 2 minutes
CLI Usage Commands, keybindings, personalities, sessions
Configuration Config file, providers, models, all options
Messaging Gateway Telegram, Discord, Slack, WhatsApp, Signal, Home Assistant
Security Command approval, DM pairing, container isolation
Tools & Toolsets 40+ tools, toolset system, terminal backends
Skills System Procedural memory, Skills Hub, creating skills
Memory Persistent memory, user profiles, best practices
MCP Integration Connect any MCP server for extended capabilities
Cron Scheduling Scheduled tasks with platform delivery
Context Files Project context that shapes every conversation
Architecture Project structure, agent loop, key classes
Contributing Development setup, PR process, code style
CLI Reference All commands and flags
Environment Variables Complete env var reference

Migrating from OpenClaw

If you're coming from OpenClaw, Hermes can automatically import your settings, memories, skills, and API keys.

During first-time setup: The setup wizard (hermes setup) automatically detects ~/.openclaw and offers to migrate before configuration begins.

Anytime after install:

hermes claw migrate              # Interactive migration (full preset)
hermes claw migrate --dry-run    # Preview what would be migrated
hermes claw migrate --preset user-data   # Migrate without secrets
hermes claw migrate --overwrite  # Overwrite existing conflicts

What gets imported:

  • SOUL.md — persona file
  • Memories — MEMORY.md and USER.md entries
  • Skills — user-created skills → ~/.hermes/skills/openclaw-imports/
  • Command allowlist — approval patterns
  • Messaging settings — platform configs, allowed users, working directory
  • API keys — allowlisted secrets (Telegram, OpenRouter, OpenAI, Anthropic, ElevenLabs)
  • TTS assets — workspace audio files
  • Workspace instructions — AGENTS.md (with --workspace-target)

See hermes claw migrate --help for all options, or use the openclaw-migration skill for an interactive agent-guided migration with dry-run previews.


Contributing

We welcome contributions! See the Contributing Guide for development setup, code style, and PR process.

Quick start for contributors — use the standard installer, then work from the full git checkout it creates at $HERMES_HOME/hermes-agent (usually ~/.hermes/hermes-agent). This matches the layout used by hermes update, the managed venv, lazy dependencies, gateway, and docs tooling.

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent"
uv pip install -e ".[all,dev]"
scripts/run_tests.sh

Manual clone fallback (for throwaway clones/CI where you intentionally do not want the managed install layout):

Create the venv outside the cloned source tree — a venv inside the directory the agent operates from can be wiped by a relative-path command the agent runs against its own checkout, destroying the running runtime mid-session.

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv ~/.hermes/venvs/hermes-dev --python 3.11
source ~/.hermes/venvs/hermes-dev/bin/activate
uv pip install -e ".[all,dev]"
scripts/run_tests.sh

Community

  • 💬 Discord
  • 📚 Skills Hub
  • 🐛 Issues
  • 🔌 computer-use-linux — Linux desktop-control MCP server for Hermes and other MCP hosts, with AT-SPI accessibility trees, Wayland/X11 input, screenshots, and compositor window targeting.
  • 🔌 HermesClaw — Community WeChat bridge: Run Hermes Agent and OpenClaw on the same WeChat account.

License

MIT — see LICENSE.

Built by Nous Research.

About

Custom fork of Hermes Agent configured as the intelligence engine for LAM-Cyberlab, featuring an automated Second Brain and Autonomous Self-Learning pipeline

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages