Add external knowledge base support for HTTP-based RAG retrieval #1783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概述 / Overview
Extends RAG capabilities with external knowledge bases via HTTP API. Built-in knowledge bases had limited retrieval quality; external KBs allow integration with superior third-party retrieval services (e.g., Dify-compatible APIs).
实现细节 / Implementation Details
Backend Architecture:
KnowledgeBaseInterfacefor polymorphic KB handling (internal/external)ExternalKnowledgeBaseimplementation with async HTTP client, Bearer auth supportExternalKnowledgeBasepersistence table (uuid, name, api_url, api_key, top_k)/api/v1/knowledge/external-basesFrontend UI:
API Contract:
Backward Compatibility:
knowledge-basesarray field already supportedknowledge-basestring still works检查清单 / Checklist
PR 作者完成 / For PR author
项目维护者完成 / For project maintainer
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.