# servervpss/centraldark architecture

> Architecture diagram of the GitHub repository servervpss/centraldark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/servervpss/centraldark
- Repository: https://github.com/servervpss/centraldark

## Overview

Hermes Agent is a self-improving AI agent that accepts conversations through a CLI/TUI or messaging gateway, uses a configurable model and tools to respond, and retains context for later turns. The README also describes scheduled jobs, subagents, multiple execution backends, and a learning loop spanning memory and skills. Those documented capabilities are included, but many implementation files were not sampled; links for those branches rely on README statements rather than inspected calls.

Main entry points: [`agent`](https://github.com/servervpss/centraldark/tree/main/agent) (Agent runtime), [`hermes_cli/console_engine.py`](https://github.com/servervpss/centraldark/blob/main/hermes_cli/console_engine.py) (CLI and TUI), [`gateway`](https://github.com/servervpss/centraldark/tree/main/gateway) (Messaging gateway), [`agent/auxiliary_client.py`](https://github.com/servervpss/centraldark/blob/main/agent/auxiliary_client.py) (Model providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI and TUI<br/>[console_engine.py]"]
  node_messaging["Messaging gateway"]
  node_api["OpenAI-compatible API"]
end

subgraph group_runtime["Agent runtime"]
  node_agent["Agent runtime"]
  node_context["Context engine<br/>[context_engine.py]"]
  node_compression["Context compression"]
  node_model["Model providers"]
  node_tools["Tools and backends"]
  node_toolstorage[("Tool result storage")]
end

subgraph group_learning["Learning and memory"]
  node_memory["Memory and recall"]
  node_skills["Learning skills"]
  node_subagents["Subagents"]
end

subgraph group_operations["Automation and execution"]
  node_scheduler["Cron scheduler"]
  node_teams["Teams meeting pipeline<br/>[pipeline.py]"]
end

subgraph group_state["Configuration and persistence"]
  node_config["Configuration<br/>[config.py]"]
  node_persistence[("Persistence layer")]
end

node_user(("User"))

node_user -->|"starts conversation"| node_cli
node_user -->|"messages through"| node_messaging
node_cli -.->|"sends turns"| node_agent
node_messaging -.->|"sends turns"| node_agent
node_api -->|"routes requests"| node_agent
node_agent -.->|"requests completion"| node_model
node_agent -->|"calls tools"| node_tools
node_agent -->|"manages context"| node_context
node_context -->|"selects engine"| node_compression
node_compression -.->|"summarizes context"| node_model
node_tools -->|"persists large output"| node_toolstorage
node_agent -->|"learns and recalls"| node_memory
node_agent -->|"creates and improves"| node_skills
node_agent -->|"delegates work"| node_subagents
node_scheduler -->|"delivers jobs"| node_messaging
node_cli -->|"reads configuration"| node_config
node_cli -->|"manages jobs"| node_scheduler
node_agent -.->|"stores sessions"| node_persistence
node_teams -->|"uses auxiliary model"| node_model

click node_cli "https://github.com/servervpss/centraldark/blob/main/hermes_cli/console_engine.py"
click node_messaging "https://github.com/servervpss/centraldark/tree/main/gateway"
click node_api "https://github.com/servervpss/centraldark/blob/main/gateway/platforms/api_server_openai_routes.py"
click node_agent "https://github.com/servervpss/centraldark/tree/main/agent"
click node_context "https://github.com/servervpss/centraldark/blob/main/agent/context_engine.py"
click node_compression "https://github.com/servervpss/centraldark/blob/main/agent/context_compressor.py"
click node_model "https://github.com/servervpss/centraldark/blob/main/agent/auxiliary_client.py"
click node_tools "https://github.com/servervpss/centraldark/tree/main/tools/environments"
click node_toolstorage "https://github.com/servervpss/centraldark/blob/main/tools/tool_result_storage.py"
click node_memory "https://github.com/servervpss/centraldark/tree/main/agent"
click node_skills "https://github.com/servervpss/centraldark/tree/main/agent"
click node_subagents "https://github.com/servervpss/centraldark/tree/main/agent"
click node_scheduler "https://github.com/servervpss/centraldark/tree/main/cron"
click node_config "https://github.com/servervpss/centraldark/blob/main/hermes_cli/config.py"
click node_persistence "https://github.com/servervpss/centraldark/blob/main/persistence_assembly.py"
click node_teams "https://github.com/servervpss/centraldark/blob/main/plugins/teams_pipeline/pipeline.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_messaging,node_api,node_user toneBlue
class node_agent,node_context,node_compression,node_model,node_tools,node_toolstorage toneAmber
class node_memory,node_skills,node_subagents toneMint
class node_scheduler,node_teams toneRose
class node_config,node_persistence toneIndigo
```

## Components

### User interfaces

- [CLI and TUI](https://github.com/servervpss/centraldark/blob/main/hermes_cli/console_engine.py): `hermes_cli/console_engine.py`
- [Messaging gateway](https://github.com/servervpss/centraldark/tree/main/gateway): `gateway`
- [OpenAI-compatible API](https://github.com/servervpss/centraldark/blob/main/gateway/platforms/api_server_openai_routes.py): `gateway/platforms/api_server_openai_routes.py`

### Agent runtime

- [Agent runtime](https://github.com/servervpss/centraldark/tree/main/agent): `agent`
- [Context engine](https://github.com/servervpss/centraldark/blob/main/agent/context_engine.py): `agent/context_engine.py`
- [Context compression](https://github.com/servervpss/centraldark/blob/main/agent/context_compressor.py): `agent/context_compressor.py`
- [Model providers](https://github.com/servervpss/centraldark/blob/main/agent/auxiliary_client.py): `agent/auxiliary_client.py`
- [Tools and backends](https://github.com/servervpss/centraldark/tree/main/tools/environments): `tools/environments`
- [Tool result storage](https://github.com/servervpss/centraldark/blob/main/tools/tool_result_storage.py): `tools/tool_result_storage.py`

### Learning and memory

- [Memory and recall](https://github.com/servervpss/centraldark/tree/main/agent): `agent`
- [Learning skills](https://github.com/servervpss/centraldark/tree/main/agent): `agent`
- [Subagents](https://github.com/servervpss/centraldark/tree/main/agent): `agent`

### Automation and execution

- [Cron scheduler](https://github.com/servervpss/centraldark/tree/main/cron): `cron`
- [Teams meeting pipeline](https://github.com/servervpss/centraldark/blob/main/plugins/teams_pipeline/pipeline.py): `plugins/teams_pipeline/pipeline.py`

### Configuration and persistence

- [Configuration](https://github.com/servervpss/centraldark/blob/main/hermes_cli/config.py): `hermes_cli/config.py`
- [Persistence layer](https://github.com/servervpss/centraldark/blob/main/persistence_assembly.py): `persistence_assembly.py`

### Other components

- **User**

## Connections

- User → CLI and TUI: starts conversation
- User → Messaging gateway: messages through
- CLI and TUI → Agent runtime: sends turns (evidence: `hermes_cli/console_engine.py`)
- Messaging gateway → Agent runtime: sends turns (evidence: `gateway/platforms/api_server_openai_routes.py`)
- OpenAI-compatible API → Agent runtime: routes requests (evidence: `gateway/platforms/api_server_openai_routes.py`)
- Agent runtime → Model providers: requests completion (evidence: `agent/context_compressor.py`)
- Agent runtime → Tools and backends: calls tools (evidence: `agent/checkpoints/manager.py`)
- Agent runtime → Context engine: manages context (evidence: `agent/context_engine.py`)
- Context engine → Context compression: selects engine (evidence: `agent/context_engine.py`)
- Context compression → Model providers: summarizes context (evidence: `agent/context_compressor.py`)
- Tools and backends → Tool result storage: persists large output (evidence: `tools/tool_result_storage.py`)
- Agent runtime → Memory and recall: learns and recalls
- Agent runtime → Learning skills: creates and improves
- Agent runtime → Subagents: delegates work
- Cron scheduler → Messaging gateway: delivers jobs
- CLI and TUI → Configuration: reads configuration (evidence: `hermes_cli/console_engine.py`)
- CLI and TUI → Cron scheduler: manages jobs (evidence: `hermes_cli/console_engine.py`)
- Agent runtime → Persistence layer: stores sessions
- Teams meeting pipeline → Model providers: uses auxiliary model (evidence: `plugins/teams_pipeline/pipeline.py`)
