知识库

底层召回:向量+关键词混合检索,默认不 rerank(可用 rerank 字段开启);一般检索请用 /knowledge-search。推荐 POST,GET 带 JSON 体仅兼容旧客户端。

get/knowledge-bases/{id}/hybrid-search

Request

  • Base URL
    /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/v1/knowledge-bases/{id}/hybrid-search
  • Auth
    • API key in header Authorization
    • or API key in header X-API-Key

Path parameters

idstring required

知识库ID

Query parameters

resource_urls'handle' | 'public'

文件引用形式,public 返回可加载直链

Request body

disable_keywords_matchboolean

Turns keyword matching off, leaving vector matching only.

disable_vector_matchboolean

Turns vector matching off, leaving keyword matching only.

keyword_thresholdnumber

Minimum keyword score a hit needs; 0 keeps every keyword hit.

knowledge_base_idsstring[]

KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch, allowing a single retrieval call to span multiple KBs that share the same embedding model. When empty, HybridSearch uses its own id parameter.

knowledge_idsstring[]

Limits the search to these documents of the knowledge base.

match_countinteger

Number of chunks to return; 0 uses the default.

only_recommendedboolean
query_embeddingnumber[]
query_textstring

QueryText is required unless query_embedding is provided, keyword matching is disabled, and vector matching remains enabled.

scope_tag_idsstring[]
skip_context_enrichmentboolean

SkipContextEnrichment skips fetching parent, nearby, and relation chunks in processSearchResults. Used by the chat pipeline where context assembly is handled separately in the merge stage.

tag_idsstring[]

Tag IDs for filtering (used for FAQ priority filtering)

vector_thresholdnumber

Minimum vector similarity a hit needs; 0 keeps every vector hit.

Response

搜索结果

successboolean

Example response

{
  "success": true
}

Changes