Skip to content

docs(rfc): propose scope-based knowledge bases - #2570

Merged
hidb4ai merged 13 commits into
masterfrom
codex/rag-knowledge-base-rfc
Nov 21, 2026
Merged

hidb4ai merged 13 commits into
masterfrom
codex/rag-knowledge-base-rfc

Conversation

@Zxf-xufeng

@Zxf-xufeng Zxf-xufeng commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Refs #2440, #2441, #2442, #2443 and #2444. This design-only PR does not close implementation issues. Framework dependencies are #2659 and #2660, building on #2549/#2579; #2617 is a future collection integration.

Rationale for this change

One knowledge-base plugin owns whole-document Artifacts, ingestion, chunks and retrieval. Each knowledge base is a core Scope. Plugin-local space Scopes organize bases and user defaults without adding a core hierarchy or inherited permissions.

What changes are included in this PR?

Only the English and Chinese RFCs at docs/{en,zh}/rfcs/2570-knowledge-base.md:

  • Explicit creation identities and pinned spaces across retries; four plugin domain tables; scoped cross-base retrieval and independent models.
  • Local OpenDAL snapshots, immutable original/processing Sources, Markdown/RapidOCR parsing, structural chunking, framework cursor consumption and immutable index/result publication.
  • Generic synchronous document edits/removals with revision and lineage-only evidence; native forget without a content revision, retaining authorized history.
  • Dashboard upload/import, processing status, chunk/history browsing, editing, forgetting and multi-base search.
  • Explicit dependency and ownership boundary: docs(rfc): align the plugin RFCs with the merged implementation and amend edit evidence and page access to Artifact APIs #2659/fix(plugins): host Pipes, Scope API, user-change evidence and checks, page access to Artifacts, and storage on OceanBase and seekdb #2660 provide dedicated storage, edit evidence, transaction-bound authorization, governance checks and client.artifacts; the knowledge-base implementation does not modify those framework components.
  • Revoked-default recovery while implicit queries fail closed; descriptor-bound import paths; publication/conflict status reconstruction after a lost observation; stale Dashboard results discarded after navigation. Personal-space/default initialization is idempotent and repairs interruption without overwriting a selected default.

Are there any user-facing changes?

Documentation only. No runtime, core schema or generated API changes. The proposed first release supports SQLite, SeekDB and OceanBase, subject to framework integration and real-backend acceptance. Framework proposals are not treated as already available on master.

How was this change tested?

AI usage statement

OpenAI Codex assisted with bilingual drafting, contract comparison and documentation validation.

@AlexStocks AlexStocks added the 1.5.2 v1.5.2 release tracking label Nov 10, 2026

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found in this RFC at bb57856. This approval covers the bilingual design documents only; the proposed tables and APIs, real OCR, and three-backend acceptance remain implementation work.

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zxf-xufeng Zxf-xufeng changed the title docs(rfc): propose rag document knowledge bases docs(rfc): propose knowledge-base business plugin Nov 11, 2026

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking design issues found at 71e842c. This approval covers the bilingual RFC only; the three plugin domain tables and plugin APIs remain proposed implementation work. Current CI is incomplete because preflight was cancelled, so this approval does not clear the CI gate or establish runtime, OCR, or three-backend acceptance.

@Zxf-xufeng Zxf-xufeng changed the title docs(rfc): propose knowledge-base business plugin docs(rfc): propose scope-based knowledge bases Nov 13, 2026

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasper-yl

Copy link
Copy Markdown
Contributor

关于插件专属存储的范围

这份 RFC 把「三后端 ctx.storage」列为框架适配项(第 1、4、10 节),对应的实现 PR #2658 也修改了 src/powercontext/builtin/plugins/storage.py。我们认为这超出了一个插件 RFC 的范围:

  1. ctx.storage 在 SeekDB / OceanBase 上的行为已经由 RFC docs(rfc): propose plugin interfaces #2549 定义(库名 powercontext_plugin_<插件名>、由 core 首次使用时创建、建库权限不足时由部署者预建)。master 目前只实现了 SQLite,其余后端是框架的待办,会由框架侧按 docs(rfc): propose plugin interfaces #2549 的约定单独实现。
  2. feat: implement knowledge-base plugin with revisioned chunks and Dashboard #2658 中的实现与 docs(rfc): propose plugin interfaces #2549 不一致(库名改为哈希,部署者无法预建;直接依赖 persistence 的私有函数),不适合随插件 PR 合入。

建议本 RFC 和 #2658 去掉对框架存储的修改,知识库插件在以下两种方式中选择:

  • 使用框架的 ctx.storage:首期只支持 SQLite,框架补齐 SeekDB / OceanBase 后自动获得支持。
  • 使用插件自己的数据库:docs(rfc): propose plugin interfaces #2549 允许插件连接自己的任何数据库,连接配置由插件自己管理,不需要改动框架。

On the scope of plugin storage

