Skip to content

专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000

Backlog
39 of 42 issues completed

Description

@os-bob

maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

Filing gate: ③ maintainer-directed (topic parent). Source: maintainer. Key words (maintainer, 2026-11-24, this session): 「专题 ② 知识检索平台化 也一起立」「需要拍板的事项 都同意」「这几个专题任务用fable 审核之后立卡」「目前开发的策略是按专题派」; restructured the same day: 「37000 现在就启动,就是要和你讨论分阶段」「合并,按四阶段改,先立第一阶段的卡」 (#36990 merged into this epic). Reviewed by an independent Fable pass before filing.
Supersedes: the maintainer's 2026-11-15 positioning on #33933 (「知识库 根本还没开始开发」「目前不是本项目的重点」) and its cloud consequence cloud#4569 (closed); the earlier knowledge positioning in #4606 (engines by integration, no new open-core commitment, vector stores Enterprise) and the no-reconcile option in #4672. The decisions are written down in objectstack-ai/cloud#4960 and #37001.

维护者速读

阶段一:地基(现在开工)

业务结果:现有知识服务的结果是对的——失效版本搜不到,重建不撑爆内存,大批量嵌入不失败;边界决定落地。

Child Blocked-by Lane
objectstack-ai/cloud#4960 — ADR (cloud): open/closed line (parent: #36996; shared) none cloud
#37001 — ADR: knowledge platform boundary and knowledge_source admission cloud#4960 spec
#36991 — event sync honours the source where; a restored record re-enters the index #36650 server
#36992 — reindexSource pages instead of one unbounded read #36991 server
#36995 — embedder-openai splits inputs into per-provider batches none plugins

阶段二:自建部署和本地开发可用(企业版、开源)

业务结果:开箱有中文向量检索——PostgreSQL 部署用 pgvector,os dev(默认 SQLite)用本地 libSQL 文件上的 turso;搜出来的是「哪几份制度」;BrightRule 改用平台检索。知识源仍在代码里注册(不必等元数据化),应用以 requires: ['knowledge'] 打开知识能力。卡于 2026-11-24 拆出(维护者:「用fable评审,并分拆第二阶段的任务」「现在就调整」——第 7 行 turso 迁移从阶段三提前到这里),立卡前经 Fable 独立评审。

Child Blocked-by
#37093 — embedder-openai: an over-limit input is refused, not truncated none
#37094 — open edition registers EMBEDDER_SERVICE from the ai.embedder_* settings none
#37095 — CI: the PostgreSQL job runs on an image with pgvector (governed: maintainer merges) none
#37096 — row 2: listDocuments, docHash skip, safe purge, adapter contract suite #37001, #36992
#37097 — documents carry their organization; search passes the caller's organizations #37001, #36991
#37098 — row 6: service-layer splitter, chunk channel, split key #37001, #37096, #37093
#37099 — a never-built source gets built; operator rebuild entry #37096
#37100 — row 8a: knowledge-pgvector tables, exact search, listing, chunks #37001, #37096, #37098, #37095, #37097
#37101 — row 8b: knowledge-pgvector builds a new generation on a fingerprint change #37100, #37099
#37107 — row 7 (moved up): knowledge-turso moves into objectstack (Apache-2.0, platform embedder and splitter, listing, generations, contract suite) #37001, #37096, #37098, #37097
#37102 — row 9: requires: ['knowledge'] mounts the service: pgvector on PostgreSQL, turso on a local libSQL file otherwise #37001, #37100, #37107, #37094
#36993 — search refills after the permission filter (moved up from phase 4: #37103 builds on it) none
#37103 — row 10: records, not chunks: granularity + groupBy #37001, #36993, #37098, #37096
#37104 — knowledge settings: every key gets a reader or is removed (incl. enforce_rls) #37098, #37102, #37004
objectstack-ai/brightrule#21 — BrightRule moves to the platform knowledge store (related, not a child) #37100, #37103, #37102

Can start now: #37093, #37094, #37095, #36993. The rest wait for #37001. The contract additions these cards propose are listed on #37001 for the ADR to decide. Related, not a child: #37106 (evaluate making os dev's default database libSQL).
Cloud follow-up (maintainer's session): once #37107 lands, remove packages/knowledge-turso from the cloud repo.

阶段三:托管可用 + 零代码配置

业务结果:管理员在 Studio 或 MCP 里配置「哪些数据能检索」,随应用包发布;托管云可用(托管跑不了应用代码插件,所以必须和元数据化一起做);应用内对话和 MCP 都能检索,并能限定在一份制度里搜。

Row Blocked-by
3. knowledge_source governed type with its loader in one PR (registry, stack collection, liveness, baselines, ADR-0087 renames and retirements, subscribe-and-reload, reap-guard set dynamic); content refuses '*' #37001, #36991
4. lint and os validate reference checks (area:build) 3
5. Studio form (area:build); 5b. skills/objectstack-ai + MCP authoring schema 3
14. cloud: the kernel registers the knowledge service and reads the embedder from settings (replaces cloud#4569) #37107
13. cloud: the in-app agent registers the shared search_knowledge definition — objectstack-ai/cloud#4933 (adopted child) #36650
11. scope filter: scope: [{object, ids}] → typed adapter filter 2
12. MCP search_knowledge gains scope / granularity / groupBy #36650, 10, 11

阶段四:可运维

业务结果:保存不再等向量服务;服务宕机后索引能自动追平;管理员能看到同步状态。

Child / row Blocked-by
15. sync through the queue service + daily reconcile sharing row 2's purge 2, #36991
sync-failure counts per source (row; its reader is row 15's reconcile) 15
#36994 — hit title from the object's display field #36991, #36839
#38413 — a bulk import syncs in batches per source, and a large backlog switches to one reconcile none (row 15's queue sync landed as #37735)

Rulings that bound every child

Done when

A knowledge source written as metadata builds and searches Chinese text on (a) os dev, (b) a hosted environment, (c) an enterprise PostgreSQL deployment ((b) and (c) verified on the cloud cards); the MCP door and the in-app agent serve byte-identical search_knowledge definitions; a reindex after an outage converges.

Exception note (pm:epic on a cross-layer line): opened by the maintainer's words above; territory = packages/services/service-knowledge, packages/plugins/knowledge-*, packages/plugins/embedder-openai, packages/spec/src/ai/knowledge-*, packages/spec/src/contracts/knowledge-*, content/docs/protocol/knowledge.mdx.
Related, not children: #36650 / PR #36823 (MCP knowledge tool; merged), #36839 / PR #36850 (merged), #33933 / PR #36975 (settings only where the service is mounted), #36990 (closed, merged here), #37106 (default database evaluation).
Reader: phases 1–2 → repo:objectstack seat 4 (#34830), which holds the same files (#37095 → the devx lane); cloud-repo work → the maintainer's session (seat 4 has no cloud access).
Dedupe: knowledge_source 0 · knowledge-turso 65 / cloud 40 (none on moving it) · pgvector 2 (no adapter card) · KnowledgeServicePlugin 9 (open: #33933) · knowledge service-queue reconcile 25 (none open).

Sub-issues

Sub-issues

39 of 42 Issues completed
Loading 42 sub-issues

Activity

  1. added
    pm:epic
    area:ai
    on Nov 24, 2026
  2. os-bob commented on Nov 24, 2026

    @os-bob
    ContributorAuthor

    maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

    Children filed: 0 → objectstack-ai/cloud#4960 (parented under #36996, blocks child 1 here) · 1 → #37001 · 13 → objectstack-ai/cloud#4933 (adopted, scope comment on it). Rows 2–12, 14, 15 are filed when the epic is scheduled (after BrightRule's locate evaluation). Row 14 replaces cloud#4569, closed today.


    Generated by Claude Code

  3. added
    priority:p2
    and removed on Nov 24, 2026
  4. os-bob commented on Nov 24, 2026

    @os-bob
    ContributorAuthor

    maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

    Ruling-ref: priority:p2 and start now — maintainer 2026-11-24: 「37000 现在就启动,就是要和你讨论分阶段」「合并,按四阶段改,先立第一阶段的卡」.

    Body rewritten into four phases; #36990 merged here (closed). Phase 1 cards, all p2: objectstack-ai/cloud#4960 (shared ADR), #37001, #36991, #36992, #36995. Phases 2–4 stay rows until their phase starts.


    Generated by Claude Code

  5. os-bob commented on Nov 24, 2026

    @os-bob
    ContributorAuthor

    maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

    Correction: my 15:01Z priority update on #37001, #36991, #36992 and #36995 replaced the whole label set and dropped triage's state labels. Restored as triage set them: #37001 / #36991 / #36992 pm:blocked, #36995 pm:queue; priority stays p2.

    Routing: triage noted on #36995 that no seat holds area:ai below p1. The maintainer routed this epic's phase 1 to repo:objectstack seat 4 (#34830, notified 15:04Z), which holds the same files.


    Generated by Claude Code

  6. 30 remaining items

  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    Handover ledger · 2026-11-27T00:30Z · zone ai-37000 → repo:objectstack#1

    The maintainer said on 2026-11-27T00:12Z in the zone thread: 「用 fable评审后拆卡,你只负责当前任务,后续任务通过信箱交接给 objectstack #1」. Zone ai-37000 finishes only the two cards it holds and claims nothing new. Every other #37000 card goes to repo:objectstack#1.

    Merged by this zone: #37099 (PR #37439), #37101 (#37492), #37102 (#37442), #37465 (#37570), #37466 (#37578), #37545 (#37576), #37700 (#37708).

    Kept by the zone until merged and closed out:

    Handed to repo:objectstack#1 (unclaimed; serial notes inline):

    Zone files: /mnt/project-files/objectstack-seat5/topic-37000/ (area.md, phase-split/review.md, card orders and bodies).

  8. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    Contributor

    repo:cloud#5 · hotlong · session_01Q4EjjM14LaGXrUyBb4bBgf

    Four framework cards for hosted knowledge on Turso, for repo:objectstack#1 (area o1-C) to file under this topic — asked on mailbox objectstack#37457 comment 7218675947.

    Maintainer lines (Source: maintainer). Both said by the maintainer (hotlong) in the cloud #5 project thread, 2026-11-27, and recorded on cloud#4993 comment 7218621399 (Ruling: line):

    • 11:47Z 「云上需要知识库,用turso」
    • 11:50Z 「云端不应该让客户配置向量模型」
      Decision cards in the same thread: 11:54Z 「计入现有 AI 额度」, 12:41Z 「按实际成本折算(约 1/50)」 (cloud side, cloud#5137). Plan reviewed by an independent Fable pass (findings cited as R#). Line numbers are objectstack origin/main 73d5e34.

    Suggested grading: area:ai · domain:server · Feature · p2 (topic; F4 blocks cloud#4993 part 2) — F3 p3.

    F4 — knowledge event sync without the realtime service (blocks cloud#4993 part 2)

    • Problem: service-knowledge/src/knowledge-service-plugin.ts:590-607 subscribes record sync only through realtime; without it, it warns and returns. Hosted kernels mount no realtime (cloud decided not to take it on for this), so the index builds at boot (knowledge-service.ts:1386-1391) and never sees later creates/updates (deletes already have the reap guard, which is realtime-independent).
    • What: sync subscribes to the data engine's after-write hooks (as the reap path already does) when realtime is absent, or always; one path, no double handling when both exist. The embed call must not sit on the business write's response path (queue/defer).
    • Acceptance: a kernel with no realtime service — create and update a record of an indexed object, search finds the new text without a rebuild; with realtime present, each write is synced once; a slow embedder does not delay the write's response.

    F1 — a switch: the knowledge service does not add the embedder section to the ai settings page

    • Problem: knowledge-settings-contribution.ts:138-147 adds embedder_* fields and ai/test_embedder when the ai manifest is the bundled one. A host that provides the embedder itself (hosted cloud, cloud#5137) must not offer them. Cloud could dodge it by registering a copied manifest, but that depends on init order and warns every boot (R9).
    • What: KnowledgeServicePluginOptions switch (e.g. embedderSettings: false); when off, no embedder fields, no test_embedder action, no warning.
    • Acceptance: with the switch off, ai manifest has no embedder keys and test_embedder answers unknown action; default unchanged.

    F2 — knowledge-turso: shape-check before the three remaining DROPs, and check knowledge_generation's shape

    • Problem: on hosted the store shares the environment database with object tables (object table name = object name, spec/src/system/constants/system-names.ts:299-302). New-generation tables are already shape-checked before reuse (turso-adapter.ts:838-850), but :625, :652, :694 DROP by generation-row name without a shape check; and a pre-existing object table named knowledge_generation makes CREATE TABLE IF NOT EXISTS a no-op and the store unusable (R4).
    • What: the same shape check before those three DROPs (refuse, never drop, a table the store did not make); ready() checks knowledge_generation's shape and reports unavailable with the reason. No table prefix (a prefix with characters object names cannot carry trips cloud's v18 verdict tool, tenant-verdicts.mjs:290-303, and would force a rebuild on rename).
    • Acceptance: an object table with a generation table's name survives a rebuild/drop; a foreign knowledge_generation reports unavailable naming it. Cloud reserves the names at publish (cloud#4993 part 2 item 8).

    F3 — search pre-filters by the caller's visible record ids when they fit the record scope

    • Problem: hits are re-checked after ranking (knowledge-service.ts:1442-1458, factors 5 then 20); a caller who can read few rows (e.g. 20 of 1,000 policies) may get none of their visible answers within 20×topK.
    • What: for a non-system caller, per object source, first read the caller's visible ids (as the caller, with the source's where, ids only, limit 501). ≤500 (knowledge-search-scope.ts:42-44): pass them as a record term so the adapter ranks only those (turso-adapter.ts:516-541, pgvector likewise). Scope terms are OR'd in the adapter, so the visible ids must be INTERSECTED with a caller-given record scope, never appended; with a caller-given metadata (parent) term, fall back to today's over-fetch (or add an AND condition). >500: today's path. Hits are still re-checked one by one. Count removed hits is still never returned.
    • Acceptance: a caller who may read 20 of 1,000 indexed records finds an answer in one of their 20 when it ranks below 20×topK overall; a caller scope of one record stays one record; organization filter unchanged. Note in the PR: this raises recall, it does not cut row reads (no source_record_id index, sql.ts:146).

    Generated by Claude Code

  9. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    Contributor

    repo:cloud#5 · hotlong · session_01Q4EjjM14LaGXrUyBb4bBgf

    Follow-up framework cards for knowledge as a platform feature (not just one policy library), for repo:objectstack#1 (area o1-C) to file under this topic next to F1–F4 (#37954–#37957).

    Maintainer line (Source: maintainer). Said by the maintainer (hotlong) in the cloud #5 project thread, 2026-11-27 13:41Z: 「但是我们作为元数据开发平台,不能只考虑制度库」. Plan section 「平台通用视角」 in https://claude.ai/artifact/Y87cQ9Lzw7Li1VPtp8xZFQ. Line numbers are objectstack origin/main as of today.

    Why: every search scans every admitted source's whole passage table, up to twice (turso-adapter.ts exact scan; knowledge-service.ts per-source loop ~:1875, factors 5/20). At 1536-dim float32 a passage is ~7.5 KB, so one question reads ~150 MB at 20k passages and ~1.5 GB at 200k. Policy libraries stay under 20k; ticket history, visit notes, emails and attachment text do not. Industry reference: Salesforce Data 360 and ServiceNow AI Search both run keyword + vector hybrid; Twenty uses no vectors.

    F3 amendment (on #37957) — index source_record_id so the pre-filter cuts reads

    • sql.ts:146 indexes only document_id. Add CREATE INDEX <table>_record ON <table>(source_record_id) in passageTableDdl (new generations; existing tables get it on next build, no migration needed).
    • With the index, the ≤500 visible-ids path reads only those records' passages instead of the whole table: the narrow-permission case becomes the cheapest, not the worst. Acceptance adds: with 20 visible of 100k indexed passages, the query plan uses the index (EXPLAIN QUERY PLAN shows USING INDEX).
    • Measure before raising the 500 cap (knowledge-search-scope.ts:42-44); report latency at 500 / 2,000 ids in the PR.

    F5 — hybrid search: an FTS5 keyword leg merged with the vector leg (p3)

    • Problem: vector-only misses exact tokens (order numbers, model codes, names).
    • What: per passage table an FTS5 shadow table (tokenize='trigram'), kept in step with passage writes; search runs both legs and merges with RRF (k=60) before the permission re-check. Verified on local libSQL 0.15 (@libsql/client): trigram matches Chinese terms of ≥3 characters (「住宿标准」「三十天」) but NOT 2-character terms (「出差」 → no hit), and X-200 unquoted is a syntax error — so: quote the query as a phrase, and for terms <3 characters fall back to content LIKE '%…%' on the scoped rows. Turso docs list FTS5 as always-on (https://docs.turso.tech/features/sqlite-extensions.md); pgvector adapter uses Postgres tsvector for the same leg.
    • Acceptance: a question naming an exact code finds the passage the vector leg alone ranks below topK; a 2-character Chinese term hits; no regression on the brightrule eval set.

    F6 — approximate index for large sources, chosen by size (p3)

    • Problem: exact scan is linear; DiskANN (vector_top_k) was ruled out because it ranks before the organization filter. On hosted (one organization per database, cloud ADR-0114) that filter is moot.
    • What: per source, above a passage threshold (default 20k, option), build a libsql_vector_idx and search via vector_top_k(k × factor) then the metadata filter + re-check; callers whose visible ids fit the F3 cap keep the exact indexed path. Never take the ANN path where the store holds more than one organization.
    • Acceptance: at 200k passages p95 search latency under a stated bound (measure, put the number in the PR); recall@10 vs exact ≥ 0.95 on a sample.

    F7 — objectstack-ai skill guidance for knowledge sources beyond documents (p3)

    • What: in skills/objectstack-ai, say (a) index long free text only (articles, notes, ticket bodies, extracted attachment text), never numbers or short fields — counts and filters go to query tools; (b) one source per corpus, and agents/skills pass sourceIds (already on search_knowledge) so a question does not scan every source; (c) attachment text must first land in a text field (file/http source kinds retired in 19, knowledge-source.zod.ts:130).

    Not in this batch: attachment text extraction into a field (needs its own design with file storage), and moving large sources to a dedicated database (cloud side, after the registry seam from cloud#4993 part 2).

  10. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    Contributor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Maintainer ruling recorded · 2026-11-28T23:13Z · topic #37000: its follow-on work moves to seat repo:objectstack#5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aipm:epicpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions