All plugins

aphrodite

CCR compression plugin - multi-type classifier, 13 tools, default-on context engine (middle-turn archiving + engine_offload), TOML-driven templates, auto-expand, live containers, prompt knobs, recursion/body caps. Priced retrieval: a marker's size is its retrieval cost - previews answer the structural questions, deferral is safe, batch the retrievals you need. Disclosure - hook and tool logic runs in prebuilt native binaries (libaphrodite_hermes + aphrodite proxy, v1.8.1) built from the public PlayForm/Aphrodite source and fetched by an explicit download.sh step checked against in-tree SHA-256 sums; register() starts a background proxy on 127.0.0.1:9797/9798 whose management routes are open to local processes unless APHRODITE_MGMT_TOKEN is set; pre_tool_call by default rewrites slow terminal commands (cargo/npm/pip/docker/curl...) to run in the background (background=true, notify_on_complete=true) and splits chained commands when enabled; aphrodite_prefetch reads files the model names into its store (refuses .env, auth.json, ~/.ssh and the Hermes home); requires its own APHRODITE_API_KEY for an upstream LLM endpoint (default api.openai.com). Disclosure β€” hook and tool logic runs in prebuilt native binaries (libaphrodite_hermes + aphrodite proxy, v1.8.1) built from the public PlayForm/Aphrodite source and fetched by an explicit download.sh step checked against in-tree SHA-256 sums; register() starts a background proxy on 127.0.0.1:9797/9798 whose management routes are open to local processes unless APHRODITE_MGMT_TOKEN is set; by default it archives middle conversation turns behind retrieval markers once the context passes 30% full; pre_tool_call by default rewrites slow terminal commands (cargo/npm/pip/docker/curl...) to run in the background (background=true, notify_on_complete=true) and splits chained commands when enabled; aphrodite_prefetch reads files the model names into its store (refuses .env, auth.json, ~/.ssh and the Hermes home); requires its own APHRODITE_API_KEY for an upstream LLM endpoint (default api.openai.com).

PlayForm19Toolsv2.3.2Updated 7 days ago

About

CCR compression plugin - multi-type classifier, 13 tools, default-on context engine (middle-turn archiving + engine_offload), TOML-driven templates, auto-expand, live containers, prompt knobs, recursion/body caps. Priced retrieval: a marker's size is its retrieval cost - previews answer the structural questions, deferral is safe, batch the retrievals you need. Disclosure - hook and tool logic runs in prebuilt native binaries (libaphrodite_hermes + aphrodite proxy, v1.8.1) built from the public PlayForm/Aphrodite source and fetched by an explicit download.sh step checked against in-tree SHA-256 sums; register() starts a background proxy on 127.0.0.1:9797/9798 whose management routes are open to local processes unless APHRODITE_MGMT_TOKEN is set; pre_tool_call by default rewrites slow terminal commands (cargo/npm/pip/docker/curl...) to run in the background (background=true, notify_on_complete=true) and splits chained commands when enabled; aphrodite_prefetch reads files the model names into its store (refuses .env, auth.json, ~/.ssh and the Hermes home); requires its own APHRODITE_API_KEY for an upstream LLM endpoint (default api.openai.com). Disclosure β€” hook and tool logic runs in prebuilt native binaries (libaphrodite_hermes + aphrodite proxy, v1.8.1) built from the public PlayForm/Aphrodite source and fetched by an explicit download.sh step checked against in-tree SHA-256 sums; register() starts a background proxy on 127.0.0.1:9797/9798 whose management routes are open to local processes unless APHRODITE_MGMT_TOKEN is set; by default it archives middle conversation turns behind retrieval markers once the context passes 30% full; pre_tool_call by default rewrites slow terminal commands (cargo/npm/pip/docker/curl...) to run in the background (background=true, notify_on_complete=true) and splits chained commands when enabled; aphrodite_prefetch reads files the model names into its store (refuses .env, auth.json, ~/.ssh and the Hermes home); requires its own APHRODITE_API_KEY for an upstream LLM endpoint (default api.openai.com).

Aphroditeβ€πŸ’‹β€Hermes Plugin

[!NOTE]

CCR compression plugin for Hermes Agent - thin Python loader + Rust dylib.
Sub-ms tool output compression, multi-type classifier, 13 tools, 6 hooks,
default-on context engine, TOML-driven templates, auto-expand, live
containers, prompt knobs, recursion/body caps, optional Rhai scripting.
Skills ship dev-side, not with the plugin.

