Skip to content

fix(memory): 4 holographic memory bug fixes (#14024 #17899 #17350 #22907)#23221

Closed
dusterbloom wants to merge 1 commit into
NousResearch:mainfrom
dusterbloom:fix/holographic-memory-bugs
Closed

fix(memory): 4 holographic memory bug fixes (#14024 #17899 #17350 #22907)#23221
dusterbloom wants to merge 1 commit into
NousResearch:mainfrom
dusterbloom:fix/holographic-memory-bugs

Conversation

@dusterbloom

Copy link
Copy Markdown
Contributor

Summary

Four bug fixes for the holographic memory plugin, all reported and validated by the community.

1. FTS5 query sanitization (#14024, #21102)

Hyphenated tokens (pve-01, lxc-103) crashed FTS5 MATCH with "no such column" errors. The unicode61 tokenizer treats - as a column filter operator.

Fix: _sanitize_fts_query() splits on hyphens/punctuation and double-quotes each token. Three-tier fallback: quoted AND → quoted AND retry → OR. Also handles C++, field:value, AND/OR/NOT, wildcards, SQL injection attempts.

2. retrieval_count never incremented (#17899)

FactRetriever.search() bypassed store.search_facts(), the only place that bumped the counter. The field was always 0.

Fix: Increment retrieval_count for returned facts directly in FactRetriever.search(), with silent error handling.

3. Silent numpy degradation (#17350)

When numpy was missing, HRR operations silently fell back to FTS5-only. No warning, no hermes doctor detection. Users had no idea probe/reason/contradict were degraded.

Fix: initialize() logs a WARNING. system_prompt_block() includes a visible WARNING so the agent (and user) know HRR is disabled.

4. auto_extract saves raw messages (#22907)

The regex patterns matched "I like / I want / I need" and dumped the entire user message verbatim as a fact. "I like that, sounds good" became a stored fact.

Fix: Removed noisy "like/love/want/need" patterns. Remaining patterns extract captured groups into clean declarative statements: "prefers dark mode over light mode" instead of "I prefer dark mode over light mode, can you set it up?". 200 char cap, one fact per message, assistant messages skipped.

Test plan

  • 41 new tests in tests/plugins/memory/test_holographic_fixes.py
  • 21 parametrized fuzz tests with adversarial inputs (SQL injection, null bytes, FTS5 operators, emojis, etc.)
  • All 201 tests in tests/plugins/memory/ passing
  • End-to-end verified against real memory_store.db:
    • pve-01, pihole-02, lxc-103 searches: 1 result each (was crashing)
    • retrieval_count incremented on search
    • All 9 fuzz queries: zero crashes
    • auto_extract produces clean declarative facts, no raw dumps

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 11, 2026
@dusterbloom dusterbloom force-pushed the fix/holographic-memory-bugs branch 3 times, most recently from ec027db to 4010e2a Compare May 17, 2026 20:32
@dusterbloom

dusterbloom commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

@alt-glitch Rebased onto latest main (bdc2113) — mergeable, no conflicts.

This PR fixes 4 open bugs in the holographic memory plugin that have been open for months:

All 4 issues are still open and affecting users. Ready for review.

Fixes NousResearch#14024, NousResearch#17899, NousResearch#17350, NousResearch#22907

1. FTS5 query sanitization (NousResearch#14024, NousResearch#21102)
   - Hyphenated tokens (pve-01, lxc-103) no longer crash FTS5 MATCH
   - Three-tier fallback: quoted AND -> quoted AND retry -> OR
   - Handles C++, field:value, AND/OR/NOT operators, wildcards

2. retrieval_count increment (NousResearch#17899)
   - FactRetriever.search() now increments retrieval_count for
     returned facts, previously always stuck at 0

3. numpy degradation warning (NousResearch#17350)
   - initialize() logs WARNING when numpy is missing
   - system_prompt_block() includes visible WARNING so the agent
     knows HRR operations are disabled

4. auto_extract structured extraction (NousResearch#22907)
   - Removed noisy 'I like/love/want/need' patterns
   - Extracts clean declarative facts from captured groups:
     'prefers dark mode over light mode' instead of raw message dump
   - 200 char cap, one fact per message, assistant messages ignored

Tests: 41 new tests including 21 fuzz edge cases, all passing.
End-to-end verified against real memory_store.db.
@dusterbloom dusterbloom closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants