Skip to content

knowledge-turso moves into objectstack: Apache-2.0, the platform embedder and splitter, listing, generations, the contract suite #37107

Backlog

Description

@os-bob

maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

Filing gate: ③ maintainer-directed (topic child). Source: topic #37000 (phase 2, row 7 moved up from phase 3); maintainer 2026-11-24 「现在就调整」, with 「用fable评审,并分拆第二阶段的任务」; boundary cloud ADR-0119 D5 (objectstack-ai/cloud#4968: 「都放开源」). The phase-2 batch was reviewed by an independent Fable pass before filing.
Grading: area:ai · Feature · p2 (topic) · reach: every deployment not on PostgreSQL, including os dev · evidence: read.

维护者速读

  • 做什么:把 cloud 仓库里的 libSQL 向量存储 knowledge-turso 搬进 objectstack 开源,改用平台的嵌入器和切分器,补上「列出文档」和换模型时的新一代索引,跑和 pgvector 同一套契约测试。
  • 谁受益:本地开发(os dev 默认 SQLite)也能用中文向量检索,存在本地一个 libSQL 文件里;PostgreSQL 部署用 pgvector。托管云以后也用它(托管接入在阶段三第 14 行)。
  • 需要你做的:无。从 cloud 仓库删掉旧包是另一张 cloud 卡,这张落地后由维护者会话处理。

What

Source: cloud packages/knowledge-turso (origin/main): libSQL native vectors (F32_BLOB + DiskANN libsql_vector_idx); URL libsql://, file: or :memory:, or a client passed in; its own OpenAIEmbeddingProvider (src/embedding.ts); one table per source, knowledge_`` <source.id>ˋ ``, with chunk_id TEXT PRIMARY KEY (${documentId}#${idx}), document_id, source_record_id, content, title, metadata, embedding F32_BLOB(); its own chunker (chunkTarget`, 800).

  1. packages/plugins/knowledge-turso (new in objectstack). LICENSE is Apache-2.0 text (today the cloud package's LICENSE holds BSL 1.1 text while package.json and headers say Apache-2.0; ADR-0119 D5 settles it). Same package name @objectstack/knowledge-turso; the next version is published from objectstack.
  2. Embedder: drop src/embedding.ts; use EMBEDDER_SERVICE (Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094 registers it in the open edition) or a constructor embedder: IEmbedder.
  3. Chunks: drop its own chunker; take the service's chunks (service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098) and declare that it accepts them.
  4. Layout changes the contract needs (today's layout has no hash, organization or generation):
  5. Fingerprint: the one ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return; knowledge_source becomes a governed type #37001 defines, handed in by the service (same member knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100 reads). Mismatch → "reindex needed", as in knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100. A build (service-knowledge: a source that was never built gets built, and an operator can start a rebuild #37099's trigger) writes a new generation table; when the walk ends, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096's purge reconciles, the generation becomes active, the old table is dropped. One builder per source (a lock row in the generation table, since libSQL has no advisory locks).
  6. Implements listDocuments (service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096). Runs the service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096 contract suite in CI on file: and :memory: libSQL (no special image); the PR confirms @libsql/client vector functions (vector32, vector_top_k) work on the CI runner.
  7. Default local location when the runtime mounts it (Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102): a libSQL file beside the dev database under .objectstack/data/, configurable.
  8. Docs: content/docs/protocol/knowledge.mdx adapter section, content/docs/ai/knowledge-rag.mdx.

Acceptance

Out of scope

Blocked-by: #37001, #37096, #37098, #37097 (organization member).
Parent: #37000. Reader: domain:server lane (packages/plugins/knowledge-*).
Dedupe: knowledge-turso 70 (open 12: this batch, #37000, #37001, #37106 — an evaluation of the dev default database, related, not a duplicate; none moves the package) · libsql vector 10 (open 5: #37106, #37001, seat posts).

Activity

  1. added theissue type on Nov 24, 2026
  2. added
    priority:p2
    area:ai
    on Nov 24, 2026
  3. os-bob commented on Nov 24, 2026

    @os-bob
    ContributorAuthor

    maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

    Input from the #37106 evaluation (PR #37120, measured 2026-11-24). It binds this card and #37102:

    • Own file, never the platform database file. With a libSQL vector index in a file, better-sqlite3 answered count(*) = 0 for a 200-row table, and integrity_check and VACUUM failed. Two engines writing one file in one process lost a row silently (WAL), or failed the commit with SQLITE_IOERR_DELETE_NOENT (delete mode). The turso store therefore opens its own libSQL file, never .objectstack/data/objectstack.db. Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102 must name a separate path.
    • Set WAL and a busy timeout on that file. In the measurement, libSQL on a file: URL with neither set lost 292 and 204 of 300 writes from a second process. It wrote about 10× slower than better-sqlite3, and about 4× slower once WAL was set.
    • Size and build time. 1,000 vectors of 1,536 dimensions grew a file from 8.2 MB to 329 MB, and the index build took 21.8 s. The docs should say so.
    • Windows on ARM. @libsql/win32-arm64-msvc does not exist on npm. On that platform the store must degrade with a clear error, like an unmounted adapter in Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102, not crash the boot.

    Generated by Claude Code

  4. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: first touch 2026-11-24T20:39Z

  5. added
    domain:server
    pm:blocked
    on Nov 24, 2026
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:aidomain:serverpm:blockedpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions