Hermes Agent 8e1a88f106 fix(shim): self-healing canonical path resolution via /run/ump-memory/
LONG-STANDING PROBLEM (now permanently fixed):
  The ump-recall-mcp.js shim spawned a 'npx ump memory' child process
  with UMP_DIR inherited from the parent gateway's env. Profile
  configs (config.yaml) and parent processes had stale UMP_DIR values
  from before the ump store migration, so the child wrote to an empty
  directory. Result: krystie's ump.remember calls silently dropped.

NEW PATTERN:
  1. ump-memory.service publishes its UMP_DIR/HTTP/STORE via
     /run/ump-memory/ump-{dir,port,store}.txt on every (re)start.
     This file is the canonical source of truth.

  2. On every ump child spawn, the shim:
     a. Reads /run/ump-memory/ump-{dir,port,store}.txt (THE source)
     b. Strips UMP_* / SIDECAR_URL from parent's env (so stale values
        from profile configs cannot leak through)
     c. Spawns with the canonical values
     d. Audits the spawned child's env via /proc/<pid>/environ and
        logs FATAL if anything other than the canonical UMP_DIR was
        inherited

This breaks the recurring silent-drop pattern regardless of:
  - which profile is launching the gateway (krystie, default, future)
  - whether env vars are stale or fresh
  - whether the parent process is managed by systemd or launched by hand
  - whether config.yaml is pinned to a stale path

The only way to get the wrong UMP_DIR after this patch is if
/run/ump-memory/ump-dir.txt itself is wrong — and that file is
regenerated by ump-memory.service on every (re)start, so the only way
to make it wrong is to corrupt it intentionally.

Companion: krystie-hermes-gateway.service deploy asset (next commit)
makes krystie's gateway systemd-managed so its shim lifetime matches
ump-memory.service's lifetime.
2026-07-13 21:48:54 -07:00
2026-07-13 02:21:03 +00:00

self-directed-learning

Self-directed learning framework for Hermes / Krystie — multi-strategy retrieval over UMP memory, with skill detection, decay, and triadic review.

What this is

A continuous-learning loop for AI agents:

  • Retrieval substrate — multi-strategy (FTS5 + vector + graph) RRF fusion with ACT-R re-ranking, served as an MCP shim so Hermes/Krystie can use it transparently through their existing UMP tool surface.
  • Memory hygiene — nightly decay (per-kind rates, atomic writes, automatic backups), access tracking (frequency + last_accessed_at) feeding the decay and re-ranker.
  • Knowledge graph — entity extraction + typed relations + co-occurrence edges; BFS expansion surfaces related URNs even when the direct text doesn't match.
  • Triadic review — Claude + Codex (via Hermes OAuth / ChatGPT Pro subscription) as independent judges for claims before they're written to long-term memory.
  • Cron-driven framework — skill gap detection, spaced repetition, foraging, reflective journaling, self-measure. All run autonomously and feed back into the retrieval substrate.

Phases shipped

Phase What Tests
1 Sidecar on :4380 + 3-channel RRF baseline 0.500 → 1.000 (+50pp)
2 Graph channel (typed relations + co-occurrence) 12 unique top-5 graph-only wins
3 ACT-R re-ranker 84% top-5 retention, 4/20 #1 changes
4 Decay script 20/20 tests, nightly cron
5 Access tracking 28/28 tests, feeds decay + re-ranker
6 Co-occurrence edges (in code) (tests pending)
7 Triadic review (judge.py) Claude + Codex wired

Stack

  • Language: Node.js 18+ (sidecar, MCP shim), Python 3.11+ (decay, framework scripts)
  • Dependencies: UMP (@universalmemoryprotocol/core 0.1.0), Ollama (snowflake-arctic-embed2 1024-dim), Qdrant (memories_ump collection), Express, undici, MCP SDK 1.29.
  • Repo: http://100.81.59.99/sami7777/self-directed-learning (DNS3 Gitea)
  • Local path: /root/ump-recall/ (directory name kept for stability of running processes; only the repo was renamed)

Run

npm start                          # sidecar on :4380
node src/ump-recall-mcp.js         # MCP shim (stdio)
python3 scripts/ump_decay.py --apply    # nightly decay
python3 scripts/judge.py --claim "..."  # Claude + Codex review
npm test                           # full test suite

Architecture

See /root/.hermes/skills/autonomous-ai-agents/agent-self-improvement-framework/ for the full framework spec.

S
Description
Self-directed learning framework for Hermes/Krystie: multi-strategy retrieval (3-channel RRF + ACT-R re-rank), decay, access tracking, triadic review (Claude + Codex judges). Replaces ump-recall.
Readme MIT 170 KiB
Languages
JavaScript 52.1%
Python 47.9%