Skip to content

Platform-Agnostic Core Architecture

Platform-Agnostic Core Architecture is a design principle where a single, unified core engine is used to serve multiple different interfaces or deployment environments simultaneously. Instead of creating separate implementations for each platform, the application logic is centralized, with platform-specific differences handled only at the entry points^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].

This approach prioritizes code reusability and architectural simplicity by decoupling the core execution engine from the transport, UI, or runtime layer.

Core Characteristics

  • Unified Core: A single primary class (e.g., an AIAgent class) manages the logic, conversation flow, and state^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  • Entry Point Abstraction: Distinct platforms (CLI, Web Gateway, API Server, etc.) act as thin adapters that translate specific inputs into a standard format for the core^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  • Decoupled Modules: Core subsystems—such as Prompt Building, Provider Resolution, and Tool Dispatch—are modular and independent of the entry point^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].

Implementation Logic

In a platform-agnostic system, the core engine is designed to be "unaware" of the context from which it was triggered^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].

  1. Entry Points: The outermost layer (e.g., cli.py, gateway/run.py, or an API adapter) handles the specific communication protocols and user interactions^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  2. Normalization: These adapters normalize user input and pass it to the central AIAgent.
  3. Execution: The AIAgent processes the request using a shared set of tools and logic, regardless of whether the request originated from a Slack message, a terminal command, or a scheduled cron job^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  4. Response: The core returns the result to the specific entry point, which handles the formatting and delivery appropriate for that platform.

Benefits

  • Maintainability: Bug fixes and feature improvements only need to be made once in the core engine rather than replicated across multiple platform-specific codebases^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  • Consistency: Behavior remains consistent across all platforms because they all rely on the exact same execution logic^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  • Extensibility: Adding support for a new platform (e.g., a new chat application) requires only building a new adapter "wrapper" without rewriting the agent's logic^[001-TODO__Hermes_Agent_·_设计哲学与思维框架.md].
  • [[Loose Coupling via Registry]]: Often used alongside platform-agnostic cores to manage optional tools and providers without hard dependencies.
  • [[Radical Flexibility]]: The broader design philosophy that encompasses platform independence and provider interchangeability.
  • [[Modular Design]]: The structural approach enabling the separation of the core from specific implementations.

Sources

  • 001-TODO__Hermes_Agent_·_设计哲学与思维框架.md