ebbinghaus-provider-direct
Run Ebbinghaus memory provider from source for cron jobs.
- License 许可
- MIT
- 所属仓库
- zapabob/Skills
- 最近更新
- 2026-10-26
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- ebbinghaus-provider-direct
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "memory", "ebbinghaus", "cron", "automation", "sleep", "provider" ], "related_skills": [ "ebbinghaus-memory", "agent-memory-consolidation", "note-taking/obsidian" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Run Ebbinghaus memory provider from source for cron jobs.
03 SKILL.md 正文
Ebbinghaus Provider Direct Invocation
Use this when you need to drive the Ebbinghaus memory provider from a Python
script — typically a cron job, a batch stats pass, or any context where the
ebbinghaus_memory agent tool is not exposed in the active tool surface.
NOTE: The bundled
ebbinghaus-memoryskill's fallback section documents this same scenario but with two inaccuracies (it implies an async API and importsget_hermes_homefromcore.utils). This skill is the verified, fork-accurate version. Recommendhermes curator adopt ebbinghaus-memoryto fix the bundled fallback.
When to use
- A scheduled/cron task must run an Ebbinghaus
sleep/statscycle with no user present and no agent tool surface. - You want to verify memory counts before/after programmatically.
- You are writing a probe/test against
plugins/memory/ebbinghaus/.
Prerequisites
- Run with the project venv Python (the provider imports
hermes_constantsandplugins.*, which must resolve from the fork root):- Windows:
.venv/Scripts/python.exe script.py - macOS/Linux:
.venv/bin/python script.py
- Windows:
- The script's
sys.pathmust include the fork root (setHERMES_REPOor run with cwd = fork root). - Do NOT import
core.utils;get_hermes_homelives in top-levelhermes_constants. - hakua-memory v0.3.5+ installed in the environment (
pip install -e /path/to/hakua-memory) - Python >=3.11 required (hakua-memory v0.3.5+ drops Python 3.10 support)
Verified recipe
import json, os, sys
REPO = os.environ.get("HERMES_REPO", os.getcwd())
sys.path.insert(0, REPO)
from plugins.memory.ebbinghaus import EbbinghausMemoryProvider
from hermes_constants import get_hermes_home
p = EbbinghausMemoryProvider()
# initialize is SYNCHRONOUS and requires session_id as the 1st positional arg.
p.initialize("cron-memory-sleep", hermes_home=str(get_hermes_home()))
pre = json.loads(p.handle_tool_call("ebbinghaus_memory", {"action": "stats"}))
sleep = json.loads(p.handle_tool_call("ebbinghaus_memory", {
"action": "sleep",
"prune": True, # -> prune_mode "delete" (physical delete)
"rehearse_threshold": 0.45,
"forget_threshold": 0.08,
"salience_keep_threshold": 0.7,
"limit": 200,
}))
post = json.loads(p.handle_tool_call("ebbinghaus_memory", {"action": "stats"}))
p.shutdown()
print(json.dumps({"pre": pre, "sleep": sleep, "post": post}, ensure_ascii=False, default=str))
A known-good, ready-to-run copy lives at templates/ebbinghaus_sleep_cron.py.
Critical API facts (verified on this fork)
- Everything is synchronous.
initialize(session_id, hermes_home=...),handle_tool_call("ebbinghaus_memory", args) -> str(JSON string, NOT a dict, NOT awaitable), andshutdown()are all plain methods. Do NOTawaitthem. handle_tool_callreturns a JSON string;json.loads(...)it.initializesignature isinitialize(self, session_id, **kwargs). Pass a dummy session id (e.g."cron-memory-sleep");hermes_homegoes in kwargs.- Correct imports:
from plugins.memory.ebbinghaus import EbbinghausMemoryProviderfrom hermes_constants import get_hermes_home(NOTcore.utils)
Sleep parameter semantics
prune=trueresolves toprune_mode="delete"(physical row DELETE).prune_modeacceptsnone | archive | delete. Leavepruneunset to use the plugin default (usuallyarchive).forget_threshold,rehearse_threshold,salience_keep_thresholdare floats in[0, 1], clamped internally.
Stats & verification
stats()returns a dict. Useful keys:count= total memories across all states (use this to verify deletes).active_count,archived_count,retained_count,avg_salience,rehearsal_count,retrieval_count.
sleep_cycle()returns a dict with:reviewed(int),rehearsed(list of ids),forgotten(list of ids),pruned(list of ids),archived(list),active_count,archived_count.- Verification rule: the
sleeptool output can under-report changes. Always confirm by comparingstats()['count']BEFORE vs AFTER. Adeleteprune dropscountby exactlylen(pruned). (Verified: 2293 -> 2218 = 75 pruned.)
Platform / repo quirks (this fork, Windows host)
- venv layout is
.venv/Scripts/python.exe(Windows), not.venv/bin/activate. search_files(ripgrep-backed) returns IO errors on repo paths containing spaces (e.g.%USERPROFILE%\Documents\New project\hermes-agent). Useterminalgrep/lsfor discovery on this checkout.
Pitfalls
- Do not
awaitany provider call — they are sync and the await will raiseTypeError: 'str'/'NoneType' is not awaitable. - Do not import
get_hermes_homefromcore.utils—ModuleNotFoundError. prune=truephysically deletes rows; counts are irreversible. Usearchivemode if you only want to hide, not delete.- Re-running a
sleepmutates state — do not re-run just to "verify"; use apy_compilesyntax check or a no-sleepstats-only dry run for re-verification. - Do not estimate counts from the
sleepoutput. Uselen(sleep["rehearsed"])for rehearsed count,len(sleep["pruned"])for pruned count, or diffstats()["sleep_rehearsal_count"]/stats()["count"]before vs after. - On some Windows installs,
pythonis a non-functional WindowsApps stub. Usepy -3instead, or the project venv at.venv/Scripts/python.exe.
04 同仓库更多 Skills
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
writing-plans
Write implementation plans: bite-sized tasks, paths, code.
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
weights-and-biases
W&B: log ML experiments, sweeps, model registry, dashboards.
watchers
Poll RSS, JSON APIs, and GitHub with watermark dedup.
serving-llms-vllm
vLLM: high-throughput LLM serving, OpenAI API, quantization.