Skip to content

🤖 Nous Research Hermes Agent: Official Git Local Installation

Welcome to the Official Nous Research Hermes Agent Native Local Installation Tutorial. This guide walks you through cloning the official public repository, compiling its dependencies natively inside your conda environment, and integrating it with your local PostgreSQL pgvector memory store.

All active development is located in your Linux VM workspace:
📁 Linux Workspace Path: ~/AI_BOOTCAMP/labs/hermes-agent


🗺️ Official System Architecture


🧭 Step-by-Step Official Installation Pathway

📁 1. Backup Custom Code and Clone the Official Repo

We will clean up the temporary workspace folder, clone the official git repository directly, and set up our native folders:

  1. Open your Linux Terminal and navigate to the labs directory:
    bash
    conda activate ai_dev
    cd ~/AI_BOOTCAMP/labs
  2. Move our custom code to a backup folder to avoid losing it:
    bash
    mv hermes-agent hermes-agent-custom-backup
  3. Clone the official Nous Research Hermes Agent repository:
    bash
    git clone https://github.com/NousResearch/hermes-agent.git hermes-agent
    cd hermes-agent

📦 2. Compile Dependencies Natively using uv

Rather than running in Docker, we will install the repository directly as an editable Python package inside your ai_dev conda environment:

  1. Verify your active conda environment:
    bash
    conda activate ai_dev
  2. Execute the editable package installation using your fast uv compiler:
    bash
    uv pip install -e .
    Note: This command reads the repository's setup.py / pyproject.toml file, fetches all official dependencies, compiles them instantly in milliseconds, and links the local files directly to your environment.

🗄️ 3. Configure Local pgvector Database Connections

Ensure your local PostgreSQL service is running and configured:

  1. Verify local PostgreSQL status:

    bash
    pg-status
    # If database is offline, start it:
    pg-start
  2. Setup your environment variables: Create a .env file in the root of ~/AI_BOOTCAMP/labs/hermes-agent:

    Path: ~/AI_BOOTCAMP/labs/hermes-agent/.env

    text
    # LLM Provider Credentials
    LLM_PROVIDER=gemini
    GEMINI_API_KEY=your_gemini_api_key_here
    
    # Database memory URL connecting pgvector
    MEMORY_DB_URL=postgresql://hermes_admin:YOUR_DB_PASSWORD@127.0.0.1:5432/hermes_vault

🚀 4. Run the Setup Wizard & Start Chatting Natively!

With the dependencies compiled and database configured, you can run the official CLI commands:

  1. Initialize the setup wizard: This parses your tools and compiles folders:
    bash
    hermes setup
  2. Select your primary active LLM:
    bash
    hermes model
    # (Select Gemini or input custom parameters)
  3. Start chatting with your agent natively: Simply execute hermes in your shell to start the persistent cognitive loop:
    bash
    hermes

💡 Helpful Code Samples & Custom Skills

When Hermes compiles new tools, it saves them directly inside the ./skills/ directory of the cloned repository. You can inspect, modify, or add custom Python files to teach it new skills natively.

📊 A. Custom Skill: Writing CSV Spreadsheets

Teach your agent to construct corporate reports locally:

Path: ~/AI_BOOTCAMP/labs/hermes-agent/skills/generate_csv_report.py

python
import csv
import os

def execute(filename: str, sales_data: list) -> str:
    """
    Autonomously creates a CSV sales report inside the data directory.
    - filename: Name of target file (e.g. q1_report)
    - sales_data: List of dicts [{"Product": "A", "Units": 10, "Revenue": 500}]
    """
    target_dir = "~/AI_BOOTCAMP/labs/hermes-agent/data"
    os.makedirs(target_dir, exist_ok=True)
    file_path = os.path.join(target_dir, f"{filename}.csv")
    
    headers = ["Product", "Units", "Revenue"]
    
    with open(file_path, mode="w", newline="") as f:
        writer = csv.DictWriter(f, fieldnames=headers)
        writer.writeheader()
        for row in sales_data:
            writer.writerow(row)
            
    return f"SUCCESS: CSV Sales Report written successfully to '{file_path}'"

🗄️ B. Custom Skill: Querying Local Postgres Metadata

Enable Hermes to query database schema metadata directly:

Path: ~/AI_BOOTCAMP/labs/hermes-agent/skills/query_system_db.py

python
import psycopg2

def execute(query_string: str) -> str:
    """
    Executes a read-only metadata SQL query against the system database.
    """
    conn_string = "host=127.0.0.1 port=5432 dbname=hermes_vault user=hermes_admin password=YOUR_DB_PASSWORD"
    try:
        with psycopg2.connect(conn_string) as conn:
            with conn.cursor() as cursor:
                if not query_string.strip().lower().startswith("select"):
                    return "ERROR: Only SELECT operations are allowed for safety boundaries."
                cursor.execute(query_string)
                records = cursor.fetchall()
                return f"SUCCESS: Fetched {len(records)} rows. Records: {str(records)}"
    except Exception as e:
        return f"EXCEPTION: SQL Execution failed: {str(e)}"