2 Commits

Author SHA1 Message Date
dolphin cee2207f5b refactor: update architecture documentation, clean up local dev environment, and consolidate coding rules 2026-06-07 14:26:14 +08:00
LineWalker d1fbd19cfd feat(knowledge): add POST /api/v2/filelib/retrieve open endpoint
Expose pure chunks retrieval as an OpenAPI surface so external systems
(e.g. DeepAgents-style agents bringing their own LLM) can use BiSheng
knowledge bases as a retrieval tool without engaging the SSE RAG path.

- POST /api/v2/filelib/retrieve, authenticated as default_operator
- Supports multiple knowledge bases in one call with per-KB tag filters
  (ANY mode; ALL reserved for future use)
- Each returned chunk is tagged with knowledge_id for source attribution
- Reuses _build_folder_search_kwargs + KnowledgeRetrieverTool (RRF +
  primary-version filter) from KnowledgeSpaceChatService
- 13 unit tests covering input validation, multi-KB merge, top_k
  truncation, tag-name resolution, and KB-not-found
- API reference at docs/api/filelib-retrieve.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 18:39:23 +08:00