Loading...
Loading...
Expert guide for deploying, configuring, and optimizing Hermes AI agents with multi-platform support, MCP integration, and production best practices
npx skill4agent add aradotso/hermes-skills hermes-agent-optimizationSkill by ara.so — Hermes Skills collection.
# Install Hermes (requires Node.js 18+)
npm install -g @nousresearch/hermes-agent
# Initialize config directory
hermes init
# Start interactive setup
hermes configurecurl -sSL https://raw.githubusercontent.com/OnlyTerp/hermes-optimization-guide/main/scripts/vps-bootstrap.sh | sudo bashhermes# Install dependencies
sudo apt update && sudo apt install -y nodejs npm git curl
# Install Hermes globally
npm install -g @nousresearch/hermes-agent
# Create hermes user (production)
sudo useradd -r -m -d /home/hermes -s /bin/bash hermes
# Initialize config
sudo -u hermes hermes init~/.hermes/config.yaml# Minimal working config
providers:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
default_model: claude-3-5-sonnet-20241022
gateways:
telegram:
token: ${TELEGRAM_BOT_TOKEN}
enabled: true
memory:
provider: lightrag
storage_path: ~/.hermes/memory
skills:
directory: ~/.hermes/skills
auto_load: true
security:
redact_secrets: true
approval_mode: auto~/.hermes/.env# LLM Providers
ANTHROPIC_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
GOOGLE_API_KEY=your_key_here
# Platforms
TELEGRAM_BOT_TOKEN=your_bot_token
DISCORD_BOT_TOKEN=your_discord_token
SLACK_BOT_TOKEN=xoxb-your-slack-token
# Observability
LANGFUSE_SECRET_KEY=your_langfuse_key
LANGFUSE_PUBLIC_KEY=your_public_key
LANGFUSE_HOST=https://cloud.langfuse.com
# Optional: Cost optimization
DEEPSEEK_API_KEY=your_deepseek_key
CEREBRAS_API_KEY=your_cerebras_key# Interactive TUI mode
hermes
# Headless daemon (production)
hermes daemon
# Web dashboard (runs on http://localhost:3000)
hermes dashboard
# Specific gateway only
hermes --gateway telegram
# Debug mode with verbose logging
DEBUG=hermes:* hermes daemon# Update to latest version
hermes update
# Run skill curator (grade and clean skills)
hermes curator
# Backup configuration and data
hermes backup --output ~/hermes-backup-$(date +%F).tar.gz
# Test configuration without starting
hermes validate
# List active sessions
hermes sessions list
# Clear all memory (DESTRUCTIVE)
hermes memory clear# Install service
sudo cp /path/to/templates/systemd/hermes.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable hermes
sudo systemctl start hermes
# View logs
sudo journalctl -u hermes -f
# Restart after config changes
sudo systemctl restart hermes.envconfig.yamlgateways:
telegram:
enabled: true
token: ${TELEGRAM_BOT_TOKEN}
allowed_users:
- 123456789 # Your Telegram user ID
features:
voice_enabled: true
document_upload: true
inline_mode: truegateways:
discord:
enabled: true
token: ${DISCORD_BOT_TOKEN}
command_prefix: "!"
allowed_roles:
- "AI Assistant Users"
allowed_guilds:
- "1234567890123456789"gateways:
slack:
enabled: true
bot_token: ${SLACK_BOT_TOKEN}
app_token: ${SLACK_APP_TOKEN}
signing_secret: ${SLACK_SIGNING_SECRET}
socket_mode: true# Direct CLI conversation
hermes chat "explain quantum computing"
# Pipe input
echo "summarize this" | hermes chat
# File processing
hermes chat "analyze this code" < script.pymodels:
router:
enabled: true
strategy: cost_optimized # or: balanced, performance, local_first
profiles:
cheap:
provider: cerebras
model: llama-3.3-70b
max_context: 8192
cost_per_1m_tokens: 0.60
balanced:
provider: anthropic
model: claude-3-5-haiku-20241022
max_context: 200000
cost_per_1m_tokens: 1.00
premium:
provider: anthropic
model: claude-3-5-sonnet-20241022
max_context: 200000
cost_per_1m_tokens: 3.00
local:
provider: lm_studio
model: qwen-2.5-coder-32b
endpoint: http://localhost:1234/v1
max_context: 32768
routing_rules:
- if: "token_count < 2000"
use: cheap
- if: "requires_code_execution"
use: premium
- if: "user_priority == high"
use: premium
- default: balancedproviders:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
default_model: claude-3-5-sonnet-20241022
max_tokens: 4096
temperature: 0.7providers:
openai:
api_key: ${OPENAI_API_KEY}
default_model: gpt-4o-2024-11-20
organization: ${OPENAI_ORG_ID}providers:
google:
api_key: ${GOOGLE_API_KEY}
default_model: gemini-2.0-flash-exp
safety_settings:
harassment: BLOCK_NONE
hate_speech: BLOCK_NONEproviders:
lm_studio:
endpoint: http://localhost:1234/v1
default_model: qwen-2.5-coder-32b-instruct
timeout: 300000mcp:
servers:
filesystem:
command: npx
args:
- "-y"
- "@modelcontextprotocol/server-filesystem"
- "/home/user/projects"
transport: stdio
github:
command: npx
args:
- "-y"
- "@modelcontextprotocol/server-github"
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_TOKEN}
transport: stdio
brave_search:
command: npx
args:
- "-y"
- "@modelcontextprotocol/server-brave-search"
env:
BRAVE_API_KEY: ${BRAVE_API_KEY}
transport: stdio
postgres:
command: docker
args:
- "run"
- "-i"
- "--rm"
- "mcp/postgres"
env:
DATABASE_URL: ${DATABASE_URL}
transport: stdio# List available MCP tools
hermes mcp list
# Test specific server
hermes mcp test filesystem
# Interactive MCP inspector
npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem /tmp~/.hermes/skills/---
name: example-skill
description: Does something useful
triggers:
- "how do I use example"
- "explain example tool"
dependencies:
- "example-npm-package"
---
# Example Skill
## What it does
Brief explanation.
## Usage
```bash
npm install example-npm-packageconst example = require('example-npm-package');
example.doThing();
### Installing Skills from Guide
```bash
# Clone the optimization guide
git clone https://github.com/OnlyTerp/hermes-optimization-guide.git
# Symlink all guide skills
ln -s $(pwd)/hermes-optimization-guide/skills/* ~/.hermes/skills/
# Or individual skill
ln -s $(pwd)/hermes-optimization-guide/skills/mcp-filesystem.md ~/.hermes/skills/# Run curator to grade and clean skills
hermes curator
# Curator runs automatically every 7 days by default
# Configure in config.yaml:
curator:
enabled: true
schedule: "0 3 * * 0" # Weekly Sunday 3am
grade_threshold: 6 # Archive skills below this score
review_provider: anthropic
review_model: claude-3-5-haiku-20241022tenacity:
kanban:
enabled: true
boards:
- name: development
lanes:
- todo
- in_progress
- review
- done
heartbeat_interval: 60
retry_budget: 3
checkpoints:
enabled: true
directory: ~/.hermes/checkpoints
max_size_mb: 500
pruning:
enabled: true
keep_last_n: 10User: "Add feature X to project Y and deploy"
Agent creates Kanban card → moves through lanes → reports status/goal set "Deploy the new API endpoint to production"
/goal list
/goal pause goal_abc123
/goal resume goal_abc123
/goal clear goal_abc123cron:
jobs:
- name: disk_space_check
schedule: "*/30 * * * *" # Every 30 min
command: "df -h | grep -E '9[0-9]%|100%'"
no_agent: true # Just run command, don't involve LLM
alert_on: stderr
- name: backup
schedule: "0 2 * * *" # Daily 2am
command: "hermes backup --output /backups/hermes-$(date +%F).tar.gz"
no_agent: truesecurity:
# Redact secrets in logs (default: true in v0.13+)
redact_secrets: true
# Approval modes: auto, manual, quarantine
approval_mode: manual
# Tool restrictions
tool_allowlist:
- read_file
- write_file
- execute_command
- mcp_*
tool_denylist:
- dangerous_tool
# Command execution sandbox
sandbox:
enabled: true
allowed_directories:
- /home/hermes/workspace
- /tmp/hermes
forbidden_commands:
- rm -rf /
- dd if=
- mkfs
# Rate limiting
rate_limits:
requests_per_minute: 60
tokens_per_hour: 500000
# Webhook signature verification
webhooks:
require_signatures: true
allowed_ips:
- 192.168.1.0/24gateways:
telegram:
allowed_users:
- 123456789
block_groups: true # Only allow DMs
require_authorization: truegateways:
discord:
allowed_roles:
- "Admin"
- "Developer"
allowed_guilds:
- "1234567890" # Specific server ID
reject_dms: truegateways:
webhook:
port: 3001
path: /webhook
secret: ${WEBHOOK_SECRET}
verify_signatures: true
require_api_key: true
api_keys:
- ${WEBHOOK_API_KEY_1}observability:
langfuse:
enabled: true
public_key: ${LANGFUSE_PUBLIC_KEY}
secret_key: ${LANGFUSE_SECRET_KEY}
host: https://cloud.langfuse.com
trace_all: true
capture_io: true
logging:
level: info # debug, info, warn, error
file: ~/.hermes/logs/hermes.log
max_size_mb: 100
max_files: 10observability:
prometheus:
enabled: true
port: 9090
path: /metricshermes_requests_totalhermes_tokens_usedhermes_cost_usdhermes_latency_secondshttp://localhost:3000hermes dashboard# Reinstall globally
npm uninstall -g @nousresearch/hermes-agent
npm install -g @nousresearch/hermes-agent
# Or use npx
npx @nousresearch/hermes-agent# Check token validity
curl https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getMe
# Verify webhook isn't set (conflicts with polling)
curl https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/deleteWebhook
# Check logs
DEBUG=hermes:telegram hermes daemon# Test server directly
npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem /tmp
# Check permissions
ls -la ~/.hermes/mcp-servers/
# Verify environment variables
env | grep -E 'GITHUB|BRAVE|DATABASE'# Reduce context window
providers:
anthropic:
max_tokens: 2048 # Down from 4096
# Enable context compression
memory:
compression:
enabled: true
target_tokens: 4000# Check token usage
hermes stats
# Enable cost-optimized routing
models:
router:
strategy: cost_optimized
# Use local models for simple tasks
providers:
lm_studio:
default_model: qwen-2.5-coder-32b-instruct# Verify directory
ls -la ~/.hermes/skills/
# Check skill syntax
hermes validate ~/.hermes/skills/my-skill.md
# Force reload
hermes --reload-skills# Full debug output
DEBUG=hermes:* hermes daemon
# Specific subsystems
DEBUG=hermes:telegram,hermes:mcp hermes daemon
# Save debug logs
DEBUG=hermes:* hermes daemon 2>&1 | tee debug.log# Validate config
hermes validate
# Test provider connectivity
hermes test-providers
# Check MCP servers
hermes mcp list
# Verify skills
hermes skills validate-all# Use cheap models for simple tasks, premium for complex
models:
router:
enabled: true
rules:
- if: "token_count < 1000 and !contains(user_input, 'code')"
use: cerebras # $0.60/1M tokens
- if: "contains(user_input, 'write code')"
use: claude_sonnet
- if: "contains(user_input, 'analyze image')"
use: gemini_flash
- default: claude_haikugateways:
webhook:
enabled: true
port: 3001
path: /webhook
secret: ${WEBHOOK_SECRET}
handlers:
github:
events:
- push
- pull_request
action: "trigger_skill:github-pr-reviewer"
stripe:
verify_signature: true
action: "trigger_skill:payment-processor"cron:
jobs:
- name: review_prs
schedule: "0 */2 * * *" # Every 2 hours
command: "hermes chat 'Review open GitHub PRs in repo org/project'"
provider: anthropic
model: claude-3-5-sonnet-20241022
skills:
# Link github-pr-reviewer.md skillmodels:
router:
strategy: local_first
fallback_on_error: true
providers:
lm_studio:
endpoint: http://localhost:1234/v1
default_model: qwen-2.5-coder-32b-instruct
timeout: 60000
anthropic: # Fallback for complex tasks
api_key: ${ANTHROPIC_API_KEY}
default_model: claude-3-5-haiku-20241022# Send message to all platforms
hermes broadcast "System maintenance in 10 minutes"
# Platform-specific routing in config.yaml
gateways:
telegram:
broadcast_channels:
- "@myteamupdates"
discord:
broadcast_channels:
- "1234567890" # Channel ID
slack:
broadcast_channels:
- "#general"# Essential commands
hermes # Start TUI
hermes daemon # Start headless
hermes dashboard # Start web UI
hermes update # Update to latest
hermes curator # Grade skills
hermes backup # Backup data
hermes validate # Check config
# Debugging
DEBUG=hermes:* hermes daemon
hermes test-providers
hermes mcp list
hermes sessions list
# Management
systemctl restart hermes
journalctl -u hermes -f
hermes stats