Skip to content

Commit cde0bbe

Browse files
committed
docs(knowledge): the keyword legs cut a CJK run into pieces; pgvector matches a caseless piece by LIKE; the contract's keywordLeg case
Claude-Session: https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 81be16f commit cde0bbe

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎content/docs/protocol/knowledge.mdx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ one that does not keeps receiving whole documents, and a `whole` document over
546546
the embedder's budget is removed and reported; and the index fingerprint of
547547
§3.6 — that every call carries one, that a write or a search under another
548548
is refused by code, a complete reindex as one build, and, for an adapter that
549-
keeps generations, the switch at the end of a build. `implements` declares the optional members, and the suite
549+
keeps generations, the switch at the end of a build; and, for an adapter that declares the optional
550+
`keywordLeg`, an unspaced Chinese question that ranks the passage holding its figure and words. `implements` declares the optional members, and the suite
550551
checks the declaration against the adapter. `./testing` is a test-only,
551552
ESM-only entry that imports `vitest`; nothing in the runtime entry reaches it.
552553
`knowledge-memory` runs it as the reference implementation; `knowledge-pgvector`
@@ -727,7 +728,9 @@ an exact scan.
727728
scan by cosine distance, so any width works — including a 3072-wide model —
728729
and a keyword leg on `to_tsvector('simple', content)` (a GIN expression
729730
index), a word of three characters or more as a phrase, a shorter term or
730-
one in Han, kana or Hangul script by `ILIKE`. The organization filter, the
731+
one in Han, kana or Hangul script as a substring (`LIKE` for a term without
732+
a cased letter, `ILIKE` otherwise); a run of Han, kana or Hangul in the
733+
query is cut into overlapping pieces of three characters and of two. The organization filter, the
731734
[record scope](#record-scope) and the metadata `filter` (equality per key)
732735
are one `WHERE`, run in both legs before either ranks.
733736
`queryPrefix` is put before every query before it is embedded, for a model
@@ -794,7 +797,9 @@ large source of one organization, through an approximate index.
794797
at most `topK`) before the service's re-check: a vector leg by cosine
795798
distance (an exact scan, or the approximate index below), and a keyword leg in a contentless FTS5 trigram index beside each
796799
passage table (kept in step by triggers), a term of three characters or
797-
more as a quoted phrase, a shorter one by `LIKE`. The organization filter,
800+
more as a quoted phrase, a shorter one by `LIKE`; a run of Han, kana or
801+
Hangul in the query is cut into overlapping pieces of three characters and
802+
of two. The organization filter,
798803
the [record scope](#record-scope) and the metadata `filter` (JSON equality
799804
per key) are one `WHERE`, run in both legs. Without the approximate index
800805
the vector leg reads every row in scope: 1,000 passages of 1,536 dimensions take 8.3 MB and a search about

0 commit comments

Comments
 (0)