This RFC lists "three-backend ctx.storage" as a framework adaptation (sections 1, 4, 10), and the implementation PR #2658 changes src/powercontext/builtin/plugins/storage.py. We think this is outside the scope of a plugin RFC:

  1. The behavior of ctx.storage on SeekDB / OceanBase is already defined by RFC docs(rfc): propose plugin interfaces #2549 (a database named powercontext_plugin_<plugin name>, created by core on first use, pre-created by the deployer when the login cannot create databases). master implements SQLite only; the other backends are framework work and will be implemented separately on the framework side, following docs(rfc): propose plugin interfaces #2549.
  2. The implementation in feat: implement knowledge-base plugin with revisioned chunks and Dashboard #2658 differs from docs(rfc): propose plugin interfaces #2549 (a hashed database name that deployers cannot pre-create; direct use of private persistence functions) and should not be merged as part of a plugin PR.

We suggest removing the framework storage changes from this RFC and from #2658. The knowledge-base plugin can choose either:

  • Framework ctx.storage: SQLite only in the first release; SeekDB / OceanBase support arrives when the framework adds it.
  • The plugin's own database: docs(rfc): propose plugin interfaces #2549 allows a plugin to connect to any database it manages itself, with its own connection settings and no framework change.

@jasper-yl

Copy link
Copy Markdown
Contributor

关于另外两项框架适配:编辑证据和 Dashboard 转发

接着上面关于存储的说明,这份 RFC 列出的另外两项框架适配,我们的看法相同:它们是框架的问题,由框架侧单独实现,不随插件 RFC 和 #2658 合入。

  1. core 保存用户原始编辑载荷。 通用 update / create 的 content 对 core 是不透明的,插件可以在 update_artifact 中把它转换成另一份内容再写入。master 目前记录的 lineage_only 证据是插件写入的内容,而不是用户提交的内容。这是框架证据语义的问题,对所有插件都成立,会在框架侧修正,并在 RFC docs(rfc): propose plugin interfaces #2549 中写明。
  2. Dashboard 转发通用操作。 插件页面目前只能调用本插件声明的路由,无法发起与通用接口等价的用户修改。框架侧会让 Dashboard 向插件页面开放针对该插件所声明 family 的通用 Artifact 操作:以当前用户身份执行,保留通用接口的全部权限检查和版本前置条件。

建议本 RFC 把这两项和存储一样改为「依赖框架提供的能力」,#2658 移除对 builtin/plugins/host.py、builtin/plugins/writer.py、powercontext/plugins.py 和 server/dashboard/ 中对应部分的修改。插件侧的设计(编辑走通用 PUT、页面调用通用操作)可以保持不变,等框架侧的 PR 合入后直接使用。

#2658 中其余的框架改动(tx.put 的 expected_state_version、ctx.require("artifact.write", ...)、写事务中的鉴权连接绑定)不在本 RFC 的适配项里,我们会在 #2658 的评审中单独讨论。


On the other two framework adaptations: edit evidence and Dashboard forwarding

Following the storage note above, we take the same view of the other two framework adaptations this RFC lists: they are framework concerns and will be implemented separately on the framework side, not merged through the plugin RFC and #2658.

  1. Core keeps the caller's original edit payload. The content of a generic update / create is opaque to core, and a plugin may transform it in update_artifact before writing. master currently records the content the plugin wrote as the lineage_only evidence, not the content the caller submitted. This is a question of the framework's evidence semantics and applies to every plugin; it will be fixed on the framework side and stated in RFC docs(rfc): propose plugin interfaces #2549.
  2. Dashboard forwarding of generic operations. A plugin page can currently call only the routes its plugin declares, so it cannot start a user change equivalent to the generic API. The framework will let the Dashboard open the generic Artifact operations for the plugin's declared family to that plugin's page: executed as the current user, with all permission checks and version preconditions of the generic API.

We suggest this RFC treat these two items, like storage, as capabilities the framework provides, and that #2658 drop the corresponding changes to builtin/plugins/host.py, builtin/plugins/writer.py, powercontext/plugins.py, and server/dashboard/. The plugin-side design (editing through the generic PUT, the page calling generic operations) can stay as it is and use these capabilities once the framework PRs are merged.

The remaining framework changes in #2658 (expected_state_version on tx.put, ctx.require("artifact.write", ...), and binding the access connection inside the write transaction) are not among this RFC's adaptation items; we will discuss them separately in the review of #2658.

@Zxf-xufeng

Copy link
Copy Markdown
Member Author

Addressed the storage ownership and edit-evidence/Dashboard boundary comments in b9a688a. Both RFC locales now make #2659/#2660 explicit prerequisites and assign storage provisioning, original edit-payload evidence, transaction-bound authorization, governance checks and the generic Artifact bridge to the framework PRs. #2658 no longer changes those framework components.

The RFCs specify client.artifacts, automatic writer governance tracking and the framework SQL namespace. They also define revoked-default recovery without implicit fallback, descriptor-bound local imports, recoverable conflict status after cursor commit and stale Dashboard response handling. The detailed design was synchronized, and both RFCs passed metadata, JSON-example, local-link and MDX checks.

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexStocks AlexStocks added the 1.6.0 v1.6.0 release tracking label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.0 v1.6.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants