hermes - 💡(How to fix) Fix Cognee memory-provider integration: raise RLIMIT_NOFILE for Lance-backed recall and mirror on_memory_write [1 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#14368Fetched 2026-04-24 06:17:36
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

This is about a local Cognee memory-provider integration used with Hermes on macOS. The Cognee plugin itself is not currently tracked in upstream NousResearch/hermes-agent, but the behavior gap is specific to the Hermes memory-provider contract / runtime environment and needs a canonical issue reference for the local patch.

Error Message

LanceError(IO): Too many open files (os error 24)

Root Cause

Without these two behaviors:

  • live Cognee recall in gateway sessions can fail under normal macOS limits
  • Hermes built-in durable memories and Cognee drift apart semantically

Fix Action

Fix / Workaround

Context

This is about a local Cognee memory-provider integration used with Hermes on macOS. The Cognee plugin itself is not currently tracked in upstream NousResearch/hermes-agent, but the behavior gap is specific to the Hermes memory-provider contract / runtime environment and needs a canonical issue reference for the local patch.

Code Example

LanceError(IO): Too many open files (os error 24)
RAW_BUFFERClick to expand / collapse

Context

This is about a local Cognee memory-provider integration used with Hermes on macOS. The Cognee plugin itself is not currently tracked in upstream NousResearch/hermes-agent, but the behavior gap is specific to the Hermes memory-provider contract / runtime environment and needs a canonical issue reference for the local patch.

Problems

1) Lance-backed recall fails under the default macOS soft maxfiles limit

In a live Hermes gateway process, cognee_recall failed with:

LanceError(IO): Too many open files (os error 24)

Observed runtime state:

  • process soft maxfiles limit: 256
  • live gateway process already had ~219 FDs open before recall
  • Cognee/Lance needed more headroom during recall

For this integration, a local fix raises RLIMIT_NOFILE to 4096 at provider initialization / recall-sensitive paths. A fresh process verified the helper raises 256 -> 4096 successfully when the hard limit allows it.

2) Built-in Hermes memory writes were not mirrored into Cognee

Hermes MemoryProvider exposes on_memory_write(action, target, content) specifically for mirroring built-in memory writes, but the local Cognee provider only handled:

  • prefetch()/queue_prefetch()
  • sync_turn()
  • on_session_end()

Result: memory / user writes made through Hermes did not land in Cognee's durable graph lane.

A local fix adds on_memory_write() support for add / replace and mirrors those writes into Cognee's permanent remember path.

Why this matters

Without these two behaviors:

  • live Cognee recall in gateway sessions can fail under normal macOS limits
  • Hermes built-in durable memories and Cognee drift apart semantically

Local fix shape

  • best-effort RLIMIT_NOFILE raise in the provider before Lance/Kuzu-heavy operations
  • on_memory_write() implementation that mirrors add / replace writes into Cognee permanent memory
  • regression tests for both behaviors

Requested outcome

Even if Cognee is not merged upstream today, keep this issue as the canonical reference for the integration gap so the behavior is not lost:

  • provider integrations backed by Lance/Kuzu need a maxfiles strategy on macOS
  • memory providers intended for durable parity should implement on_memory_write()

extent analysis

TL;DR

Raise the RLIMIT_NOFILE limit to 4096 and implement on_memory_write() to mirror Hermes built-in memory writes into Cognee's durable graph lane.

Guidance

  • To fix the "Too many open files" error, increase the RLIMIT_NOFILE limit to 4096 at provider initialization or recall-sensitive paths.
  • Implement on_memory_write() in the Cognee provider to handle add and replace writes and mirror them into Cognee's permanent remember path.
  • Verify the fix by checking the process's open file limit and testing memory writes through Hermes to ensure they are reflected in Cognee.
  • Consider adding regression tests to ensure the behaviors are maintained.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The fix is specific to the local Cognee memory-provider integration with Hermes on macOS and may not apply to other environments or configurations.

Recommendation

Apply the workaround by raising the RLIMIT_NOFILE limit and implementing on_memory_write() to ensure durable parity between Hermes and Cognee. This is necessary to prevent recall failures and ensure that memory writes are properly mirrored.

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