fleet-memory/hindsight-integrations/hermes/hindsight_hermes/__init__.py
Nicolò Boschi 0ff36548e0
feat(hermes): file-based config + updated docs (#686)
* feat(hermes): file-based config + updated docs

Replace the old dataclass/configure() singleton with a plain dict
config loaded from ~/.hindsight/hermes.json — same field names and
conventions as the openclaw and claude-code integrations.

Loading order: defaults → config file → env var overrides.

- config.py: rewritten with load_config() returning a plain dict,
  DEFAULTS matching openclaw/claude-code fields, ENV_OVERRIDES with
  typed casting
- tools.py: register() uses load_config() instead of raw env vars
- __init__.py: clean exports (removed configure/get_config/reset_config)
- README.md: full rewrite with config file examples, tables by category
- docs/hermes.md: full rewrite with quick start, architecture, all
  config tables, gateway section, troubleshooting
- tests: updated for new config pattern, 46 tests pass

* ci: add test job for hermes integration

* chore: regenerate docs skill for hermes integration
2026-03-25 16:11:38 +01:00

52 lines
1.3 KiB
Python

"""Hindsight-Hermes: Persistent memory for Hermes agents.
Provides Hindsight retain/recall/reflect as native Hermes tools via the
plugin system or manual ``register_tools()`` call. When running on a
Hermes build that supports lifecycle hooks, the plugin also:
- **pre_llm_call** — recalls relevant memories and injects them into the
system prompt so the model has cross-session context on every turn.
- **post_llm_call** — retains the user/assistant exchange so it can be
recalled in future sessions.
Plugin usage (auto-discovery)::
pip install hindsight-hermes
# Configure via ~/.hindsight/hermes.json:
# {"hindsightApiUrl": "http://localhost:9077", "bankId": "my-agent"}
Manual usage::
from hindsight_hermes import register_tools
register_tools(
bank_id="my-agent",
hindsight_api_url="http://localhost:9077",
)
"""
from .config import (
USER_CONFIG_PATH,
load_config,
write_config,
)
from .errors import HindsightError
from .tools import (
get_tool_definitions,
memory_instructions,
register,
register_tools,
)
__version__ = "0.1.0"
__all__ = [
"USER_CONFIG_PATH",
"load_config",
"write_config",
"HindsightError",
"register_tools",
"register",
"memory_instructions",
"get_tool_definitions",
]