hermes - 💡(How to fix) Fix [IMPROVEMENT] Mnemosyne SQLite DB may not be in WAL mode under concurrent access [1 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#20351Fetched 2026-05-06 06:37:13
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Code Example

PRAGMA journal_mode=WAL;
PRAGMA synchronous=NORMAL;
RAW_BUFFERClick to expand / collapse

Severity: Medium

Problem: ~/.hermes/mnemosyne/data/mnemosyne.db is an SQLite database accessed by concurrent writers (skill writes from agent sessions, cron job reads/searches). If it is in the default rollback journal mode, concurrent readers can block writers and vice versa, potentially causing database is locked errors or timeouts under load.

Proposed fix: On first boot or via a hermes db migrate command, run:

PRAGMA journal_mode=WAL;
PRAGMA synchronous=NORMAL;

WAL mode allows concurrent reads without blocking writes and is safe for Hermes's concurrent access pattern.

extent analysis

TL;DR

Switching to Write-Ahead Logging (WAL) journal mode and setting synchronous to NORMAL can resolve the database locking issue.

Guidance

  • Run the proposed SQL commands PRAGMA journal_mode=WAL; and PRAGMA synchronous=NORMAL; on the SQLite database to enable WAL mode and adjust the synchronous setting.
  • Verify that the database is no longer locked by checking for database is locked errors or timeouts under load after applying the changes.
  • Consider implementing the proposed fix via a hermes db migrate command for easier management and automation.
  • Test the changes under concurrent access conditions to ensure the fix resolves the issue without introducing new problems.

Example

PRAGMA journal_mode=WAL;
PRAGMA synchronous=NORMAL;

This SQL code snippet sets the journal mode to WAL and adjusts the synchronous setting, as proposed in the issue.

Notes

The effectiveness of this fix relies on the specific concurrent access pattern of the application. If the access pattern changes, the fix may need to be reevaluated.

Recommendation

Apply the proposed workaround by running the SQL commands to switch to WAL mode and adjust the synchronous setting, as this is a targeted solution to the described issue.

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