Skip to content

Plugin System

源码版本v2026.7.20

Responsibility

Plugins are Hermes's extension skeleton: provider profiles, platform adapters, context engine, cron providers, memory backends, browser, image/video generation... all plug in through the plugin mechanism. plugins/ provides PluginContext (the registration entry) + utility functions; each plugin subdirectory is self-contained by domain. It coordinates with ToolRegistry/PlatformRegistry: plugins only "declare and register"; the registries handle "lookup and dispatch".

Key Files

Data Flow

  1. At startup, init_agent (agent/agent_init.py:276) triggers plugin discovery.
  2. Each plugin subdirectory is imported; module-level code calls PluginContext registration methods:
  3. The registries (singletons) become the lookup truth; the main loop and gateway only read the registries and do not directly depend on specific plugins.
  4. Plugins are hot-pluggable: unloading is just unregister; the registry handles priority and overrides.

Summary

Plugin = "subdirectory + registration". All cross-cutting capabilities (providers, platforms, tools, memory, cron, multimodal) go through the same registration skeleton, so the core loop stays stable. Adding a capability = creating a plugin subdirectory and registering; no need to touch the agent's trunk.

Unofficial community learning site. Content based on the MIT-licensed NousResearch/hermes-agent source.