Hermes Agent 심층 분석 (2026): 자기 학습 오픈소스 AI 에이전트

💡 5분 요약: Nous Research가 2026년 2월에 공개한 자기 학습 AI 에이전트. 매 대화 종료 후 백그라운드에서 메모리·스킬을 자동 갱신하는 닫힌 학습 루프, SQLite + FTS5 기반 영구 메모리, 20개 이상의 메시징 플랫폼을 단일 게이트웨이로 통합한 게 특징. MIT 라이선스 · Python 3.11+ · GitHub 95.6K+ 스타.

Hermes Agent 심층 분석 — 자기 학습 오픈소스 AI 에이전트


Hermes Agent란 무엇인가

Hermes Agent 공식 배너

Hermes Agent는 Nous Research가 만든 자기 학습(self-improving) AI 에이전트다. 다른 에이전트 프레임워크와의 결정적 차이는 단 한 가지 — “에이전트가 스스로 학습 데이터를 만들고, 스킬을 만들고, 메모리를 정리하는 닫힌 루프(closed learning loop)”가 코드 레벨에서 진짜로 구현되어 있다는 것이다.

공식 README의 첫 줄이 이를 단호하게 정의한다:

“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.”

마케팅 문구처럼 들리지만 실제로 저장소를 들여다 보면 이게 진짜다. agent/background_review.py, agent/curator.py, hermes_state.py에 학습 루프, 큐레이터, SQLite + FTS5 영구 메모리가 모두 실제 코드로 존재한다.


핵심 차별점 6가지

# 포인트 설명
1 빌트인 학습 루프 매 턴 종료 후 daemon 스레드가 fork되어 메모리·스킬을 자동 갱신
2 영구 메모리 SQLite WAL + FTS5 + 트라이그램 FTS(CJK 검색까지)
3 29개 LLM 프로바이더 Anthropic·OpenAI·Gemini·xAI·Kimi·Qwen·DeepSeek·OpenRouter… /model 한 명령 전환
4 20+ 메시징 플랫폼 Telegram·Discord·Slack·WhatsApp·Signal·WeChat·DingTalk·Feishu… 단일 게이트웨이
5 7개 실행 환경 local·docker·ssh·modal·daytona·singularity·vercel_sandbox 통일 인터페이스
6 오픈 표준 호환 agentskills.io · MCP(양방향) · ACP(Zed/VS Code/JetBrains)

주요 기능

1) 인터랙티브 CLI / TUI

hermes              # 인터랙티브 CLI 시작
hermes model        # LLM 프로바이더/모델 선택
hermes gateway      # 메시징 게이트웨이 시작
hermes dashboard    # 브라우저 대시보드 (xterm.js + React)
hermes setup        # 풀 셋업 위저드
hermes doctor       # 진단
  • prompt_toolkit 기반 멀티라인 편집, 슬래시 명령 자동완성, 인터럽트-앤-리디렉트
  • hermes --tuiInk(React) 풀 TUI — Python tui_gateway 백엔드와 stdio JSON-RPC 통신
  • KawaiiSpinner 애니메이션 + 활동 피드로 tool 진행 상황 표시
  • Skin 엔진으로 배너 색·스피너 얼굴·tool prefix 커스터마이즈

2) 메시징 자동화 (20+ 플랫폼)

그룹 플랫폼
메인스트림 Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Mattermost
이메일·SMS·웹훅 Email, SMS, Webhook, API Server, MS Graph Webhook
중국 생태계 DingTalk, Feishu, WeCom, WeiXin, Yuanbao, QQ Bot
기타 BlueBubbles(iMessage), Home Assistant

hermes gateway start 한 번으로 전부 기동. 음성 메모 전사(Faster Whisper/ElevenLabs), 크로스 플랫폼 대화 연속성, DM pairing 인증 모두 빌트인.

3) 자기 학습 4단계 루프

  1. 턴 종료 후 백그라운드 리뷰daemon 스레드로 fork된 AIAgent가 대화를 보고 _MEMORY_REVIEW_PROMPT_SKILL_REVIEW_PROMPT로 갱신 결정
  2. 스킬 자동 생성/갱신skill_manage 도구로 직접 생성, 보안 스캔 후 ~/.hermes/skills/로 저장
  3. 큐레이터 — 7일마다 inactivity-triggered, 30일 미사용 → stale, 90일 → archive
  4. FTS5 세션 검색 — 과거 모든 세션 풀텍스트/트라이그램(CJK) 검색으로 cross-session recall

4) 빌트인 자동화 / 스케줄링

  • 크론 스케줄러 — 게이트웨이가 60초마다 tick() 호출
  • 자연어 스케줄"every 1h"부터 표준 crontab까지
  • 결과 라우팅--deliver telegram, --deliver sms:+15551234567, --deliver telegram:-1001234567890:42(특정 forum topic)
  • [SILENT] 패턴 — 스크립트가 [SILENT] 반환 시 알림 안 보냄

5) R&D — 학습 데이터 생성기

