# NousResearch/hermes-agent · FTS5 query sanitization: hyphens, operators, quoting

## Open now

- 2 issues, 5 PRs open on GitHub.
- #14024: \[Bug\]: fact_store search action fails with "no such column" error on hyphenated queries (FTS5 tokenization)
- #56871: session_search silently returns empty for stacked/adjacent FTS5 boolean operators (a AND OR b, AND NOT x)
- PR #14033: fix(memory): sanitize holographic fact_store FTS queries
- PR #14262: fix(memory/holographic): sanitize hyphenated tokens in FTS5 queries
- PR #14794: fix(tools): auto-quote hyphenated tokens in fact_store FTS5 queries
- PR #39663: fix(memory): sanitize FTS5 queries to prevent crashes on hyphenated tokens (#14024)
- PR #91075: fix(state): collapse stacked/adjacent FTS5 boolean operators instead of a silent empty search

These issues and fixes all concern malformed or mishandled FTS5 queries involving hyphenated tokens, stacked/adjacent boolean operators, and dotted or special-character terms that cause silent empty results or crashes. The work spans session search, fact_store, and holographic memory components.

## TL;DR

- 16 member(s): 2 open issue(s), 3 closed issue(s), 5 open PR(s), 1 merged PR(s), 5 PR(s) closed without merging.
- A fix was merged to main in PR #1776. Verify it addresses your case.
- **Recommended:** read PR #1776 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-1776`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.11`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #14024: \[Bug\]: fact_store search action fails with "no such column" error on hyphenated queries (FTS5 tokenization)
- #56871: session_search silently returns empty for stacked/adjacent FTS5 boolean operators (a AND OR b, AND NOT x)

## Closed / duplicate issues

- #1770: session_search mishandles hyphenated FTS5 queries and strips quoted literals
- #7824: Session search broad FTS query can fail on hyphenated OR terms
- #21102: Holographic memory: \`fact_store action="search"\` silently returns 0 results when query contains FTS5 operator characters (e.g. hyphens)

## Prior & competing PRs

- **#1776: fix: handle hyphenated FTS5 queries and preserve quoted literals**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `hermes_state.py`, `tests/test_hermes_state.py`
- **#56872: fix(agent): collapse stacked FTS5 boolean operators in session search**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#48212`, `#48212`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#1773: fix: handle hyphenated FTS5 queries and preserve quoted literals**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#1777: fix(search): handle hyphenated queries and preserve quoted literals in FTS5**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#1776`
- **#7820: fix: sanitize hyphenated session-search FTS queries**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#14033: fix(memory): sanitize holographic fact_store FTS queries**. open
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#11333`, `#6667`
  - files: `plugins/memory/holographic/retrieval.py`, `plugins/memory/holographic/store.py`, `tests/plugins/memory/test_holographic_provider.py`
- **#14262: fix(memory/holographic): sanitize hyphenated tokens in FTS5 queries**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `40dbfa0e3ce85dc0d63f1ebe1319d212c53d3511`, `38e7bd8a08a9df450b7d8661778ecc47f25323c2`
  - files: `agent/error_classifier.py`, `gateway/run.py`, `plugins/memory/holographic/retrieval.py`
- **#14794: fix(tools): auto-quote hyphenated tokens in fact_store FTS5 queries**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#14033`, `#14024`, `#14262`, `#14024`, `#14794`, `#14033`
  - files: `plugins/memory/holographic/retrieval.py`, `tests/plugins/memory/test_fts5_hyphen_sanitizer.py`
- **#39663: fix(memory): sanitize FTS5 queries to prevent crashes on hyphenated tokens (#14024)**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `plugins/memory/holographic/retrieval.py`, `tests/plugins/memory/test_holographic_fixes.py`
- **#64209: fix(holographic): hyphenated-identifier search returned 0 results**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#14033`, `#14024`, `#14033`, `#39664`
- **#91075: fix(state): collapse stacked/adjacent FTS5 boolean operators instead of a silent empty search**. open
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#48212`, `#56871`, `#48212`, `#48212`
  - files: `hermes_state_search.py`, `tests/test_hermes_state.py`

## Fix status

- Merged to main in PR #1776 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-03-17`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `agent`
