Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6ee3b96
refactor(service-knowledge): split KnowledgeService into concern face…
claude Nov 30, 2026
525fb38
refactor(service-knowledge): register KnowledgeService in the facade …
claude Nov 30, 2026
4c4a984
refactor(service-knowledge): facets as host-typed functions the censu…
claude Nov 30, 2026
bac87c0
chore(service-knowledge): ceiling row measured on the split head
claude Nov 30, 2026
5fffac6
Merge origin/main into claude/project-thread-e6npb2
claude Nov 30, 2026
1b7a98c
docs(service-knowledge): name the facet modules in the host and top-l…
claude Nov 30, 2026
6829ee1
docs(service-knowledge): a private member with no docblock is named s…
claude Nov 30, 2026
ad4f458
chore(spec): the knowledge_source liveness ledger cites the moved bod…
claude Nov 30, 2026
1ff5857
feat(spec): source.retrieval.mode, AdapterCapabilities.retrieval and …
claude Nov 30, 2026
8dc9af7
chore(spec): regenerate the generated artifacts for source.retrieval
claude Nov 30, 2026
e582d5e
chore(changeset): source.retrieval.mode and the adapter's retrieval r…
claude Nov 30, 2026
9e57639
test(service-knowledge): the vector-mode contract case reads the vect…
claude Nov 30, 2026
0250e69
Merge remote-tracking branch 'origin/claude/project-thread-vj79kz' in…
claude Nov 30, 2026
9c31e44
feat(service-knowledge): read a source's retrieval mode, and refuse a…
claude Nov 30, 2026
e805371
test(spec): pin KnowledgeRetrievalModeSchema as isomorphic (ADR-0122)
claude Nov 30, 2026
b78a7de
Merge branch 'claude/project-thread-vj79kz' of https://github.com/obj…
claude Nov 30, 2026
14b8b7a
docs(knowledge): the adapter contract carries the retrieval mode; nam…
claude Nov 30, 2026
d22f211
Merge branch 'claude/project-thread-vj79kz' of https://github.com/obj…
claude Nov 30, 2026
dc69544
feat(service-knowledge): index_status names the store a source that n…
claude Nov 30, 2026
0d18717
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 30, 2026
dd4cf3e
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 30, 2026
08788c6
fix(platform-objects): name the retrieval-mode choices in every local…
claude Nov 30, 2026
662a70c
test(service-knowledge): keep the tracker id out of the contract suit…
claude Nov 30, 2026
6ea2c54
Merge remote-tracking branch 'origin/claude/project-thread-vj79kz' in…
claude Nov 30, 2026
7436d4f
test(platform-objects): count the retrieval-mode rows in the translat…
claude Nov 30, 2026
77c17a5
Merge remote-tracking branch 'origin/claude/project-thread-vj79kz' in…
claude Nov 30, 2026
43497e0
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 30, 2026
b15ac8d
docs(spec): cite the ADR-0161 note of 2026-11-30 under K8 by its plac…
claude Nov 30, 2026
a76dc2e
chore(changeset): the platform-objects translations of the retrieval-…
claude Nov 30, 2026
75d7437
fix(spec): the retrieval key warns until the service reads it; the co…
claude Nov 30, 2026
fdba258
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 30, 2026
099d019
Merge PR1 head into the service branch
claude Nov 30, 2026
1a7ba24
Take a published knowledge source whatever its mode; restore the pgve…
claude Nov 30, 2026
b69e471
Merge branch 'main' of https://github.com/objectstack-ai/objectstack …
claude Nov 30, 2026
25a6dee
Name the spec package in the service changeset: its liveness row flip…
claude Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .changeset/38692-knowledge-retrieval-mode-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@objectstack/service-knowledge': patch
'@objectstack/spec': patch
---

feat(service-knowledge): the knowledge service reads a source's retrieval mode