도구 역할 분량
batch_runner.py JSONL 데이터셋 → 멀티프로세싱 → ShareGPT 트라젝토리 1,321 LOC
trajectory_compressor.py 첫 turn + 마지막 N turn 보호 + 중간 요약 압축 1,508 LOC
mini_swe_runner.py SWE-bench 평가 러너 1,008 LOC

코드 구조 분석

hermes-agent/
├── agent/              # 두뇌 — conversation_loop · 메모리 · 큐레이터 · 백그라운드 리뷰
├── gateway/            # run.py 18,273 LOC + 20여 platforms/
├── hermes_state.py     # SessionDB (SQLite + FTS5) — 3,279 LOC
├── plugins/
│   ├── model-providers/    # 29개 LLM 어댑터
│   ├── memory/             # 8개 메모리 백엔드 (honcho, mem0, supermemory…)
│   ├── context_engine/
│   └── kanban/             # 멀티에이전트 보드
├── skills/             # 빌트인 89개 SKILL.md (+ optional 81개)
├── tools/environments/ # 7개 실행 백엔드
└── website/            # 343개 docs (mdx/md)
메트릭
총 Python 파일 1,830
총 테스트 파일 1,165
빌트인 스킬 89 (+ optional 81)
모델 프로바이더 29
메시징 플랫폼 20+
터미널 환경 백엔드 7
website 문서 343 mdx/md

에이전트 루프 — 코드로 보기

코어 루프는 agent/conversation_loop.py:232run_conversation() — 단일 함수 약 4,000줄로 구현되어 있다. 핵심 사이클을 압축하면:

while (api_call_count < agent.max_iterations
       and agent.iteration_budget.remaining > 0) \
      or agent._budget_grace_call:
    # 1) 인터럽트 우선 처리
    if agent._interrupt_requested:
        break

    # 2) 예산 + grace_call ("한 번 더 줄게")
    if not agent.iteration_budget.consume():
        break

    # 3) 사용자 /steer 인플라이트 가이드 드레인
    _pre_api_steer = agent._drain_pending_steer()

    # 4) 방어적 sanitize (깨진 tool_call args, 잘못된 role alternation 자가 수리)
    agent._sanitize_tool_call_arguments(messages, ...)
    agent._repair_message_sequence(messages)

    # 5) 시스템 프롬프트 + 메모리 prefetch + 플러그인 컨텍스트 합성
    api_messages = build_with_ephemeral_injection(...)

    # 6) provider별 어댑터로 API 호출
    response = client.chat.completions.create(
        model=model, messages=api_messages, tools=tool_schemas
    )

    # 7) tool_calls가 있으면 dispatch, 없으면 break
    if response.tool_calls:
        execute_tool_calls_concurrent(...)
    else:
        break

# 8) post-loop: 메모리 sync + 백그라운드 리뷰 스레드 포크
agent._sync_external_memory_for_turn(...)
if _should_review_memory or _should_review_skills:
    agent._spawn_background_review(messages_snapshot=list(messages), ...)

이 30-50줄 안에 Hermes의 디자인 철학이 다 들어있다 — 인터럽트 우선, 예산 + 자비(grace_call), 인플라이트 사용자 가이드, 매번 자가 sanitize, post-loop 학습 트리거.

영구 메모리의 production-grade 디테일

hermes_state.py의 SessionDB는 단순한 SQLite 래퍼가 아니다:

def _execute_write(self, fn):
    """BEGIN IMMEDIATE + jitter retry — SQLite의 결정적 backoff convoy 회피"""
    for attempt in range(15):  # _WRITE_MAX_RETRIES
        try:
            with self._lock:
                self._conn.execute("BEGIN IMMEDIATE")
                result = fn(self._conn)
                self._conn.commit()
            return result
        except sqlite3.OperationalError as exc:
            if "locked" in str(exc).lower():
                time.sleep(random.uniform(0.020, 0.150))  # 20-150ms 지터
                continue
            raise

여러 hermes 프로세스(gateway + CLI + worktree)가 한 state.db를 공유할 때 SQLite 기본 busy handler의 deterministic backoff가 만드는 convoy 효과를 application 레벨 jitter로 해결한 production lesson이 코드 + 주석에 함께 박혀있다.

Hermes Agent의 SQLite 동시성 방어 인포그래픽

추가로:
WAL 모드 + NFS/SMB fallback — WAL이 NFS에서 깨지면 journal_mode=DELETE로 폴백
두 개의 FTS5 인덱스messages_fts(일반) + messages_fts_trigram(한·중·일 substring)
세션 lineageparent_session_id로 압축 시 부모-자식 자동 체인


장점

⭕ S1. 자기 학습이 실제로 코드에 있다

“메모리가 있다”는 광고는 흔하지만, Hermes는 백그라운드 review 스레드 + 큐레이터 + FTS5 인덱스가 모두 코드에 존재. 단순히 “요약 텍스트를 어딘가 저장”이 아님.

⭕ S2. 모델 락인 0

29개 프로바이더 × 3가지 API 모드(chat_completions / codex_responses / anthropic_messages) native adapter. /model nous:hermes-4-405b 한 명령으로 런타임 전환.

⭕ S3. 멀티 플랫폼 메시징의 압도적 폭

중국 생태계(WeChat/DingTalk/Feishu/Yuanbao)까지 포함된 건 거의 유일.

⭕ S4. 서버리스 배포로 비용 거의 0

Modal/Daytona는 “유휴 시 hibernate, 호출 시 wake” — 진정한 의미의 serverless agent.

⭕ S5. 오픈 표준 호환 (벤더 lock-in 없음)

agentskills.io SKILL.md · MCP 양방향 · ACP — 모두 진정한 의미의 오픈 표준.

⭕ S6. Production-hardened 디테일

  • 정확 핀(==X.Y.Z) 의존성 + 공급망 공격 대응 주석(mistral 사건 대응)
  • 1,165 테스트 파일 · per-file 격리 · signal-based 30s timeout
  • 343개 docs + AGENTS.md(54KB) + CONTRIBUTING.md(45KB) + SECURITY.md(15KB)

단점과 한계

❌ L1. 메가파일 다수

gateway/run.py 18,273 LOC, cli.py 14,775 LOC, agent/conversation_loop.py 4,193 LOC. AIAgent.__init__은 약 60개 파라미터. 학습 곡선이 가파르다.

❌ L2. Windows 네이티브는 README가 직접 “early beta” 명시

WSL2를 “가장 battle-tested 경로”로 권고. 대시보드 chat pane은 POSIX PTY를 쓰므로 native Windows 불가.

❌ L3. 단일 테넌트 못 박음

SECURITY.md가 첫 줄부터 “Hermes Agent is a single-tenant personal agent.” 멀티 user SaaS로 띄우면 가정이 깨진다.

❌ L4. In-process 보안 가드는 모두 heuristic

SECURITY.md가 명시: “The only security boundary against an adversarial LLM is the operating system.” — approval/redact/allowlist는 모두 LLM 출력 매칭 기반, 우회 가능.

❌ L5. 외부 메모리 프로바이더 1개만 허용 (코드 레벨)

MemoryManager.add_provider는 builtin 외에 단 하나의 external만 허용. 두 번째는 reject.

❌ L6. 설정 표면 폭발적

28 toolset × 29 provider × 7 환경 × 20 platform × 9 memory backend. hermes doctor만 91KB.


누구에게 추천하는가

✅ 적합

  • 자기 인프라에서 LLM 에이전트를 굴리고 싶은 개인 개발자 — $5 VPS, Raspberry Pi, GPU 노드 어디든 동일 코어
  • 모델 비용 최적화 팀 — model-per-task 전략 (일상은 DeepSeek, 야간은 Sonnet, deploy 검증은 GPT…)
  • LLM tool-calling 모델 R&D팀batch_runner + trajectory_compressor로 SFT/RL 학습 데이터 생성
  • 메시징 자동화 운영팀 — 크론 + 웹훅 + GitHub 이벤트가 빌트인
  • MCP/ACP 생태계 사용자 — VS Code/Zed/JetBrains에서 native ACP agent
  • Linux/macOS/WSL2 사용자 — 가장 battle-tested 경로

⚠️ 피해야 할 경우

  • 멀티 테넌트 SaaS로 직접 띄우려는 팀
  • Windows 네이티브를 1급 시민으로 써야 하는 환경
  • Enterprise compliance / audit이 필수
  • 여러 메모리 백엔드 fan-out이 필요
  • “최소 학습 시간으로 prod 운영”이 우선

설치와 시작

Linux / macOS / WSL2

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
source ~/.bashrc
hermes

Windows 네이티브 (early beta)

iex (irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1)

설치 시 uv · Python 3.11 · Node.js · ripgrep · ffmpeg · portable Git Bash(MinGit)까지 자동 — sudo 권한 불필요.

Nous Portal로 API 키 수집 건너뛰기

hermes setup --portal

OAuth 한 번으로 300+ 모델 + Tool Gateway(웹 검색·이미지 생성·TTS·클라우드 브라우저) 모두 활성화.


결론

Hermes Agent는 “내 인프라에서, 내 모델로, 내가 정의한 학습 루프를 돌리는” 단일 테넌트 개인용 에이전트의 reference implementation으로 매우 강력하다. 메시징·자동화·R&D 워크플로우를 한 코어로 묶고 싶다면 최선의 선택지 중 하나지만, 멀티 테넌트나 enterprise audit이 필요하면 부적합하다.

자기 학습 루프, 영구 메모리, 멀티 플랫폼이 광고가 아니라 코드 레벨로 진짜라는 점이 다른 에이전트 프레임워크와의 결정적 차이다. 다만 1,830개 Python 파일의 거대 코드베이스라 진입 장벽이 낮지는 않다. 만약 “스스로 성장하는 AI 비서”를 자기 서버에서 굴리고 싶다면, 지금 시점에서 이만한 오픈소스 선택지는 거의 없다.


📚 참고 자료



본 문서는 2026-05-24 기준 NousResearch/hermes-agent v0.14.0 저장소를 직접 클론·정독해 작성되었습니다. 모든 코드 인용은 파일 경로:라인 형식으로 명시되어 있습니다.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다