hermes - 💡(How to fix) Fix [Feature]: allow memory provider tools in cron jobs via per-job `allow_memory` flag [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#18885Fetched 2026-05-03 04:53:43
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
labeled ×5commented ×2renamed ×1

Error Message

Add a per-job allow_memory boolean field (default false) to the cronjob schema. When true, the scheduler passes skip_memory=False and a distinct agent_context="memory_maintenance" to AIAgent. Memory providers recognize this context as an explicit opt-in exception to the cron guard.

Root Cause

Concrete use case: the holographic-memory-reflect skill runs a 7-step autonomous synthesis pipeline — it reads all facts with trust >= 0.5, infers higher-order claims, writes them as new facts at trust 0.3, and runs contradiction detection. This is a textbook cron workload. Today it falls back to raw SQLite CLI commands because fact_store is absent from the tool registry in cron context.

Fix Action

Fix / Workaround

  • Raw SQLite fallback: The holographic-memory-reflect skill already documents this workaround — it uses terminal + execute_code to read/write memory_store.db directly. This bypasses the provider abstraction entirely, is fragile, and requires the skill to know internal DB schema details.
  • context_from chaining: Useful for passing data between jobs, but does not give the agent access to memory tools.
  • Always enable memory in cron: Would silently break the existing safety guarantee for all existing jobs. Opt-in via allow_memory=True is lower risk.

Code Example

agent = AIAgent(  
    ...  
    skip_memory=True,  # Cron system prompts would corrupt user representations  
    platform="cron",  
    ...  
)

---

cronjob(  
    action="create",  
    name="holographic-memory-reflect",  
    schedule="0 22 * * *",          # 22:00 WIB daily  
    allow_memory=True,  
    enabled_toolsets=["memory", "terminal", "file"],  
    skills=["holographic-memory-reflect"],  
    prompt="Run the full reflect pipeline as documented in the skill.",  
)

---
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Hermes supports memory provider plugins (holographic, honcho, etc.) that accumulate facts and user representations over time. These stores benefit from periodic autonomous maintenance: deduplication, trust-score recalibration, contradiction resolution, and higher-order inference passes. A scheduled cron job is the natural vehicle for this — it runs unattended, on a fixed cadence, with no user present.

Currently this is impossible. run_job() in cron/scheduler.py hardcodes skip_memory=True for every cron session with no per-job override:

agent = AIAgent(  
    ...  
    skip_memory=True,  # Cron system prompts would corrupt user representations  
    platform="cron",  
    ...  
)

This causes _memory_manager to be None for all cron sessions, so memory provider tools (fact_store, fact_feedback, Honcho tools, etc.) are never injected into the agent's tool list. A second independent guard in HonchoMemoryProvider.initialize() also bails out when platform == "cron". The result: there is no supported path to run a memory synthesis or cleanup job via cron, even when that is the job's explicit purpose.

Concrete use case: the holographic-memory-reflect skill runs a 7-step autonomous synthesis pipeline — it reads all facts with trust >= 0.5, infers higher-order claims, writes them as new facts at trust 0.3, and runs contradiction detection. This is a textbook cron workload. Today it falls back to raw SQLite CLI commands because fact_store is absent from the tool registry in cron context.

Proposed Solution

Add a per-job allow_memory boolean field (default false) to the cronjob schema. When true, the scheduler passes skip_memory=False and a distinct agent_context="memory_maintenance" to AIAgent. Memory providers recognize this context as an explicit opt-in exception to the cron guard.

Example:

cronjob(  
    action="create",  
    name="holographic-memory-reflect",  
    schedule="0 22 * * *",          # 22:00 WIB daily  
    allow_memory=True,  
    enabled_toolsets=["memory", "terminal", "file"],  
    skills=["holographic-memory-reflect"],  
    prompt="Run the full reflect pipeline as documented in the skill.",  
)

Implementation Notes

The change touches five layers, following the same pattern as enabled_toolsets and workdir:

  • tools/cronjob_tools.py — Add allow_memory: bool to CRONJOB_SCHEMA parameters (alongside workdir and enabled_toolsets) and to the cronjob() function signature. Pass it through to create_job/update_job in cron/jobs.py. cronjob_tools.py:542-553

  • cron/jobs.py — Store allow_memory in the job record (same JSON-field pattern as enabled_toolsets).

  • cron/scheduler.py — In run_job(), replace the hardcoded skip_memory=True with skip_memory=not job.get("allow_memory", False). When allow_memory is set, also pass a new kwarg (e.g. memory_context="memory_maintenance") so AIAgent can thread it into the provider initialize() call instead of the hardcoded "primary". scheduler.py:1044-1057

  • run_agent.py — The _init_kwargs block currently hardcodes agent_context: "primary". Accept an optional memory_context parameter on AIAgent.init and use it here when provided. run_agent.py:1705-1710

Memory provider cron guards:

  • plugins/memory/honcho/init.py: update the cron guard to pass through when agent_context == "memory_maintenance". init.py:283-290
  • plugins/memory/holographic/init.py: currently has no cron guard — it would initialize fine once skip_memory is lifted. Add a guard for consistency and exempt "memory_maintenance" from it. init.py:158-181
  • agent/memory_provider.py: document "memory_maintenance" as a valid agent_context value in the initialize() docstring. memory_provider.py:74-76

Alternatives Considered

  • Raw SQLite fallback: The holographic-memory-reflect skill already documents this workaround — it uses terminal + execute_code to read/write memory_store.db directly. This bypasses the provider abstraction entirely, is fragile, and requires the skill to know internal DB schema details.
  • context_from chaining: Useful for passing data between jobs, but does not give the agent access to memory tools.
  • Always enable memory in cron: Would silently break the existing safety guarantee for all existing jobs. Opt-in via allow_memory=True is lower risk.

Feature Type

Other

Scope

Medium (few files, < 300 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

To enable memory provider plugins for cron jobs, add a per-job allow_memory boolean field to the cronjob schema and modify the scheduler to pass skip_memory=False when this field is True.

Guidance

  • Add allow_memory: bool to the CRONJOB_SCHEMA parameters in tools/cronjob_tools.py and pass it through to create_job/update_job in cron/jobs.py.
  • Update the run_job function in cron/scheduler.py to replace the hardcoded skip_memory=True with skip_memory=not job.get("allow_memory", False).
  • Modify the AIAgent initialization in run_agent.py to accept an optional memory_context parameter and use it when provided.
  • Update the cron guards in memory provider plugins (e.g., honcho, holographic) to pass through when agent_context == "memory_maintenance".

Example

cronjob(
    action="create",
    name="holographic-memory-reflect",
    schedule="0 22 * * *",
    allow_memory=True,
    enabled_toolsets=["memory", "terminal", "file"],
    skills=["holographic-memory-reflect"],
    prompt="Run the full reflect pipeline as documented in the skill.",
)

Notes

The proposed solution requires modifications to multiple files and layers, following the same pattern as enabled_toolsets and workdir. The changes aim to provide a safe and opt-in way to enable memory provider plugins for specific cron jobs.

Recommendation

Apply the proposed workaround by adding the allow_memory field to the cronjob schema and modifying the scheduler and memory provider plugins accordingly. This approach provides a lower-risk opt-in solution compared to always enabling memory in cron jobs.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: allow memory provider tools in cron jobs via per-job `allow_memory` flag [2 comments, 2 participants]