Skip to main content

context-compiler integration for Hermes Agent - Memory and Context Management

Project description

FormalCC Hermes Plugin

FormalCC integration for Hermes Agent, providing compiler-grade context compression and memory management.

Overview

This plugin integrates FormalCC's context runtime and memory system with Hermes Agent through two provider plugins:

  • formalcc-memory: Memory provider for prefetch, sync, and session management
  • formalcc-engine: Context engine for compiler-grade context compression

Features

  • ๐Ÿง  Memory Prefetch: Retrieve relevant context before model invocations
  • ๐Ÿ”„ Turn Synchronization: Async memory updates without blocking responses
  • ๐ŸŽฏ Scene Routing: Server-side routing for coding/vision/general contexts
  • ๐Ÿ› ๏ธ Memory Tools: Expose memory search and profile tools to the model
  • ๐Ÿ“Š Graceful Degradation: Continue operation when Runtime API is unavailable
  • ๐Ÿ” Enterprise Ready: OAuth2/API key auth, profile isolation, diagnostics

Installation

Mode A: Git Install (PoC)

hermes plugins install your-org/formalcc-hermes-plugin

Mode B: pip Install (Enterprise)

pip install formalcc-hermes-plugin

Configuration

1. Set API Key

export FORMALCC_API_KEY=fsy_live_your_key_here

2. Activate in Hermes Config

Edit your Hermes config.yaml:

memory:
  provider: "formalcc-memory"

context:
  engine: "formalcc-engine"

formalcc:
  base_url: "https://api.formsy.ai"
  workspace_id: "ws_default"
  tenant_id: "your_tenant"
  timeout_s: 30
  enable_memory_tools: true

3. Verify Installation

hermes formalcc-memory status
hermes formalcc-memory test

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Hermes Agent                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              formalcc-hermes-plugin                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚ formalcc-memory  โ”‚      โ”‚ formalcc-engine  โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              FormalCC Runtime API Service                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Usage

Once configured, the plugins work automatically:

  • Memory prefetch happens before each model call
  • Turn sync happens after each assistant response
  • Context compression triggers when token count exceeds threshold
  • Memory tools are available to the model when enabled

Memory Tools

When enable_memory_tools: true, the model can use:

# Search memory
cc_memory_search(query="authentication flow", limit=10)

# Get memory profile
cc_memory_profile()

Development

Setup

git clone https://github.com/your-org/formalcc-hermes-plugin.git
cd formalcc-hermes-plugin
pip install -e ".[dev]"

Run Tests

pytest tests/
pytest tests/ --cov=plugins --cov=shared

Code Quality

black .
ruff check .

CLI Commands

Memory Provider

# Check status
hermes formalcc-memory status

# Test connectivity
hermes formalcc-memory test

# Show configuration
hermes formalcc-memory config

Compatibility

Hermes Version Plugin Version Runtime API Version Status
0.9.x 0.1.0 v0.3 โœ“ Supported
1.0.x 0.1.0 v0.3 โœ“ Supported

Documentation

License

MIT License - see LICENSE for details.

Support

For issues and questions:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_compiler_hermes_plugin-0.3.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_compiler_hermes_plugin-0.3.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file context_compiler_hermes_plugin-0.3.0.tar.gz.

File metadata

File hashes

Hashes for context_compiler_hermes_plugin-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0bd677b52475f816b074caf60ed0a8edfe51620833b78e29cdae2e96be0cb5f1
MD5 984a699c11e8ee64ac02c1c755a937da
BLAKE2b-256 13a58a4b3963fbeb5bf1ccad1c0b77d6915be79429935433b0cf60136de4335c

See more details on using hashes here.

File details

Details for the file context_compiler_hermes_plugin-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for context_compiler_hermes_plugin-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24e8e3454bae7b83eb2d9d6e37da2db3e6ac11348ff9d84fa33bc153e0aa5f7f
MD5 ad7666a9a73d644ee888e5be4a942fc9
BLAKE2b-256 6649ca82e95feafba6f0d348c576197cc9153369cb69cba5090d4e4a98fbc9a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page