Aphrodite intercepts tool output before it reaches the LLM and replaces it with
compact, structured previews. The agent sees 15 tokens of metadata instead of
500 tokens of raw text - and retrieves the full content only when it actually
needs it. All compression logic runs in the Rust dylib.

Priced retrieval: every <<<CCR:hash|type|size>>> marker's size is its
retrieval cost - resolving it re-adds that many bytes to context. Previews
answer the structural questions (succeeded? which files? how many? what
shape?) for free; deferral is safe - markers persist and stay retrievable;
batch the retrievals you actually need into one turn. Never re-read a file
you hold a marker for.

Features ⚑

  • CCR compression - tool output becomes a compact
    <<<CCR:hash|type|size>>> marker; the full content stays in the store until
    you retrieve it.
  • TOML-driven templates - [templates.preview.<family>.<ctype>] format
    strings, a [templates.marker] block (format + hint), [templates.prompts]
    session_inject, and a [templates.reverse] ctype→key remap. Resolution:
    family[ctype] β†’ reverse[ctype] β†’ family[_default] β†’ hardcoded builder.
  • Auto-expand - [compression] auto_expand resolves just-stored content
    inline instead of emitting a marker, capped by auto_expand_limit
    (default 102400 bytes; APHRODITE_AUTO_EXPAND / APHRODITE_AUTO_EXPAND_LIMIT
    override).
  • Context engine (default-on) - once the session passes
    engine_threshold_pct (default 30) of context fill, overflowing middle
    turns are archived and an engine_offload prompt is injected;
    engine_protect_first / engine_protect_last / engine_min_msgs guard the
    conversation edges; 100+ turns the engine off.
  • Live containers - [compression] live_container (or
    APHRODITE_LIVE_CONTAINER) turns large tool results into instant live
    CCR markers with progressive chunked retrieval and an ETA.
  • Prompt knobs - retrieve_guidance, ccr_marker_hint, and
    catalog_intent_hints tune how the system instructs the LLM about CCR.
  • Recursion & body caps - [compression] recursive_depth /
    APHRODITE_RECURSIVE_DEPTH (default 5) bounds nested expansion;
    [compression] max_request_body_size / APHRODITE_MAX_REQUEST_BODY_SIZE
    (optional, unset = no cap) bounds request bodies.
  • Rhai scripting (optional) - the scripting Cargo feature links an
    exact-pinned rhai 1.25.1 micro-script engine; the default build never pulls
    it in.

Repositories

Aphrodite is split across two repositories - the parent monorepo owns the
Rust engine and the release pipeline; this repository is the thin Hermes
plugin that loads it.

RepositoryRoleKey paths
PlayForm/AphroditeParent monorepo - Rust engine, binary proxy, docs, CI, releases. This plugin is a git submodule of it (plugins/aphrodite).crates/aphrodite (core engine) Β· crates/aphrodite-hermes (dylib bridge) Β· vendor/headroom (owned fork) Β· .github/workflows/ (Build/Publish/Check)
PlayForm/Aphrodite-HermesThis repository - the Hermes plugin (thin Python loader). No Rust, no compression logic; everything lives in the dylib built by the parent.__init__.py Β· plugin.yaml Β· download.sh / download.ps1 Β· BINARY_VERSION Β· SHA256SUMS.txt

Development model: the parent's Development branch accumulates the
Rust engine; this plugin's Development branch accumulates the loader. At
release time the plugin is synced first (submodule-first), then the parent
floats its gitlink to the plugin commit, and the parent tag drives
Build.yml (12 release assets) β†’ Publish.yml (cargo publish). The
plugin's BINARY_VERSION names the binary release it expects; download.sh
fetches it from the parent's GitHub Release and verifies the in-tree
SHA256SUMS.txt.

See the parent's docs
for the engine, configuration reference, and the full release ceremony.

plugin
hermes
license


Installβ€βš‘

Hermes plugin + explicit setup

Terminal

git clone https://github.com/PlayForm/Aphrodite-Hermes.git
cd Aphrodite-Hermes
ln -s "$(pwd)" ~/.hermes/plugins/aphrodite
bash download.sh # explicit setup step: binary + dylib from GitHub Releases
cd ..
hermes plugins enable aphrodite
hermes

The ln -s line links the plugin into ~/.hermes/plugins/ so Hermes can
discover it. Create it at install time - the plugin never creates, converts,
or recreates this link: ~/.hermes/plugins/aphrodite is Hermes-owned
(layout_check.py is report-only; the install path may be a symlink or a
real directory).

