Hermes Agent: Configuration Files

Last updated: 2026-08-31

Configuration files are the brain control center of Hermes Agent — with the right settings, the Agent feels like an old friend who understands you; with wrong ones, it's like a new hire who doesn't know the ropes.

💡 Tip: Hermes uses YAML as its primary configuration format, supports environment variable overrides, and multi-environment switching. All settings have sensible defaults — zero-config startup works out of the box.

📋 Prerequisites: Lesson 2 — Installation

1. What You Will Learn

# Content
config.yaml complete structure
Core configuration options explained
Environment variable override mechanism
Multi-environment configuration management
Configuration validation and debugging

2. Story

(1) Pain Point: Config Changes Every Time You Switch Environments

Bob uses local models during development, switches to cloud API for deployment, and needs a different Key for testing. Every time he manually edits config files, often making mistakes or forgetting to switch back.

(2) Solution: Environment Configuration Separation

Alice solved this with environment variables and multiple config files:

BASH
# Development environment
hermes chat --env dev

# Production environment
hermes chat --env prod

# Test environment
hermes chat --env test

Bob never has to manually edit configs again.


3. config.yaml Complete Structure

YAML
# ~/.hermes/config.yaml

# ===== Agent Basic Config =====
agent:
  name: "MyHermes"
  version: "1.0.0"
  description: "My personal AI assistant"
  
  personality:
    tone: "friendly"
    verbosity: "balanced"
    language: "en"

  memory:
    enabled: true
    working_memory_limit: 50
    long_term_auto_save: true
    user_model_update: true
    honcho_endpoint: null

# ===== Model Config =====
model:
  default: "gpt-4o"
  fallback: "gpt-4o-mini"
  temperature: 0.7
  max_tokens: 4096
  timeout: 60

# ===== Skills Config =====
skills:
  auto_learn: true
  learn_threshold: 3
  custom_skills_dir: null

# ===== Tools Config =====
tools:
  enabled_categories:
    - filesystem
    - web
    - code_execution
    - vision
    - voice
    - data
  disabled_tools: []
  sandbox: true
  max_execution_time: 30

# ===== Platform Config =====
platforms:
  telegram:
    enabled: false
    token: null
  discord:
    enabled: false
    token: null
  slack:
    enabled: false
    token: null
  web:
    enabled: true
    port: 8080
  terminal:
    enabled: true

# ===== Security & Privacy =====
security:
  redact_api_keys: true
  sandbox_code: true
  allowed_paths:
    - "~/projects"
    - "~/documents"
  denied_paths:
    - "~/.ssh"
    - "~/.gnupg"

# ===== Logging =====
logging:
  level: "INFO"
  file: "~/.hermes/logs/hermes.log"
  max_size_mb: 100
  rotation: 7

# ===== Advanced =====
advanced:
  cron_enabled: true
  checkpoint_enabled: true
  delegate_enabled: true
  mcp_enabled: true
  research_mode: false

4. Core Configuration Options

(1) Agent Personality

YAML
personality:
  tone: "friendly"
  verbosity: "balanced"
  language: "en"
  custom_prompt: |
    You are my technical assistant, skilled in:
    1. React + TypeScript development
    2. Code review and optimization
    3. Technical documentation
    Respond in concise English.

(2) Memory Configuration

YAML
memory:
  working_memory_limit: 50
  long_term_auto_save: true
  user_model_update: true
  recall_on_start: true
  memory_decay: false

(3) Tool Security Boundaries

YAML
tools:
  sandbox: true
  max_execution_time: 30
  
  filesystem:
    allow_write: true
    allow_delete: false
    max_file_size: 10MB
    
  web:
    allow_requests: true
    blocked_domains:
      - "malware-site.com"
    rate_limit: 10

5. Environment Variable Override

Any config option can be overridden via environment variables. Rule: HERMES_ prefix + underscore-separated path.

BASH
# Override default model
export HERMES_MODEL_DEFAULT="gpt-4o-mini"

# Override API Key
export OPENAI_API_KEY="sk-..."

# Override memory settings
export HERMES_MEMORY_ENABLED="false"

# Override log level
export HERMES_LOGGING_LEVEL="DEBUG"

# Use .env file (recommended)
cat > ~/.hermes/.env << EOF
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
HERMES_MODEL_DEFAULT=gpt-4o
HERMES_LOGGING_LEVEL=INFO
EOF

Priority Order

CLI arguments > Environment variables > .env file > config.yaml > Defaults

6. Multi-Environment Management

BASH
# Directory structure
~/.hermes/
├── config.yaml           # Default config
├── config.dev.yaml       # Development
├── config.prod.yaml      # Production
├── config.test.yaml      # Testing
└── .env                  # Environment variables
YAML
# config.dev.yaml - Development
model:
  default: "llama3.2"
  temperature: 0.9

logging:
  level: "DEBUG"

tools:
  sandbox: false
YAML
# config.prod.yaml - Production
model:
  default: "gpt-4o"
  temperature: 0.5

logging:
  level: "WARNING"

security:
  sandbox_code: true
  redact_api_keys: true

7. Configuration Validation

BASH
# Validate config file
hermes config validate

# Show effective config
hermes config show

# Get specific config value
hermes config get model.default

# Set config value
hermes config set model.temperature 0.5

# Export config
hermes config export > backup.yaml

Try It: Customize Your Agent

BASH
hermes config set personality.tone "professional"
hermes config set personality.language "en"
hermes config set memory.working_memory_limit 100

hermes config show | head -20

hermes chat
> Hello! Your tone setting has been switched to professional mode.

❓ FAQ

Q Where is the config file?
A Default location is ~/.hermes/config.yaml. Change via HERMES_CONFIG_PATH environment variable.
Q Do I need to restart after changing config?
A Most configs hot-reload without restart. Model switching and platform configs require restart.
Q What happens if config is wrong?
A Hermes validates config on startup, reports errors with line numbers, and won't silently use incorrect settings.
Q How to backup config?
A hermes config export > backup.yaml, or directly copy ~/.hermes/config.yaml.
Q Share config across machines?
A Put config files in a Git repo, clone on each machine, and set HERMES_CONFIG_PATH to point to the repo config. Never commit API Keys!
Q How to reset to defaults?
A hermes config reset, or delete config.yaml and re-run hermes init.

📖 Summary


📝 Exercises

  1. Basic (⭐): Modify config.yaml to set your Agent name and language preference, verify it takes effect.
  2. Intermediate (⭐⭐): Create dev and prod config sets, implement one-click environment switching.
  3. Advanced (⭐⭐⭐): Design a 12-factor configuration scheme using environment variables, ensuring zero hardcoded secrets.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