You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 09eea10
Browse filesBrowse the repository at this point in the historyBrowse files
docs(knowledge): search_knowledge says what a score means; the AI skill lists source.retrieval.mode (#38732)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8QCBjsNDZa4iwo35VN5fKKg)_
Part of #38692
Clause-②: no
Metadata-protocol: none
## 维护者速读
- AI 助手搜知识库时会被告知:分数只表示同一知识源内的先后,不表示相关程度;AI 作者文档写明了检索方式的用法。
- 属于知识管理专题「一期 a:检索方式」。
- 出错只会是说明文字不准,不影响搜索结果,可直接撤回。
- 无。
## Stack
Base: `main`. Stacked on the service PR #38722 (and through it #38720);
until those merge, this diff carries their commits. Lands after both and
after the phase-0 ADR note (#38714).
## What changes
- `search_knowledge` description: one sentence, the ruling's
「分数只表示同一知识源内的先后,不表示相关程度」: "A hit's `score` says only its order among the
hits of its own source, not how relevant it is." The `score` member's
doc says the same, with the one-leg rule (first hit scores 1).
- `skills/objectstack-ai/SKILL.md`: a `source.retrieval.mode` row in the
knowledge source key table; paid for in the same file (the `adapter`
row's save refusal shortened, the one-slot sentence dropped, the closing
rerank line made one clause and no longer says "hybrid weighting"). The
row says an unsupported mode fails a run-time save and, for a shipped
source, every search (503). Ratchet row lowered 7248 → 7247.
- `content/docs/ai/knowledge-rag.mdx`: the "0.5 for one first in only
one" paragraph now says a source can run one leg alone, its first hit
then scores 1, and scores order one source's hits only.
- Patch changeset, naming `@objectstack/service-knowledge` and
`@objectstack/skills` (which ships the SKILL.md).
## Tests
- `service-knowledge`: 860 passed (no test pins the description text).
- Skill gates: token ratchet, links, identifier liveness, frame sync and
freshness, top-level keys, affected docs: all green.
## Acceptance notes
Skill readings (`skills/**` touched):
| | before | after |
|:--|--:|--:|
| `skills/objectstack-ai/SKILL.md` lines | 507 | 507 |
| `skills/objectstack-ai/SKILL.md` bytes / tokens | 29017 / 7248 | 28990
/ 7241 |
| all `skills/*/SKILL.md` lines | 3406 | 3406 |
| all `skills/*/SKILL.md` bytes | 180659 | 180632 |
Net growth zero: the new row is paid by deletion in the same file.
## Verification
- Two-minute check: `node scripts/check-skills-token-ratchet.mjs` →
green, `objectstack-ai/SKILL.md` 7241 / 7241.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [ ] 4. One issue, one branch off an up-to-date `main`, one pull
request. (Stacked: see "Stack" above.)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf
<!-- signed: repo:objectstack#2 · os-warren ·
session_01JQwxbaASqBozmmj1n5tbUf -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
docs(knowledge): `search_knowledge` says what a hit's score means, and the AI skill documents `source.retrieval.mode`
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
The `search_knowledge` description now says that a hit's `score` gives only its order among the hits of its own source, not how relevant it is, and the `score` member says the same: under a one-leg retrieval mode the first hit scores 1, and scores of sources searched in different modes are not comparable. The `objectstack-ai` skill lists `source.retrieval.mode` (vector, keyword or hybrid; omitted means the store's default; a mode the store does not run is refused at a run-time save, and a shipped source's every search answers 503), paid for by shortening two of its own sentences.
Copy file name to clipboardExpand all lines: skills/objectstack-ai/SKILL.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,8 +239,7 @@ in `@objectstack/spec/ai`). Ship it in a package (`knowledgeSources`,
239
239
`KnowledgeServicePlugin({ sources })` and `registerSource` are a second door for
240
240
the same schema. A source is identified by its package and `name`; the ☁️
241
241
`search_knowledge` tool lists a package's source to agents as `NAMESPACE-NAME`
242
-
(bare for one no package holds), and a code registration and an environment
243
-
item of one name are one slot, the second refused. A shipped item mounts the
242
+
(bare for one no package holds). A shipped item mounts the
244
243
knowledge service and its store; where an app ships none, a run-time save is
245
244
refused (`503 SERVICE_UNAVAILABLE`, nothing written) until you add
246
245
`requires: ['knowledge']` to the stack and restart the server.
@@ -255,13 +254,14 @@ object or field, when you may not search that object or query a field it reads.
255
254
|:----|:--------|
256
255
|`name`| Snake_case source name |
257
256
|`label` / `description`| Display metadata |
258
-
|`adapter`| Store id (`pgvector`, `turso`, `memory`). Omitted: the deployment's store (`pgvector` on PostgreSQL, `turso` otherwise), else the only one registered; several and none the deployment's is refused, naming them. A run-time save naming one the deployment does not mount is refused (`400 VALIDATION_ERROR`, nothing written), naming the source, the adapter and the mounted ones: name a mounted one, or mount the store and save again|
257
+
|`adapter`| Store id (`pgvector`, `turso`, `memory`). Omitted: the deployment's store (`pgvector` on PostgreSQL, `turso` otherwise), else the only one registered; several and none the deployment's is refused, naming them. A run-time save naming a store not mounted is refused (`400`), naming the mounted ones |
259
258
|`source.kind`|`'object'`, the one kind |
260
259
|`source.object`| The object whose records are indexed |
261
260
|`source.content`| Non-empty list of the fields whose text is indexed, in order. `'*'` is refused: it would also send fields added later. Never ids or system fields |
262
261
|`source.metadataFields`| Fields kept for search-time filtering (`status`, `owner_id`, `tags`) |
263
262
|`source.where`| ObjectQL `where`: keeps drafts and archived rows out |
264
263
|`source.split`| How documents are cut into passages (below) |
264
+
|`source.retrieval.mode`|`'vector'` (by meaning), `'keyword'` (by words: codes, clause numbers) or `'hybrid'`; omitted: the store's default (`hybrid` on `turso`, `pgvector`). A mode the store lacks fails a run-time save; shipped, every search (503). `memory` runs none |
265
265
|`refresh.onRecordChange`| Sync from record events (default `true`); `false` leaves the index to an external indexer |
266
266
|`aiExposed`| May `search_knowledge` expose it (default `true`) |
267
267
@@ -347,8 +347,8 @@ Retired: the `knowledge.chunk_overlap` setting (`400 UNKNOWN_KEY`;
347
347
passages never overlap) and `KnowledgeChunk.metadata` (parse error; a passage
348
348
takes its document's `metadata`).
349
349
350
-
`topK` is a `search_knowledge` argument. Rerank and hybrid weighting are no
351
-
source key, and no shipped store has a setting for either.
350
+
`topK` is a `search_knowledge` argument; rerank and leg weights are no source
0 commit comments