Plugin System
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
plugins/__init__.py—PluginContext, registration entries (register_platform,register_provider, etc.)plugin_utils.py— shared plugin utility functionsmodel-providers/— LLM provider profiles (see Providers)platforms/— Telegram/Discord/Slack platform adapters (see Platform Adapters)context_engine/— context engine extensionscron_providers/— cron scheduling backendsmemory/— memory backendsbrowser//web/— browser and web capabilitiesimage_gen//video_gen/— multimodal generationobservability//security-guidance/— observability and security
Data Flow
- At startup,
init_agent(agent/agent_init.py:276) triggers plugin discovery. - Each plugin subdirectory is imported; module-level code calls
PluginContextregistration methods:- model-provider →
register_provider:53 - platform →
platform_registry.register:231 - tool →
registry.register:365(via namespace policy)
- model-provider →
- The registries (singletons) become the lookup truth; the main loop and gateway only read the registries and do not directly depend on specific plugins.
- 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.