A search of a knowledge source now runs in its effective retrieval mode: the
mode the source declares (`source.retrieval.mode`), else its store's default
(`capabilities.retrieval.default`). The mode is handed to the store on every
search and logged at `debug` with where it came from; it is not in what a
search answers the caller. `index_status` carries each source's `retrieval`
(the mode, its origin, the store's modes, a refusal) and each mounted store's
modes.

A source that declares a mode its store does not run is never searched
another way. It is refused at its save (`400 VALIDATION_ERROR`, listing the
modes the store runs), at registration in code (`registerSource`) when its
store is already registered,
once after boot at `error` (`reportUnsupportedRetrieval`), and on every search,
where it is listed in `refused` with `SERVICE_UNAVAILABLE` (503). It still
builds and syncs its index: a published item (a package install, the stack's
`knowledgeSources`) meets no save and is registered and indexed as usual, and
the boot's reading and every search refuse it. A store that reports no modes (knowledge-memory)
takes only a source that leaves the mode out.

Clause-②: no
Metadata-protocol: none
33 changes: 27 additions & 6 deletions content/docs/protocol/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,32 @@ that name (ADR-0161 K4):
used, so a source registered before its store started finds it.

**How a source is searched: `source.retrieval.mode`** (ADR-0161, the dated
note of 2026-11-30 under K8). `'vector'` ranks by meaning alone, `'keyword'`
by the question's words alone (the embedder is never called), `'hybrid'` runs
note of 2026-11-30 under K8). `'vector'` ranks by meaning alone, `'keyword'` by
the question's words alone (the embedder is never called), `'hybrid'` runs
both and merges them; omitted (or `retrieval: {}`), the adapter's default
(`capabilities.retrieval.default`, `'hybrid'` on `turso` and `pgvector`). The
mode is read by search alone: it enters neither the index fingerprint nor the
recipe hash, so changing it rebuilds nothing.
(`capabilities.retrieval.default`, `'hybrid'` on `turso` and `pgvector`).
That is the effective mode, handed to the adapter on every search and logged
at `debug` with where it came from; it is not in what a search answers the
caller, and an administrator reads it in the source's `index_status`. A
source is never searched in a mode other than the one it declares, so a mode
its adapter does not list (an adapter that reports none, such as `memory`,
lists none) is refused at four points:

1. its save (Studio, `/meta`, an MCP draft): `VALIDATION_ERROR` (400),
listing the modes the store runs;
2. its registration in code (`registerSource`), when its adapter is already
registered: the same refusal. A store registers in its own `start()`,
after a source registered at `init()`, so "not registered yet" is no
verdict. A published item (a package install, the stack's
`knowledgeSources`) meets no save and is not refused by the loader: it is
registered and indexed, and the next two points hold it;
3. once after boot, at `error`, naming the source and the modes;
4. every search: the source is listed in `refused`, `SERVICE_UNAVAILABLE`
(503), as a source whose adapter is not mounted is.

The mode is read by search alone: it enters neither the index fingerprint nor
the recipe hash, so changing it rebuilds nothing, and a refused source still
builds and syncs its index.

**What mounts the service.** A stack that ships a `knowledge_source` — any
item in its `knowledgeSources`, at the top level or in a package — is served
Expand Down Expand Up @@ -260,7 +280,8 @@ and the MCP draft door:
serve for `search`, a system object without `enable.aiReadable`, or a field
the author may not query refuses the save `403`, naming the object or the
field; an `adapter` naming no mounted store refuses it `400`, naming the
source, the adapter and the mounted ones. The fields judged are the ones the source serves (`content`,
source, the adapter and the mounted ones, and so does a
`source.retrieval.mode` the store does not run, listing the ones it does. The fields judged are the ones the source serves (`content`,
`metadataFields`, the title field) and the ones its `where` reads. A
verdict that cannot be reached, or a knowledge service that is registered
and cannot be resolved, refuses `503`; nothing is written.
Expand Down
Loading
Loading