deer-flow/examples/deerflow-extension-knowledge-center
Xinmin Zeng 2a97ec3e58
docs: turn README into an index and move reference detail to docs/guide (#8113)
* docs: turn README into an index and move reference detail to docs/guide

The README had grown to 393 KB because every change appended its notes there. The text moves verbatim into 18 topic guides under docs/guide/; only headings are re-leveled and relative links re-pointed. The README keeps the introduction, a quick start and a guide index. Contributor test notes move to CONTRIBUTING.md.

* docs: send user docs to topic guides and budget the root README

The rule 'update README.md for user-facing changes' is what grew the README. Guidance now points to docs/guide/, and check_agent_guidance.py fails when the root README exceeds 16 KiB (AG003).

* chore: remove unreferenced screenshots and finished plan notes

pr-build/ holds two PR screenshots (3 MB) from #1986. plans/ holds the plan for the merged #4049. docs/SKILL_NAME_CONFLICT_FIX.md is a February change note. Nothing references them.

* docs: route always-loaded AGENTS.md files to scoped guides

* docs(agents): cut scoped guides to scope, verify, traps, decisions

Each AGENTS.md keeps four kinds of content: the scope of the directory, the
verification commands, traps a local test run does not show, and decisions the
code cannot state. Values, field lists, function inventories, test names, issue
numbers and history are deleted, because the code, the tests and git state them.

Search and fetch providers share one community guide. Four guides with no
remaining content are removed. The size check now allows 6 KiB per file (hard
limit 8 KiB) and 24 KiB per chain (hard limit 32 KiB).

* style: format frontend guide table and guidance test imports

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-11 13:26:17 +08:00
..

Optional knowledge center extension

First usable UI slice of phase 4 in #6269's five-stage plan, consuming the platform and management APIs merged in #7417 and #7293. This browser-only Full-Stack Plugin registers an independently enabled page. It adds no Provider, credentials, parser, document store, model tool or authorization bypass.

Installation

From the repository root:

make extension-install SOURCE=./examples/deerflow-extension-knowledge-center

Install and configure the knowledge platform and knowledge management separately. The management namespace must remain enabled; its direct routes may be disabled with routes_enabled: false. Add this entry alongside those entries in operator-owned config.yaml, then restart Gateway:

plugins:
  # Keep the separately configured management and platform entries here.
  - use: deerflow_extension_knowledge_center:install
    config:
      enabled: true

The only page setting is boolean enabled (default false). Endpoints, keys, factories and identities are rejected. The package requires the host's optional SurfaceContext.requestBackend introduced with this example; older hosts display an update message. Open Knowledge center / 知识中心 in the workspace sidebar, or /workspace/extensions/knowledge-center/library.

Set enabled: false, disable the entry point, or uninstall and restart Gateway to remove the page entry. Reload browser tabs to refresh discovery. This does not disable the platform/management API, delete policy data or upstream documents, or affect chat retrieval. Page hiding is not authorization. Installing the UI without the platform displays an unavailable state.

Use and behavior

  1. Choose an accessible space and mapped knowledge base. The current projection supplies native base IDs rather than human base titles; the selector preserves them and distinguishes connections. Empty membership/resource sets have explicit next steps.
  2. The server intersects space policy with actual Provider capabilities. Non-admin members can browse effective resources but see no management controls when management authorization fails. Capability discovery is not a write grant: every server request still checks the real user, both plugin namespaces, space policy and unchanged Provider grants.
  3. Import text, an HTTP(S) URL or a nonempty file up to 16 MiB using supported operations. Supported processing options preserve explicit false and validate paired chunk fields. Omitted new-document options inherit platform defaults. Files use the existing raw upload route, without base64 or plugin-action size limits.
  4. Inspect returned document snapshots or look up an existing document by upstream ID. Refresh is explicit. Reprocess/cancel require inline confirmation; reprocessing sends empty options to preserve upstream settings. Document read ordering prevents an older status response from replacing a newer processing response.

Requests use the configured Gateway URL, host credentialed CSRF fetcher, page cancellation signal and descriptor-bound viewer header. Gateway rejects stale viewers before contributed routes run, including when another tab switches accounts. Redirects are rejected; writes are never automatically retried.

After any failed submitted write, the page warns that the Provider may already have accepted it and disables further writes until the user explicitly acknowledges upstream reconciliation. Check the upstream directory or query status first. Capability rejection before submission does not submit a write. Leaving the page can abort the browser wait but cannot cancel an already accepted upstream operation.

Delivery boundary

  • This is the first phase-4 slice, not the whole phase. The current management contract has no complete document/task listing, independent entry browsing/editing/versions or graph browsing API. The page explains unavailable features without inventing directories, graphs or editing endpoints. These require follow-up reviewed Provider contracts.
  • At most 50 snapshots are held for the selected resource during this visit. They are not a durable task ledger. Reload, space/resource changes, unmount and account changes discard state. No user content is stored in localStorage/sessionStorage.
  • Unknown stays unknown; 202 is not completion. searchable never implies all Wiki/graph/summary steps succeeded. No percentages, step timelines, elapsed times or Trace events are fabricated. Phase 5 still needs real events.
  • This page does not edit platform policy/membership, create upstream bases, change chat scope, grant retrieval access or impersonate upstream users. Existing retrieval works independently.

Verification

cd backend
uv run --no-sync pytest tests/test_knowledge_center_extension.py tests/test_auth_middleware.py tests/test_knowledge_platform_extension.py -q
cd ../frontend
pnpm check
pnpm exec rstest run tests/unit/core/extensions
pnpm exec playwright test tests/e2e/knowledge-center.spec.ts

Tests load the real extension/static registry, exercise Gateway authentication middleware over HTTP (including root paths and stale viewers), and load shipped native browser modules through the real host with mocked management HTTP. This is synthetic contract coverage, not a live WeKnora or production multi-user acceptance claim. Results are recorded in VALIDATION.md.