docs(memory-search): document FTS5 query syntax#49
Closed
Istar-Eldritch wants to merge 1 commit into
Closed
Conversation
cf5ab6d to
031b2c4
Compare
031b2c4 to
47fd1da
Compare
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.
47fd1da to
60ddd6b
Compare
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
queryparameter ofmemory_searchis 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:
auth"database migration"NEAR("deploy" "config", 10)auth AND token,auth OR oauth,auth NOT oauthNo code change — the existing FTS5 passthrough already supports all of this.