Binaries are never shipped inside the repository. The plugin downloads
them from the GitHub release (tag pinned in BINARY_VERSION, checksums
generated by Build.yml into the in-tree SHA256SUMS.txt) with an
explicit setup step - bash ./download.sh (or pwsh ./download.ps1 on
Windows) - which verifies SHA-256 against the in-tree checksum list and
refuses on mismatch. register() never downloads and never writes into
~/.hermes/plugins/aphrodite/: if the binaries are missing it logs the
setup command and the plugin stays disabled until they are present. No Rust
toolchain required.

[!IMPORTANT]

Native Windows: run pwsh ./download.ps1 instead of download.sh - no
Git Bash/WSL needed. See
Windows install
for the full walkthrough, and
Troubleshooting
if the proxy doesn't come up after enabling the plugin.

LLM provider configuration (required)

The aphrodite proxy is an OpenAI-compatible LLM API proxy - it forwards
requests upstream - so it needs its own provider credentials even though
Hermes already has a provider configured. The plugin cannot read Hermes'
provider config, and there is no keyless / compression-only mode: without a
key the proxy refuses to start and the plugin is unusable.

Terminal

export APHRODITE_API_KEY="sk-..."                 # REQUIRED
export APHRODITE_API_URL="https://api.openai.com" # optional
export APHRODITE_MODEL="default-model"            # optional

Alternatives: run aphrodite setup, or add api_key / api_url / model to
~/.hermes/aphrodite/aphrodite.toml. If the proxy fails to start,
~/.hermes/aphrodite/proxy-stderr.log shows the reason - no API key configured means the key is missing.

What changes after install

After installing and launching Hermes once:

Filesystem

~/.hermes/
β”œβ”€β”€ plugins/
β”‚   └── aphrodite β†’ /path/to/Aphrodite-Hermes    ← manual symlink to this repo
β”œβ”€β”€ aphrodite/
β”‚   β”œβ”€β”€ binaries/
β”‚   β”‚   β”œβ”€β”€ aphrodite                            ← proxy binary (fetched by `download.sh` ~35 MB)
β”‚   β”‚   └── libaphrodite_hermes.dylib            ← plugin dylib (fetched by `download.sh`)
β”‚   β”œβ”€β”€ ccr.db                                    ← SQLite CCR store (on first run)
β”‚   └── proxy-stderr.log                          ← proxy logs (on failure)

The plugin also adds to your Hermes config:

config.yaml

# Added automatically on enable
plugins:
    enabled:
        - aphrodite

# Recommended additions (manual)
context:
    engine: aphrodite
    engine_threshold_pct: 30 # % of context filled before archiving kicks in; 100+ = engine off
model:
    context_length: 1000000

Two proxy processes launch on :9797 (cache) and :9798 (token).
On registration the plugin probes both health endpoints and reuses an
already-running proxy pair
instead of launching a second instance.

Verify it's working

Terminal

# In a Hermes session:
aphrodite_stats

# Or via CLI:
curl http://127.0.0.1:9798/health
# β†’ {"status":"healthy","version":"<installed binary version - see BINARY_VERSION>"}

Clean uninstall

Terminal

hermes plugins disable aphrodite
rm ~/.hermes/plugins/aphrodite # remove the manual symlink you created
pkill -f "$HOME/.hermes/aphrodite/binaries/aphrodite"

Architectureβ€πŸ—οΈ

The plugin is a thin Python registration shim over a Rust dylib - every
hook, tool, and byte of compression logic lives in Rust. Python exists only to
load the dylib via ctypes and register its surface with Hermes.

Layers

Call chain

 Hermes Agent (hooks + tool dispatch)
    β”‚
    β–Ό
 plugins/aphrodite/__init__.py        ← ~1,150-line Python loader
    β”‚  ctypes FFI, registers hooks/tools/engine - no logic
    β–Ό
 libaphrodite_hermes.dylib            ← Hermes bridge (JSON contract)
    β”‚  6 hooks Β· 13 tools Β· schemas
    β–Ό
 libaphrodite (core engine)           ← ALL compression logic
    β”‚  hooks Β· resolve Β· retrieve Β· marker Β· preview
    β”‚  stage2 Β· struct_extract Β· state Β· session
    β”‚  catalog Β· prefetch Β· poll_worker Β· directives
    β”‚  config_loader Β· templates Β· builtin_directives
    β”‚  scripting (optional Cargo feature)
    β–Ό
 CCR store (SQLite :9798 / in-memory :9797 / inline)

Data flow

Plugin mode

 Tool executes β†’ output intercepted by hook
      ↓
 classify β†’ preview β†’ store (SQLite / in-memory / inline)
      ↓
 Agent ← [type:enriched preview] (not raw output)
      ↓
 aphrodite_retrieve(hash) β†’ full content (only when needed)

Dual listeners

The plugin auto-launches two proxy processes (and reuses an already-running
pair instead of starting a second instance):

ListenerPortCCR backendThresholdBest for
Cache:9797In-memory (DashMap, 10K entries)>8 KBSpeed, transient sessions
Token:9798SQLite (persistent)>1 KBDurability, tool relay

Hooks

Six Hermes hooks drive the plugin (provides_hooks in plugin.yaml), all
dispatched to the Rust dylib:

HookRole
on_session_startEngine bootstrap, directive seeding, proxy health check
transform_tool_resultCompress every tool result before it reaches the LLM
transform_terminal_outputCompress terminal output with exit-code context
pre_llm_callInject directives, compress overflowing middle turns
post_llm_callCapture savings, update adaptive thresholds
pre_tool_callPrefetch-aware dispatch, auto-background slow calls

[!NOTE]

No hot-reload: the dylib is resolved once per process from the installed
binary set and loaded directly (ctypes.CDLL on the canonical path). The
load is deterministic from the pinned tree - it never races a rebuild. To
pick up a new build, restart the Hermes session.


Toolsβ€πŸ› οΈ

ToolDescription
aphrodite_retrieveResolve <<<CCR:hash|type|size>>> markers
aphrodite_compressCompress content via CCR with type hint
aphrodite_statsProxy health, engine status, inline store size
aphrodite_rebuildReport binary/proxy version + a rebuild hint (does not rebuild or restart itself)
aphrodite_filesTracked file references grouped by tool
aphrodite_diffConversation turn history with summaries
aphrodite_searchSearch CCR store by keyword or type
aphrodite_directiveList/swap/add/remove/reset active behavioral directives
aphrodite_testSmoke test suite: quick (1 sample) or full (3 samples)
aphrodite_catalogFull CCR catalog with hashes, types, sizes, previews
aphrodite_reclassifyRetroactive metadata enrichment
aphrodite_prefetchRead + compress files on demand; markers returned inline
aphrodite_prefetch_statusLive prefetch schedule: loading, ready, errors

Configurationβ€βš™οΈ

All tuning in aphrodite.toml - searched in ./aphrodite.toml, then
~/.hermes/aphrodite/aphrodite.toml (when APHRODITE_CONFIG_PATH is unset):

aphrodite.toml

[compression]
engine_threshold_pct = 30    # % of context filled before middle-turn archiving; 100+ disables the engine
engine_protect_first = 2     # messages to keep at start
engine_protect_last = 5      # messages to keep at end
engine_min_msgs = 8          # minimum messages before the engine activates
tool_threshold_token = 256   # token proxy threshold (bytes)
tool_threshold_cache = 2048  # cache proxy threshold (bytes)
terminal_threshold  = 256    # terminal output threshold (bytes)
inline_threshold    = 1024   # inline-vs-durable CCR storage cutoff (bytes)
code_multiplier     = 1.0    # 1.0 = code compresses at the base threshold
auto_expand         = true   # resolve just-stored content inline instead of emitting a marker
auto_expand_limit   = 102400 # byte cap for auto-expanded content (0 = unlimited)
live_container      = false  # instant 'live' CCR markers for large tool results
recursive_depth     = 5      # max nested expansion depth
# max_request_body_size = 10485760  # optional request-body cap (unset = no cap)
# Store retention (SQLite token proxy): ccr_ttl_seconds bounds the store in
# TIME, these bound it in SPACE. Past either cap the least-recently-accessed
# rows are evicted (a cache policy: an evicted hash is a retrieval miss, like
# an expired one). 0 = unlimited.
store_max_entries   = 100000    # max live rows
store_max_bytes     = 536870912 # max stored payload bytes
context_engine      = true   # engine status flag, default-on

[previews]
model_family = "code_first"  # family selector for [templates.preview]; only matters when templates are configured

[prompts]
retrieve_guidance = "minimal"   # prompt knob: how the LLM is told to use retrieval
ccr_marker_hint = false         # prompt knob: marker hint text
catalog_intent_hints = false    # prompt knob: per-intent catalog hints

[templates]                     # optional: format strings; absent = built-in builders
# preview.<family>.<ctype> = "format string"
# [templates.marker] format / hint
# [templates.prompts] session_inject
# [templates.reverse] ctype -> key remap

