Skip to main content
Nous Research /

Hermes Agent

A self-improving AI coding agent designed for iterative software tasks, with persistent workspace state across sessions.

Coding Agents
Versionlatest
Python3.11
EnvironmentPython (uv)
GPUOptional
Securely deploy Hermes Agent on Laboratory OS.

Hermes Agent

Laboratory OS Installation Details

Environment

Git Repohttps://github.com/nousresearch/hermes-agent
Working Directory/workspace/hermes-agent
Python3.11
Env Manageruv

Environment Variables

APP_DIRECTORY
/workspace/hermes-agent
EXECUTABLE_PATH
${APP_DIRECTORY}/.hermes/venv/bin/hermes
HERMES_HOMEHermes config and state directory. Set under /workspace for persistence.
${APP_DIRECTORY}/.hermes
OPENAI_BASE_URLBase URL for your custom local/server OpenAI-compatible endpoint.
OPENAI_API_KEYAPI key for your custom endpoint (can be a dummy non-empty value for local servers).
HERMES_MODELModel ID served by your custom endpoint.

Install & Run

install-and-run.sh
#!/bin/bash
set -e

export PATH="/opt/conda/bin:/root/.local/bin:$PATH"

# Clone the GitHub repository into the directory when needed
mkdir -p "/workspace/hermes-agent"
if [ -d "/workspace/hermes-agent/.git" ]; then
  echo "Git repository already initialized in /workspace/hermes-agent"
elif [ -z "$(ls -A "/workspace/hermes-agent" 2>/dev/null)" ]; then
  git clone --progress "https://github.com/nousresearch/hermes-agent" "/workspace/hermes-agent"
else
  echo "Working directory /workspace/hermes-agent already exists and is not a git repository."
  echo "Leaving existing files untouched and skipping clone of https://github.com/nousresearch/hermes-agent."
fi
  
# Change to the app directory
cd "/workspace/hermes-agent"

# Install the requested Python version and create a virtual environment when needed
uv python install 3.11
if [ ! -d ".venv" ]; then
  uv venv --seed --python 3.11 .venv
else
  echo "Virtual environment already exists at /workspace/hermes-agent/.venv"
fi

# Activate the virtual environment
source .venv/bin/activate


# Environment setup complete
echo "Environment setup complete!"

# Step 1: Download to temp file
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh > /tmp/hermes_install.sh

# Step 2: Make it executable and run with the flag
chmod +x /tmp/hermes_install.sh
/tmp/hermes_install.sh --skip-setup --dir $APP_DIRECTORY/.hermes
rm /tmp/hermes_install.sh

# Step 3: Write config if endpoint is set (model and api_key are optional)
if [ -n "$OPENAI_BASE_URL" ]; then
  mkdir -p "$HERMES_HOME"
  {
    echo "model:"
    echo "  provider: custom"
    echo "  base_url: $OPENAI_BASE_URL"
    [ -n "$HERMES_MODEL" ] && echo "  default: $HERMES_MODEL"
    [ -n "$OPENAI_API_KEY" ] && echo "  api_key: $OPENAI_API_KEY"
  } > "$HERMES_HOME/config.yaml"
fi

CLI Command

cli.sh
# Hermes Agent
exec hermes $OPENLAB_EXTRA_ARGS

# Model Selection
exec hermes model $OPENLAB_EXTRA_ARGS