Hermes Agent Design

Multi-Platform AI Agent Framework — 架构设计文档站

Python TypeScript Open Source

系统架构

┌─────────────────────────────────────────────────────────────┐ │ Hermes Agent │ ├─────────────────────────────────────────────────────────────┤ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ CLI │ │ TUI │ │ Gateway │ │ Plugin │ │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │ └──────────────┼──────────────┘ │ │ │ ┌──────────────────▼─────────────────────────────────────┐ │ │ │ AIAgent Core │ │ │ │ ┌─────────┐ ┌──────────┐ ┌─────────┐ ┌─────────┐ │ │ │ │ │ Provider│ │ Tool │ │ Memory │ │ Traj. │ │ │ │ │ │ Manager │ │ Registry │ │ Manager │ │Compress │ │ │ │ │ └─────────┘ └──────────┘ └─────────┘ └─────────┘ │ │ │ └─────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────┘

核心模块

AIAgent Core

对话循环、工具编排、会话管理、预算跟踪。约12k行核心代码。

Provider Layer

多LLM后端抽象层:OpenAI、Anthropic、Gemini、MiniMax、GLM等。

Tool System

基于注册模式的工具自动发现机制,支持terminal/file/web/code等。

Memory System

SQLite+FTS5全文搜索,会话轨迹压缩,上下文智能截断。

Gateway

多平台消息路由:Telegram、Discord、Feishu、QQ、Webhook等。

Plugin System

可扩展插件架构:memory、context_engine、model-providers等。

技术栈

Documentation Docusaurus (React-based)
Core Language Python 3.11+
Web UI React + TypeScript + Vite
Deployment GitHub Pages
Database SQLite + FTS5