Env var overrides: APHRODITE_ENGINE_THRESHOLD_PCT, APHRODITE_CONTEXT_ENGINE,
APHRODITE_AUTO_EXPAND/APHRODITE_AUTO_EXPAND_LIMIT, APHRODITE_LIVE_CONTAINER,
APHRODITE_RECURSIVE_DEPTH, APHRODITE_MAX_REQUEST_BODY_SIZE, etc. Preview and
marker format variables, plus the resolution order, are defined in
crates/aphrodite/src/templates.rs.
See docs/config/env-vars.md.

Runtime home (one decision, shared by both halves)

The runtime home - where aphrodite.toml, binaries/, directives/,
ccr.db, and proxy-stderr.log live - is resolved by one shared
decision
, made identically by the plugin shim and the Rust binary:

  1. APHRODITE_HOME - explicit override; never second-guessed.
  2. <hermes-home>/aphrodite - $HERMES_HOME when set (Docker image,
    profile gateways), else ~/.hermes/aphrodite.

At startup the shim exports its decision into APHRODITE_HOME (and
APHRODITE_DIRECTIVES_DIR), so the dylib and the spawned proxy binary
resolve the same directory by construction - the two halves cannot diverge.
The startup log names the result: runtime home: <path> (decided by APHRODITE_HOME override|HERMES_HOME|default).

Upgrading from ≀ 2.1.5: when the Hermes-home-derived runtime home does
not hold an install but the pre-2.2 ~/.hermes/aphrodite does, the old home
is adopted (a one-line warning in the log) - nothing is migrated and
binaries/ / aphrodite.toml keep resolving. Adoption never fires for a
throwaway/scratch HERMES_HOME (e.g. the hermes plugins validate probe,
which must stay isolated from the real install). Set APHRODITE_HOME to pin
the location explicitly. The Rust binary follows the same resolution, so
standalone runs (aphrodite setup, proxy launches) agree even without the
shim.

Set APHRODITE_NO_AUTO_LAUNCH=1 to skip the proxy auto-launch entirely, e.g.
when a cargo watch dev loop runs the proxy itself.

Directives

Custom behavioral directives are name.md files in
~/.hermes/aphrodite/directives/ - an empty file means an intentionally
empty directive. The plugin does NOT ship a directives/ set: the binary
provides them (embedded builtins) and materializes them into the user-data
home at startup/setup, so the plugin dir stays a pure loader. The dylib
reads them from APHRODITE_DIRECTIVES_DIR (defaults to
~/.hermes/aphrodite/directives, user override wins). If no directive
directory is found, the compiled built-in set loads as a fallback - its
activation is logged. Manage them at runtime with aphrodite_directive
(list/swap/add/load/remove/reset).


Dev Install (Rust source)

Terminal

git clone https://github.com/PlayForm/Aphrodite.git
cd Aphrodite
cargo build -p aphrodite-hermes
# Dylib: target/debug/libaphrodite_hermes.dylib (crate aphrodite-hermes;
# `-p aphrodite` alone builds only the proxy binary). The loader resolves the
# dylib from the canonical runtime home first (env override
# APHRODITE_HERMES_DYLIB_PATH wins when set), so a dev loop copies it there:
mkdir -p ~/.hermes/aphrodite/binaries
cp target/debug/libaphrodite_hermes.dylib ~/.hermes/aphrodite/binaries/

An already-running dev proxy (cargo run -p aphrodite) that answers the
health endpoints is reused instead of relaunched - the plugin probes both
ports before launching (see _start_proxy).


Files

Layout

Aphrodite-Hermes/
β”œβ”€β”€ __init__.py          ← ~1,150-line Python loader (ctypes FFI)
β”œβ”€β”€ plugin.yaml          ← 13 tools, 6 hooks, context engine
β”œβ”€β”€ download.sh          ← Explicit binary fetch (macOS/Linux/Git Bash/WSL; optional - validates in-tree checksums)
β”œβ”€β”€ download.ps1         ← Explicit binary fetch (native Windows PowerShell; optional)
β”œβ”€β”€ BINARY_VERSION       ← Pinned binary release tag
β”œβ”€β”€ SHA256SUMS.txt       ← In-tree checksums (GENERATED by Build.yml; download.sh verifies against this)
β”œβ”€β”€ tests/               ← Plugin test suite
β”œβ”€β”€ README.md            ← This file
└── .gitignore

Binaries are never stored in this directory and register() never
downloads: the plugin downloads from the GitHub release only via the
explicit download.sh / download.ps1 setup step into
~/.hermes/aphrodite/binaries/ (the canonical runtime home), validated
against the in-tree SHA256SUMS.txt (refuse on mismatch). The plugin never
modifies ~/.hermes/plugins/aphrodite/.

README from the reviewed commit 47e7fa3; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section