Hermes Agent: Inside Nous Research's Self-Improving Autonomous AI Harness Hermes Agent: Khám Phá Kiến Trúc Tác Tử AI Tự Tiến Hóa Của Nous Research
An architectural deep-dive into Hermes Agent by Nous Research — featuring a closed learning loop, persistent dual memory (FTS5 + Honcho), 7 execution backends, omnichannel messaging, and autonomous skill genesis. Phân tích chuyên sâu kiến trúc Hermes Agent của Nous Research — tác tử AI sở hữu vòng lặp tự học khép kín, bộ nhớ kép bền vững (FTS5 + Honcho), 7 backend thực thi, kết nối đa kênh và tự động sinh kỹ năng.
1. ☤ The Amnesia Problem in Modern AI Agents
Most modern coding and automation agents operate under a fundamentally flawed assumption: stateless transience.
When you open a terminal or IDE window, an agent spins up. It attempts to reason about your repo, downloads dependencies, hits dead ends, resolves complex edge cases, and eventually delivers a solution. But the moment you close the session or compact the context, everything it learned evaporates.
- Session Amnesia: The agent forgets how your proprietary build pipeline works, repeating the exact same trial-and-error cycle the next day.
- Static Skillsets: The agent never creates reusable procedural memory from its own successful debugging sessions.
- Laptop Tethering: Traditional agents die when your laptop closes, making background long-running operations or remote triggers impossible.
Hermes Agent, engineered by Nous Research, represents a paradigm leap: an open-source, self-improving agent harness with a closed learning loop, persistent dual memory, omnichannel access, and serverless infrastructure independence.
2. 🏗️ Hermes Agent Architectural Blueprint
Hermes Agent is built as an extensible, decoupled runtime connecting multi-modal user channels to isolated execution backends:
flowchart TD
subgraph Ingress ["Omnichannel Ingress Layer"]
TUI["Terminal TUI (Rich / Prompt-Toolkit)"]
Chat["Telegram • Discord • Slack • WhatsApp • Signal"]
Voice["Voice Memo Transcription (Whisper)"]
end
Ingress -->|Bi-directional Event Stream| Gateway["⚡ Hermes Gateway Control Plane\n(FastAPI / Asyncio RPC)"]
subgraph Core ["Intelligence & Self-Evolution Engine"]
Gateway --> Router["Model Router (Nous Portal, OpenRouter, vLLM, Ollama, Claude, GPT)"]
Router --> LearningLoop["🔄 Closed Learning Loop\n- Autonomous Skill Genesis\n- Runtime Skill Refinement\n- Trajectory Distillation"]
Router --> Scheduler["⏰ Built-in Cron Scheduler\n(Natural Language Background Automations)"]
end
subgraph MemoryLayer ["Persistent Memory Subsystem"]
Gateway --> FileMemory["Working Memory\n(MEMORY.md & USER.md)"]
Gateway --> FTS["SQLite FTS5 Semantic History\n(Full-text Trajectory Recall)"]
Gateway --> Honcho["Honcho Dialectic Engine\n(Longitudinal User Modeling)"]
end
subgraph ExecutionPlane ["7 Execution Backends"]
Gateway --> LocalExec["Local OS Sandbox"]
Gateway --> DockerExec["Isolated Docker Container"]
Gateway --> SSHExec["Remote Server (SSH / Bare-metal)"]
Gateway --> ServerlessExec["Serverless Cloud (Modal / Daytona / Vercel)"]
end
3. 🔄 The Closed Learning Loop & Autonomous Skill Genesis
The defining innovation of Hermes Agent is its Closed Learning Loop. Instead of relying purely on fixed system prompts or static tool definitions, Hermes learns from runtime experience:
| Stage | Operational Flow & Mechanism |
|---|---|
| 💡 Task Execution | Agent tackles a complex multi-step challenge in isolated sandboxes. |
| 🔍 Pattern Extraction | Upon success, extracts reusable workflow steps and edge-case guardrails. |
| 📝 Skill Generation | Automatically authors a standard SKILL.md compliant with agentskills.io. |
| 🔄 Active Refinement | Modifies and tunes existing skills when new edge cases or API updates are observed. |
| 📦 Trajectory Distillation | Compresses execution trajectories for future model fine-tuning and DPO training. |
When Hermes encounters a novel problem (e.g., configuring a complex Kubernetes ingress or debugging an esoteric C++ compiler flag), it resolves the issue and immediately synthesizes a self-contained SKILL.md in its knowledge directory. In subsequent sessions, whenever a related task appears, Hermes activates this custom skill with zero latency.
4. 🧠 Persistent Dual Memory & Dialectic User Modeling
Hermes solves agent amnesia through a three-tiered hierarchical memory architecture:
1. Working File Memory (MEMORY.md & USER.md)
MEMORY.md: Stores project-specific conventions, directory topologies, API keys locations, and build commands.USER.md: Captures the user’s communication style, preferred languages, indentation conventions, and architectural biases.
2. SQLite FTS5 Trajectory Search
Hermes stores every conversation turn and tool execution trajectory in a local SQLite database indexed with FTS5 full-text search. When you ask, “How did we fix the SSL handshake timeout three weeks ago?”, Hermes queries past trajectories, summarizes the relevant context via an LLM sub-call, and applies the proven fix instantly.
3. Honcho Dialectic Integration
For deep, longitudinal relationship modeling, Hermes natively integrates with Honcho — a dialectic memory engine that creates a living cognitive model of who you are, your goals, and your evolving preferences across months of interaction.
5. 🌐 Omnichannel Gateway & 7 Execution Backends
Unlike agents confined to a single terminal tab, Hermes runs as a standalone daemon that bridges your messaging apps to remote computing clusters:
sequenceDiagram
autonumber
actor User as Developer (Telegram on Mobile)
participant GW as Hermes Gateway Daemon
participant Engine as Model & Skill Engine
participant Backend as Modal / Daytona Cloud VM
User->>GW: "Deploy latest staging build & run smoke tests"
GW->>Engine: Parse intent + load deployment skill
Engine->>Backend: Wake hibernated serverless VM
Backend->>Backend: Execute git pull, docker build, pytest
Backend-->>Engine: Stream stdout & test logs
Engine-->>GW: Summarize test results & latency metrics
GW-->>User: Telegram notification: "✅ Staging online (0 failures, 142ms p99)"
Seven Pluggable Execution Backends:
- Local Host: Direct execution on your developer workstation.
- Docker: Ephemeral containerized sandbox with tight resource boundaries.
- SSH: Remote command dispatch to bare-metal servers or cloud instances.
- Singularity: High-Performance Computing (HPC) container execution.
- Modal: Serverless Python cloud execution with GPU acceleration.
- Daytona: Persistent dev environment that hibernates when idle to save compute costs.
- Vercel Sandbox: Ephemeral micro-VM execution for web automation.
6. 🤖 Multi-Agent ‘Bot Mode’ & Background Cron Jobs
Hermes Agent is not limited to a single assistant profile. Through Bot Mode, you can orchestrate an entire roster of specialized agents:
{
"roster": [
{
"name": "Athena",
"role": "Lead Architect & Code Reviewer",
"model": "nous-hermes-3-70b",
"skills": ["architecture-review", "security-audit"]
},
{
"name": "Vulcan",
"role": "DevOps & Infrastructure Engineer",
"model": "claude-3-7-sonnet",
"backend": "ssh-production-cluster"
}
]
}
Natural Language Cron Automation
Hermes includes a built-in background scheduler. You can instruct the agent in plain English:
“Every morning at 8:00 AM, inspect open GitHub pull requests, run the benchmark suite on Daytona, and send a bulleted summary to our Slack
#engineeringchannel.”
Hermes schedules the job internally, triggers without human intervention, and delivers the report to the designated channel.
7. 🚀 Quickstart & Installation
Hermes Agent provides single-command installers with zero configuration overhead:
Linux, macOS, & WSL2:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
hermes
Windows (Native PowerShell):
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
hermes
Note: The native Windows installer automatically configures an isolated MinGit runtime and Astral uv Python 3.11 environment with no administrator privileges required.
Switching Models On-the-Fly:
hermes model nous-portal/hermes-3-llama-3.1-405b
hermes model openrouter/anthropic/claude-3.7-sonnet
hermes model local/vllm
8. 🎯 Key Takeaways
Hermes Agent bridges the gap between toy chatbots and autonomous engineering infrastructure:
- Zero Knowledge Loss: Dual memory + FTS5 semantic recall ensures agents get smarter every single week.
- True Portability: Run on a $5 VPS, trigger from Telegram, execute on Modal or Daytona serverless VMs.
- Autonomous Evolution: Automatically authors, refines, and shares
SKILL.mdpackages across sessions.
1. ☤ Vấn Nạn Mất Trí Nhớ (Amnesia) Của Các Tác Tử AI Hiện Nay
Hầu hết các coding agent và trợ lý AI hiện đại đều mắc phải một giới hạn kiến trúc cốt tử: tính vô trạng thái (stateless) và ngắn hạn.
Mỗi khi bạn mở một cửa sổ terminal hay IDE mới, agent được khởi động từ con số 0. Nó phải mò mẫm đọc lại toàn bộ mã nguồn, tải thư viện, thử sai nhiều lần, vượt qua các lỗi hóc búa để hoàn thành nhiệm vụ. Nhưng ngay khi bạn đóng phiên làm việc hoặc context bị nén lại, mọi kinh nghiệm và kiến thức nó vừa học được đều tan biến hoàn toàn.
- Mất trí nhớ sau phiên (Session Amnesia): Agent quên sạch cấu trúc pipeline nội bộ, lặp lại y nguyên các thử nghiệm thất bại vào ngày hôm sau.
- Bộ kỹ năng đóng băng: Agent không có khả năng tự đúc kết kinh nghiệm thành các kỹ năng tái sử dụng được (procedural memory).
- Trói buộc vào máy tính cá nhân: Agent sẽ chết ngay khi bạn gập laptop, khiến các tác vụ chạy nền dài hạn hoặc điều khiển từ xa trở nên bất khả thi.
Hermes Agent, do tổ chức nghiên cứu Nous Research phát triển, tạo nên một bước nhảy vọt về kiến trúc: khung tác tử AI tự tiến hóa mã nguồn mở với vòng lặp tự học khép kín, bộ nhớ kép bền vững, giao tiếp đa kênh và hoạt động độc lập trên hạ tầng đám mây.
2. 🏗️ Bản Thiết Kế Kiến Trúc Hermes Agent
Hermes Agent được thiết kế theo mô hình phân tách độc lập (decoupled architecture), kết nối các kênh giao tiếp người dùng với các backend thực thi bảo mật:
flowchart TD
subgraph Ingress ["Tầng Kết Nối Đa Kênh (Omnichannel Ingress)"]
TUI["Giao diện dòng lệnh TUI (Rich / Prompt-Toolkit)"]
Chat["Telegram • Discord • Slack • WhatsApp • Signal"]
Voice["Chuyển giọng nói thành văn bản (Whisper Voice Memo)"]
end
Ingress -->|Luồng Sự Kiện Hai Chiều| Gateway["⚡ Hermes Gateway Control Plane\n(FastAPI / Asyncio RPC)"]
subgraph Core ["Lõi Trí Tuệ & Cơ Chế Tự Tiến Hóa"]
Gateway --> Router["Bộ Định Tuyến Mô Hình (Nous Portal, OpenRouter, vLLM, Ollama, Claude, GPT)"]
Router --> LearningLoop["🔄 Vòng Lặp Tự Học Khép Kín\n- Tự sinh kỹ năng mới\n- Tinh chỉnh kỹ năng runtime\n- Nén quỹ đạo học tăng cường"]
Router --> Scheduler["⏰ Bộ Lập Lịch Cron Tích Hợp\n(Tự động hóa chạy nền bằng ngôn ngữ tự nhiên)"]
end
subgraph MemoryLayer ["Hệ Thống Bộ Nhớ Bền Vững"]
Gateway --> FileMemory["Bộ Nhớ Làm Việc\n(MEMORY.md & USER.md)"]
Gateway --> FTS["Truy Vấn Ngữ Nghĩa SQLite FTS5\n(Tìm kiếm toàn văn lịch sử tương tác)"]
Gateway --> Honcho["Mô Hình Nhận Thức Honcho\n(Mô phỏng chân dung & thiên hướng người dùng)"]
end
subgraph ExecutionPlane ["7 Backend Thực Thi Độc Lập"]
Gateway --> LocalExec["Môi Trường Cục Bộ (Local OS)"]
Gateway --> DockerExec["Container Docker Phân Lập"]
Gateway --> SSHExec["Máy Chủ Từ Xa (SSH / Bare-metal)"]
Gateway --> ServerlessExec["Đám Mây Serverless (Modal / Daytona / Vercel)"]
end
3. 🔄 Vòng Lặp Tự Học Khép Kín & Khả Năng Tự Sinh Kỹ Năng
Điểm đột phá lớn nhất của Hermes Agent nằm ở Vòng lặp tự học khép kín (Closed Learning Loop). Thay vì chỉ dựa vào prompt hệ thống cố định, Hermes liên tục tích lũy kinh nghiệm từ chính quá trình giải quyết vấn đề thực tế:
| Giai đoạn | Cơ chế & Quy trình vận hành |
|---|---|
| 💡 Thực thi nhiệm vụ | Agent giải quyết bài toán kỹ thuật phức tạp qua nhiều bước thử nghiệm trong sandbox. |
| 🔍 Trích xuất mẫu | Khi thành công, tự động trích xuất các bước then chốt và các điểm lưu ý về ca biên. |
| 📝 Tự sinh kỹ năng | Tự động soạn thảo file SKILL.md chuẩn hóa theo tiêu chuẩn agentskills.io. |
| 🔄 Tinh chỉnh Runtime | Tự sửa đổi và nâng cấp kỹ năng khi phát hiện ca biên mới hoặc khi API thay đổi. |
| 📦 Nén quỹ đạo học | Nén lịch sử thực thi để phục vụ huấn luyện tinh chỉnh (Fine-tuning / DPO) thế hệ sau. |
Khi Hermes giải quyết một vấn đề mới (ví dụ: cấu hình ingress cho Kubernetes hoặc debug cờ biên dịch C++ đặc thù), nó sẽ lưu lại giải pháp dưới dạng một file SKILL.md trong thư mục kỹ năng. Ở các phiên làm việc sau, khi gặp tác vụ tương tự, Hermes kích hoạt ngay kỹ năng này mà không cần thử sai lại từ đầu.
4. 🧠 Bộ Nhớ Kép Bền Vững & Mô Hình Nhận Thức Biện Chứng
Hermes giải quyết triệt để hội chứng mất trí nhớ của AI thông qua kiến trúc bộ nhớ 3 tầng:
1. Bộ Nhớ Tệp Tin Làm Việc (MEMORY.md & USER.md)
MEMORY.md: Lưu trữ các quy ước dự án, sơ đồ kiến trúc thư mục, vị trí cấu hình API và các câu lệnh build thường dùng.USER.md: Ghi nhận thói quen lập trình, ngôn ngữ ưu tiên, phong cách giao tiếp và các sở thích cá nhân của lập trình viên.
2. Tìm Kiếm Toàn Văn Lịch Sử Qua SQLite FTS5
Hermes lưu lại toàn bộ các lượt trò chuyện và kết quả thực thi công cụ vào cơ sở dữ liệu SQLite cục bộ được đánh chỉ mục FTS5 full-text search. Khi bạn hỏi: “Ba tuần trước chúng ta đã xử lý lỗi SSL handshake timeout như thế nào?”, Hermes truy vấn ngay lịch sử cũ, tóm tắt ngữ cảnh và áp dụng giải pháp đã được chứng minh hiệu quả.
3. Tích Hợp Động Cơ Nhận Thức Honcho
Hermes tích hợp sẵn Honcho — động cơ nhận thức biện chứng giúp xây dựng một mô hình hiểu sâu sắc về con người bạn, mục tiêu dài hạn và sự thay đổi trong tư duy của bạn qua nhiều tháng đồng hành.
5. 🌐 Cổng Kết Nối Đa Kênh & 7 Môi Trường Thực Thi
Không bị giam cầm trong một tab trình duyệt hay một cửa sổ terminal, Hermes hoạt động như một tiến trình ngầm kết nối các ứng dụng nhắn tin hàng ngày với các cụm máy chủ đám mây:
sequenceDiagram
autonumber
actor User as Kỹ sư (Dùng Telegram trên điện thoại)
participant GW as Tiến Trình Hermes Gateway
participant Engine as Lõi Điều Khiển & Kỹ Năng
participant Backend as Máy Ảo Serverless Modal / Daytona
User->>GW: "Deploy bản dựng staging mới nhất và chạy smoke test"
GW->>Engine: Phân tích yêu cầu + tải kỹ năng deployment
Engine->>Backend: Đánh thức máy ảo serverless đang ngủ đông
Backend->>Backend: Chạy git pull, docker build, pytest
Backend-->>Engine: Truyền luồng log kiểm thử thời gian thực
Engine-->>GW: Tổng hợp kết quả test & độ trễ p99
GW-->>User: Tin nhắn Telegram: "✅ Staging online (0 lỗi, độ trễ 142ms)"
7 Backend Thực Thi Linh Hoạt:
- Local Host: Chạy trực tiếp trên máy tính làm việc của bạn.
- Docker: Môi trường container an toàn với giới hạn tài nguyên nghiêm ngặt.
- SSH: Điều khiển máy chủ vật lý hoặc VPS từ xa qua giao thức SSH.
- Singularity: Thực thi trên các cụm tính toán hiệu năng cao (HPC).
- Modal: Môi trường đám mây serverless hỗ trợ tăng tốc GPU.
- Daytona: Môi trường phát triển bền vững tự động ngủ đông khi rảnh rỗi để tiết kiệm chi phí.
- Vercel Sandbox: Máy ảo siêu nhỏ chạy tức thời cho các tác vụ tự động hóa web.
6. 🤖 Mô Hình Đa Tác Tử ‘Bot Mode’ & Tác Vụ Cron Nền Tự Động
Hermes cho phép quản lý một đội ngũ nhiều agent chuyên biệt thông qua Bot Mode:
{
"roster": [
{
"name": "Athena",
"role": "Kiến Trúc Sư Trưởng & Review Mã Nguồn",
"model": "nous-hermes-3-70b",
"skills": ["architecture-review", "security-audit"]
},
{
"name": "Vulcan",
"role": "Kỹ Sư DevOps & Hạ Tầng",
"model": "claude-3-7-sonnet",
"backend": "ssh-production-cluster"
}
]
}
Tự Động Hóa Định Kỳ Bằng Ngôn Ngữ Tự Nhiên
Hermes tích hợp sẵn bộ lập lịch cron chạy nền. Bạn có thể giao việc bằng câu lệnh tự nhiên:
“Mỗi sáng lúc 8:00 AM, hãy kiểm tra các Pull Request mới trên GitHub, chạy bộ test hiệu năng trên Daytona và gửi bản tóm tắt vào kênh Slack
#engineering.”
Hermes sẽ tự động duy trì lịch trình, tự kích hoạt và báo cáo kết quả đúng giờ mà không cần sự can thiệp của con người.
7. 🚀 Hướng Dẫn Cài Đặt & Trải Nghiệm Nhanh
Hermes Agent hỗ trợ cài đặt chỉ bằng một câu lệnh duy nhất:
Trên Linux, macOS, và WSL2:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
hermes
Trên Windows Native (PowerShell):
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
hermes
Ghi chú: Bộ cài đặt Windows tự động cấu hình môi trường Git Bash cô lập (MinGit) và trình quản lý gói Astral uv Python 3.11 mà không cần quyền Administrator.
Chuyển Đổi Mô Hình Nhanh Chóng:
hermes model nous-portal/hermes-3-llama-3.1-405b
hermes model openrouter/anthropic/claude-3.7-sonnet
hermes model local/vllm
8. 🎯 Tổng Kết
Hermes Agent của Nous Research đã định hình một tiêu chuẩn mới cho thế hệ tác tử AI tự trị tiếp theo:
- Xóa bỏ mất trí nhớ: Sự kết hợp giữa
MEMORY.md, SQLite FTS5 và Honcho giúp agent ngày càng thông minh và am hiểu bạn hơn sau mỗi tuần làm việc. - Độc lập hạ tầng: Hoạt động linh hoạt từ VPS giá rẻ, ra lệnh qua Telegram/Discord, chạy tác vụ nặng trên Modal/Daytona serverless.
- Tiến hóa tự thân: Tự sinh, tự sửa đổi và tích lũy kho tàng
SKILL.mdqua thời gian.