diff --git a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md index e8612d48a02..49cc9210340 100644 --- a/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md +++ b/docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md @@ -20,6 +20,7 @@ - **Amended** (2026-11-25, [#37324](https://github.com/objectstack-ai/objectstack/issues/37324)): a second dated note under the table of [K8](#k8--the-contract-additions-decided-item-by-item) gives item 17 its final shape, `AdapterSearchOptions.scope?`: the typed scope the service builds from `scope: [{ object, ids }]`, on the maintainer's ruling of that day, 「也能指定上级对象(制度)」 (record `7168192820` on #37308). The status line above is left as it is. - **Amended** (2026-11-28, [#38368](https://github.com/objectstack-ai/objectstack/issues/38368)): a third dated note under the table of [K8](#k8--the-contract-additions-decided-item-by-item), read with item 12, records that a knowledge service the runtime mounts is enabled by configuration: a boot enables it when it finds an embedder and the deployment's store, and until then its sources are held and not served. It is written on the maintainer's words of that day, 「平台没有知识服务时,知识源不应该启用啊。」 and 「私有部署判断的是相关参数有没有配置」, as the filing gate of #38368 records them, and on four points he ruled on 2026-11-29 by choosing the decision card's option 「全按推荐(1A 2A 3A 4A)」 (record [`7248214179`](https://github.com/objectstack-ai/objectstack/issues/38368#issuecomment-7248214179) on #38368). It adds no contract member and no settings key. A cross-reference stands under [K4](#k4--knowledge_source-is-admitted-as-a-metadata-type). The status line above is left as it is. - **Amended** (2026-11-29, [#38502](https://github.com/objectstack-ai/objectstack/issues/38502)): a fourth dated note, under "What follows from the two lists" in [K1](#k1--the-boundary), amends that list's sentence "The service does not choose a model, compute a vector, score a candidate, rerank or parse a file": the service may re-order the hits it is about to answer by an ordering their source declares against a fact about the caller, by position and never by score, and a source may declare what a hit brings with it (`source.affinity`, `source.expand`). It is written on the maintainer's ruling of that day, his choice of the decision card's option 「A 精简:排序加带出」 (record [`7251603512`](https://github.com/objectstack-ai/objectstack/issues/38412#issuecomment-7251603512) on #38412). It adds no contract member. A cross-reference stands under [K4](#k4--knowledge_source-is-admitted-as-a-metadata-type). The status line above is left as it is. +- **Amended** (2026-11-30, [#38692](https://github.com/objectstack-ai/objectstack/issues/38692)): a fifth dated note, under "Rules for every member" in [K8](#k8--the-contract-additions-decided-item-by-item), amends rule 4 of that list and the reading of the "Hybrid retrieval" row of [K1](#k1--the-boundary), and with it of "hybrid retrieval" in the title, in the D1 key-words line above and in TL;DR item 1: a knowledge source declares which retrieval legs run and the vector leg's share (`source.retrieval`), the adapter reports the modes it supports and still decides how candidates are found and how the legs are fused, and a parameter of one search request is not configuration. Decided by the maintainer on 2026-11-30: ruling record [`7270218011`](https://github.com/objectstack-ai/objectstack/issues/38692#issuecomment-7270218011) on #38692, given on his words 「同意,更新决策卡」 (2026-11-30T06:00Z) and revised after an independent review on his words 「全部采纳,修正裁决」 (2026-11-30T06:16Z); the note records the revised text. It registers two contract members, `AdapterCapabilities.retrieval` and `AdapterSearchOptions.retrieval`; that the second is optional, like the first, is his choice of the decision card's option 「可选(推荐)」 at 2026-11-30T07:57Z (record [`7272337479`](https://github.com/objectstack-ai/objectstack/issues/38692#issuecomment-7272337479) on #38692). It is in force from the maintainer's merge of the PR that carries it, which the record keeps for him: 「单独 PR,Tier H,由维护者亲手合并」. Cross-references stand under [K1](#k1--the-boundary) and [K4](#k4--knowledge_source-is-admitted-as-a-metadata-type). The status line above is left as it is. --- @@ -135,6 +136,8 @@ Ruling D1, as two lists. The left one is the knowledge service's work, done once > > This note adds no contract member, no tool argument and no settings key: the list stays closed (rules 3 and 5 of K8). It declares, and the three slices build it. Until they land, `main` orders hits by the adapters' scores alone and a hit brings nothing with it. The code this note cites was read on `main` at `545a4fa278`; #38363 is a draft on its branch at `0cea24a56c`, not merged, and this note names the two facts its resolver answers, not its code. The tables of K1, the K8 table and every earlier note are left as written; read the list's second sentence with this note. +> **Cross-reference (2026-11-30, [#38692](https://github.com/objectstack-ai/objectstack/issues/38692)).** The "Hybrid retrieval" row of the adapter's table above is read with the dated note of 2026-11-30 under "Rules for every member" in [K8](#k8--the-contract-additions-decided-item-by-item), and so is "hybrid retrieval" in the title, in the D1 key-words line and in TL;DR item 1: a knowledge source declares which retrieval legs run and the vector leg's share, and the adapter still decides how candidates are found and how the legs are fused. That note also answers two sentences of "◆ Why position" in the note of 2026-11-29 above: "a smaller weight has no unit an author can check", and "a passage only one leg ranks scores at most 0.5", which stops being true of every search. No sentence of K1 or of the note of 2026-11-29 is changed. + **The push door.** `indexDocument(sourceId, doc)` and `deleteDocument(sourceId, documentId)` hand a caller-built document to the adapter. On an object source that contradicts the first row above and K5: a pushed document is not built by assembly, so neither the content list nor the egress rule binds it, and the purge of #37096 removes it at the next complete rebuild, because no record answers for it. So **both calls are refused on an object source**, with a coded refusal (ADR-0112), from row 3 at the latest; an earlier card that touches the door may land the refusal sooner. They remain the write door of a source that is not an object source. Whether v1 has such a source is point 1 (K4): if that point stands, the two methods leave `IKnowledgeService` with the `file` and `http` arms. ### K2 — The texts this record revises @@ -248,6 +251,8 @@ The package whose README and tests carry the `http` shape, `knowledge-ragflow`, > **Cross-reference (2026-11-28, [#38368](https://github.com/objectstack-ai/objectstack/issues/38368)).** Whether a mounted knowledge service is enabled is the question of the dated note of 2026-11-28 under the table of [K8](#k8--the-contract-additions-decided-item-by-item), read with item 12. Two texts above are read with it. Clause 3 ("A real consumer"): where the runtime mounted the service and it is not enabled, a source is loaded and listed to administrators, whichever store it names, and it is not built, synced or searched until a boot finds an embedder and the deployment's store. "Source admission at save": an author's save is also refused while the service is not enabled, at the save doors that note names, the package move-in among them, and the package duplicate door is not refused for that reason. No sentence of this record is changed. > > **Cross-reference (2026-11-29, [#38502](https://github.com/objectstack-ai/objectstack/issues/38502)).** Two source keys are declared by the dated note of 2026-11-29 under "What follows from the two lists" in [K1](#k1--the-boundary): `source.affinity` and `source.expand`, on the object arm. The table above lists the v1 keys as they stood and is left as written. Each of the two lands with its first reader (#38503 for `affinity`; #38504 and #38505 for `expand`), as "A key added later lands with its first reader" asks, and neither is reserved before that. No sentence of K4 is changed. +> +> **Cross-reference (2026-11-30, [#38692](https://github.com/objectstack-ai/objectstack/issues/38692)).** One group of source keys is declared by the dated note of 2026-11-30 under "Rules for every member" in [K8](#k8--the-contract-additions-decided-item-by-item): `source.retrieval`, with `mode` and `vectorWeight`, beside `source.affinity`. The table above lists the v1 keys as they stood and is left as written. Each key lands with its first reader, as "A key added later lands with its first reader" asks: `mode` in phase 1a of ruling record `7270218011` on #38692, and `vectorWeight` in its phase 1b, after #38671. One text above is read with that note. The reason given for "`adapter` becomes optional" is that "one source written as metadata must build on `os dev`, on a hosted environment and on PostgreSQL". The note records one intended exception: a source that explicitly declares a retrieval mode its store does not support is refused, at the four points the note lists, and its index is still built. A source that omits `mode` is not in the exception. No sentence of K4 is changed. ### K5 — A source lists its content fields; embedding is egress @@ -412,6 +417,28 @@ Rules for every member: 4. **The contract carries what an adapter reports, never how it is configured.** The descriptor of item 6 is a report. Which provider, which key, how to batch, hybrid weights, rerank toggles and parser options stay in the adapter's own plugin options. 5. **The list is closed.** A member that is not in the table needs a dated note on this record first. +> **Note (2026-11-30, [#38692](https://github.com/objectstack-ai/objectstack/issues/38692)) — rule 4 above, and the "Hybrid retrieval" row of [K1](#k1--the-boundary): a knowledge source declares which retrieval legs run and the vector leg's share; the adapter reports the modes it supports, and still decides how candidates are found and how the legs are fused; a parameter of one search request is not configuration.** Decided by the maintainer on 2026-11-30: ruling record [`7270218011`](https://github.com/objectstack-ai/objectstack/issues/38692#issuecomment-7270218011) on #38692. Its first line carries his words, verbatim and untranslated: 「同意,更新决策卡」 at 2026-11-30T06:00Z, and, after an independent review of that first text, 「全部采纳,修正裁决」 at 2026-11-30T06:16Z. The text this note records is the record as revised at 06:16Z. It says what it replaces on the card, 「本评论取代原单正文第 1、2、7、8 节的写法。」, and it sums the ruling up: 「知识源可以声明检索方式(只用向量 / 只用关键词 / 混合),混合时可以设向量占比;驱动报告自己支持哪些方式和默认值。」 The record's 「驱动」 is this record's adapter, and a 「一路」 is a leg. Its section 八 lists eleven things this note must write. Each bullet below names the items it carries, and the substance is that of the record's sections 一 to 七. This note marks no ◆: it decides nothing past the record's words, and every quotation is the record's text, unchanged, but for one point the maintainer ruled after it, at 2026-11-30T07:57Z: the optional mark of `AdapterSearchOptions.retrieval`, which that member's bullet records and cites. +> +> - **Rule 4, amended (items 1 and 2).** Rule 4 says: "Which provider, which key, how to batch, hybrid weights, rerank toggles and parser options stay in the adapter's own plugin options." From the merge of this note it reads: "Which provider, which key, how to batch, rerank toggles and parser options stay in the adapter's own plugin options. Hybrid weights are declared by the knowledge source. A parameter of one search request is not configuration." The record's words for the two changes: 「K8 第 4 条:「hybrid weights」改划给知识源声明;rerank toggles、parser options 照旧留在驱动。」 and 「K8 第 4 条补一句:逐次检索的请求参数不属于「配置」。」 The rule's headline and its sentence on item 6 are unchanged: the contract carries what an adapter reports, never how it is configured. The member an adapter reports its modes by is such a report, and the record heads its section so: 「驱动契约(报告,不是配置)」. What no source ever declares is the record's section 六, 「永远不进知识源协议」: 「融合算法及其常数、重排、分数阈值、分词器。平台以后如果统一做重排,那是知识服务的配置。」 +> - **The "Hybrid retrieval" row of K1 (item 3).** The row gives the adapter "How vector and keyword scores are blended, which index or scan is used, and how candidates are found." From this note it is read as the record writes it: 「知识源声明跑哪几路、向量分量多少;驱动仍然决定怎么找候选、怎么融合。」 The source declares which legs run and how much the vector leg weighs. The adapter still decides how candidates are found and how the legs are fused. The table is left as written. +> - **The title, the D1 key-words line and TL;DR item 1 (item 4).** Each says that adapters own hybrid retrieval. The record: 「标题、D1 关键词行、TL;DR 第 1 条里「adapters own hybrid retrieval」的含义同步收窄。」 So in those three places "hybrid retrieval" means what the row means as read above: how candidates are found and how the legs are fused, and no longer which legs run or what share the vector leg has. The three texts are left as written; the D1 line is a quotation of the filing gate's record. +> - **The source keys (the record's section 一).** `source.retrieval?`, a strict object beside `source.affinity`, with two optional keys. `mode?` is `vector`, `keyword` or `hybrid`; a source that omits it is searched in the default mode of the adapter it binds to. `vectorWeight?` is a number above 0 and below 1, written only beside an explicit `mode: 'hybrid'`; omitted, the two legs weigh the same. The parse refuses a `vectorWeight` where `mode` is omitted or is `vector` or `keyword`, and an empty group reads as an omitted one: 「解析层拒绝:省略 `mode`、或 `mode` 为 `vector` / `keyword` 时写了 `vectorWeight`。`retrieval: {}` 允许,等同省略。」 Neither end of the range is a value, because a leg is switched off by `mode`: 「要关掉一路用 `mode`,所以权重不能取 0 或 1。」 The number is the vector leg's share, the direction of Weaviate's `alpha` and of RAGFlow's `vector_similarity_weight`, and the `keywordWeight` of the card's body is not used. The group stands beside `affinity`, and the two act one after the other: 「和 `source.affinity` 并列、先后作用。」 +> - **The three modes (section 一; item 11 for `keyword`).** `vector`: only the vector leg runs. `hybrid`: both legs run and are merged by the adapter's fusion algorithm. `keyword`: only the keyword leg runs, and the record fixes what that means: 「只跑关键词一路,**不调用嵌入器、不生成问题向量**;同分按段落 id 排,结果确定;问题里抽不出词就返回空。」 It is for exact lookups: 「它适合文号、条款编号这类精确查找。」 A source that wants the keyword leg to lead and the vector leg to settle the order writes `hybrid` with a low `vectorWeight`, not `keyword`: 「想要「关键词为主、向量定先后」,应写 `hybrid` 加低的向量占比。」 +> - **The member an adapter reports (item 5).** `AdapterCapabilities.retrieval?: { modes: readonly ('vector' | 'keyword' | 'hybrid')[], default: 'vector' | 'keyword' | 'hybrid' }`, on `packages/spec/src/contracts/knowledge-adapter.ts#AdapterCapabilities`, which holds `chunks` alone today. `modes` is the modes the adapter runs, and `default` is the one it runs for a source that omits `mode`. An adapter that reports `hybrid` takes `vectorWeight`, with no flag of its own: 「支持 `hybrid` 就必须支持 `vectorWeight`,不单独声明。」 `knowledge-turso` and `knowledge-pgvector` report all three, with the default `hybrid`, and the record's section 七 holds that default where it is: 「turso、pgvector 的默认**统一保持 `hybrid`**,不随探测到的档位变化。#38671 修好后重新实测,再议是否改默认。」 An adapter that does not declare the member serves only sources that omit `mode`, and `knowledge-memory` is one: 「没声明的驱动(含 memory;它不由运行时挂载):知识源只能省略 `mode`。检索报告和 Studio 显示「驱动未声明」。」 What an adapter probes in its own backend stays out of the report: 「驱动探测到的增强能力(pgvector 的 pg_bigm、HNSW 等)走驱动自己的健康检查或日志,不进这份契约。」 +> - **The member the service hands the adapter (items 2 and 5).** `AdapterSearchOptions.retrieval: { mode, vectorWeight? }`, on `packages/spec/src/contracts/knowledge-adapter.ts#AdapterSearchOptions`, written here as the record writes it. It carries the value in effect for this search, which the service resolves: 「生效值放进 `AdapterSearchOptions.retrieval: { mode, vectorWeight? }`,由服务解析后交给驱动。这是**逐次请求参数**(同 `topK`、`scope`),不是配置。」 The order it is resolved in: 「单次检索参数(第二期)> 知识源声明 > 驱动默认。」 This is the request parameter that the sentence added to rule 4 speaks of. The record's spelling carries no optional mark, and the maintainer ruled on it later that day: the member is optional, `AdapterSearchOptions.retrieval?`, as rule 2 says of every member; an adapter that declares no `capabilities.retrieval`, such as `knowledge-memory`, keeps working; and whenever the service settles a mode, it always passes it (his choice of the decision card's option 「可选(推荐)」 at 2026-11-30T07:57Z, ruling record [`7272337479`](https://github.com/objectstack-ai/objectstack/issues/38692#issuecomment-7272337479) on #38692). +> - **The suite cases the two members land with (item 5; rule 1).** In the contract test suite (`packages/services/service-knowledge/src/testing.ts#runKnowledgeAdapterContract`): 「契约测试套件加用例:三种方式各一个;权重 0.5 与现状逐位相同;不支持的方式被拒。」 +> - **`vectorWeight`: what it means, and what the two SQL stores compute (item 6).** The meaning is abstract: 「混合时向量一路的相对分量。0.5 等于驱动的等权行为;调高不会让向量一路的命中名次变差。具体公式属于驱动的现行实现,不属于字段含义(见第五节)。」 The implementation of `knowledge-turso` and `knowledge-pgvector` is a weighted reciprocal rank fusion with the constant 60. With `w` the `vectorWeight`, and `v` and `k` a passage's rank in the vector leg and in the keyword leg, the record's formula for its score is `(w/(60+v) + (1−w)/(60+k)) / (w/61 + (1−w)/61)`. The division by the best score is kept on purpose: 「**保留「除以最佳分」的写法**。改写成「乘以 61」会有大量末位差异(全组合实测 13,369 / 40,400 处)。」 A pin holds `w = 0.5` to today's function over every combination of ranks, and the tie rule does not move: 「钉子测试:全名次组合下 `w = 0.5` 与现在的 `fuse()` 逐位相等。同分规则(先比向量名次,再比段落 id)不动。」 The weight changes the TypeScript function and the mode changes the SQL: 「权重改的是 TypeScript 的 `fuse()`,`mode` 改的是 SQL(少拼一路)。」 Under a single-leg mode the passage ranked n scores `61/(60+n)`, `knowledge-memory` keeps answering the cosine similarity, and the contract asks one thing of a score: 「契约只要求同一知识源内分数随名次不增。」 The constant is not opened as an option: 「RRF 常数等引擎参数**本期不开放**为插件选项。」 Read at `5a77a7063e`: the function is `packages/plugins/knowledge-turso/src/turso-adapter.ts#fuse` and `packages/plugins/knowledge-pgvector/src/pgvector-adapter.ts#fuse`. Each divides the sum of the two legs' `1 / (RRF_K + rank)` by `2 / (RRF_K + 1)`, with `RRF_K` at 60; a leg that does not rank a passage adds nothing; and a tie goes to the better vector rank, then to the chunk id. +> - **Two sentences of the note of 2026-11-29 (item 7).** Under K1, "◆ Why position" refuses a rank fusion that takes an `affinity` declaration as one more leg, and says of it: "a smaller weight has no unit an author can check". It also says: "a passage only one leg ranks scores at most 0.5". The record: 「回应 2026-11-29 修订里「权重没有作者能核对的单位」那句,并说明「只被一路命中最多 0.5 分」不再成立。」 On the first: `vectorWeight` weighs another thing, one retrieval leg of a source against the other, and nothing of `affinity` changes. The record does not give the key a unit. Its meaning is abstract, a relative share: 0.5 is the adapter's equal weight, and a higher value never ranks a hit of the vector leg worse. What an author is told beside the number is a direction, in the Studio form: 「向量占比稍高于 0.5,只被关键词一路找到的段落就可能进不了答案,阈值随 topK 变化」. And the key is built only once a usable range has been measured (phase 1b, below). On the second: it was true of every search of the two SQL stores when it was written, and from phase 1a it is true only of a hybrid search at equal weight. Under a single-leg mode the passage ranked first scores 1. Under `hybrid` with a declared weight, by the formula above, a passage only the vector leg ranks scores at most the weight, and a passage only the keyword leg ranks scores at most the rest. The other sentences of that note are left as written. +> - **The intended exception to "builds on every store" (item 8).** K4 makes `adapter` optional because "one source written as metadata must build on `os dev`, on a hosted environment and on PostgreSQL", and the note of 2026-11-29 says "A source is written once and builds on every store (K4)". The record names one intended exception: 「「一份知识源在每种存储上都能建」的有意例外:显式声明了存储不支持的方式会被拒。」 A source that omits `mode` is not in it: omitted means the adapter's default, whichever adapter that is. The index of a source in the exception is still built, and the next bullet lists where it is refused. +> - **Where an unsupported mode is refused (item 9).** Four points, in the record's order. (1) When an author saves, at Studio, REST and the MCP draft door: `400 VALIDATION_ERROR`, and the refusal lists the modes the adapter supports. (2) At registration, and only when the adapter can already be resolved at that moment: 「只有此刻驱动已经可以解析时才拒绝,否则不下结论(启动期驱动在 `start()` 才注册,按 AGENTS.md 的启动期注册表规则,不在 `init()` 下结论)。软件包安装不经过保存门,靠第 3、4 条兜住。」 (3) Once, when the boot has completed, after the precedent of `reportUnmountedAdapters`: a line in the log at `error` that names the source and the modes its adapter supports. (4) At every search: the source is listed in `refused` with its code, and it is never searched in the default mode in its place (「不悄悄按默认方式跑」). The index is not refused: 「方式不被支持的知识源**照常建索引**,只拒绝检索。」 Read at `5a77a7063e`: adapters register in their plugins' `start()`, after a source registered in code at `init()` (the note on `packages/services/service-knowledge/src/knowledge-service.ts#KnowledgeService.adapterIdFor`); the boot's reading of unmounted adapters is taken at `kernel:bootstrapped` (`#KnowledgeService.reportUnmountedAdapters`); and the save predicate does not judge the engine's own write, a package install among them (`packages/metadata-core/src/knowledge-source-save-admission.ts#authoredKnowledgeSourceRefusal`). +> - **Known gaps (item 10).** 「已知缺口:检索方式不同的知识源之间分数不可比;单路方式下分数只反映名次。」 The scores of two sources searched in different modes cannot be compared. Under a single-leg mode a score says the rank and nothing more, and the first hit always scores 1. The record adds this sentence to the description of `search_knowledge`: 「分数只表示同一知识源内的先后,不表示相关程度」. This note closes neither gap. The record's own line on a search that merges several sources: 「跨知识源混排:BrightRule 只有一个知识源,今天不受影响。」 +> - **The way out of a single number (item 11).** 「单个数权重的退出路径:将来真有第三路时,加按路写法,旧写法保留原意。」 One number can weigh two legs against each other. If a third leg ever exists, a per-leg spelling is added, and a `vectorWeight` already written keeps its meaning. The same item asks for the meaning of `keyword`, which is under "The three modes" above. +> - **No index is rebuilt for either key.** Neither enters the fingerprint or the recipe hash (K7), and a change of mode rebuilds nothing: 「不计入索引指纹和 recipe hash,切换方式不用重建索引。」 A source searched by vector alone keeps its keyword index (「只用向量的知识源**照常维护关键词索引**。」), and the record says the free switch depends on that. +> - **The sequence (the record's 分期).** Phase 0 is this note, which the maintainer merges. Phase 1a builds `mode` with its three values, the adapter's report, the four refusal points, the Studio form and the tool's text. Phase 1b builds `vectorWeight`, after #38671: 「**排在 #38671 修好切词之后**,修好后实测,确认权重有可用的区间。」 So `vectorWeight` is ruled here and is in no schema until that phase; K4's rule holds for both keys ("A key added later lands with its first reader"). Phase 2 is the per-search override on `search_knowledge`, and it opens `mode` only: 「`search_knowledge` 单次覆盖,只开放 `mode`。届时还要定两件事:知识源能不能声明「不许覆盖」;覆盖成混合时用哪个权重。cloud 应用内 agent 的工具定义要同步。」 +> - **Not in this note.** The texts that state today's behaviour are rewritten by the PRs whose code makes the new sentences true (K2), and the record routes them: 「`content/docs/protocol/knowledge.mdx` §7.1 的修改随代码 PR 走。`ui/`(Studio 表单)和 `skills/`(AI 作者文档)是受治理路径,各自单独提 PR。」 The per-search argument of phase 2 is not registered here. Rerank, a score threshold, a tokenizer and the fusion algorithm with its constant never enter the source (section 六, above). +> +> This note registers exactly two members, `AdapterCapabilities.retrieval` and `AdapterSearchOptions.retrieval`, and no other: the list stays closed beyond them (rules 3 and 5). It declares, and the phases above build it; the PR that lands it changes no file under `packages/`. Until phase 1a lands, `main` has no `source.retrieval` key, `AdapterCapabilities` holds `chunks` alone, and `knowledge-turso` and `knowledge-pgvector` answer every search by the equal-weight fusion of two legs. The code this note cites was read on `main` at `5a77a7063e`. The title, the tables of K1 and K8, the rules above and every earlier note are left as written; read rule 4 and the "Hybrid retrieval" row with this note. + ### K9 — One `search_knowledge` definition, and every knowledge tool goes through the tool registry and the MCP seams **What landed** (PR #36823, merged as `8aecf6d770`, read in the tree at `254e396a29`). The tool has one definition, `packages/services/service-knowledge/src/knowledge-tools.ts#getKnowledgeToolDefinitions`, and one executor, bound by `packages/services/service-knowledge/src/knowledge-tools.ts#createKnowledgeTools`. The knowledge service hands both out through `knowledgeTools()`. Both MCP transports register that definition and call that executor as the principal they bind, where the grant admits `data:read` (`packages/mcp/src/mcp-http-tools.ts#registerKnowledgeTools`; the HTTP bridge in `packages/runtime/src/domains/mcp.ts`, the stdio bridge in `packages/mcp/src/stdio-data-bridge.ts`).