Skip to content

docs(memory-search): document FTS5 query syntax#49

Closed
Istar-Eldritch wants to merge 1 commit into
chandra447:mainfrom
Istar-Eldritch:fix/fts5-phrase-search
Closed

docs(memory-search): document FTS5 query syntax#49
Istar-Eldritch wants to merge 1 commit into
chandra447:mainfrom
Istar-Eldritch:fix/fts5-phrase-search

Conversation

@Istar-Eldritch
Copy link
Copy Markdown

@Istar-Eldritch Istar-Eldritch commented May 21, 2026

Problem

The query parameter of memory_search is passed directly to SQLite FTS5, but this was not documented. Agents passing multi-word natural language queries (e.g. database migration) expect fuzzy/AND matching, but FTS5 treats unquoted multi-word input as a phrase search — requiring the words to appear consecutively. This causes searches to silently return zero results even when relevant entries exist.

Fix

Document the FTS5 query syntax in both the tool description and the parameter description so agents construct effective queries:

  • Single word: auth
  • Exact phrase: "database migration"
  • Proximity: NEAR("deploy" "config", 10)
  • Boolean: auth AND token, auth OR oauth, auth NOT oauth

No code change — the existing FTS5 passthrough already supports all of this.

@Istar-Eldritch Istar-Eldritch force-pushed the fix/fts5-phrase-search branch from cf5ab6d to 031b2c4 Compare May 21, 2026 22:29
@Istar-Eldritch Istar-Eldritch changed the title fix(search): quote individual FTS5 terms instead of whole phrase docs(memory-search): document FTS5 query syntax in tool description May 21, 2026
@Istar-Eldritch Istar-Eldritch force-pushed the fix/fts5-phrase-search branch from 031b2c4 to 47fd1da Compare May 21, 2026 22:29
@Istar-Eldritch Istar-Eldritch changed the title docs(memory-search): document FTS5 query syntax in tool description docs(memory-search): document FTS5 query syntax May 21, 2026
The query parameter uses SQLite FTS5 under the hood. Without knowing
the syntax, agents pass multi-word natural language queries which get
treated as exact phrase searches and return zero results.

Document the supported syntax: single terms, exact phrases (quotes),
NEAR proximity, and AND/OR/NOT boolean operators so agents can construct
effective queries.
@Istar-Eldritch Istar-Eldritch force-pushed the fix/fts5-phrase-search branch from 47fd1da to 60ddd6b Compare May 21, 2026 22:38
@Istar-Eldritch
Copy link
Copy Markdown
Author

Closing in favour of an issue — the docs-only approach is insufficient since agents can't reliably infer FTS5 syntax from the description alone. The underlying escapeFts5Query fix (quoting individual terms instead of the whole phrase) is the correct solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant