---
title: "知识搜索"
method: POST
path: "/sessions/search"
tags: ["问答"]
---

# 知识搜索

`POST /sessions/search`

在知识库中搜索（不使用LLM总结）

## Request body

- InternalHandlerSessionSearchKnowledgeRequest
  - `knowledge_base_id` string — Single knowledge base ID (for backward compatibility)
  - `knowledge_base_ids` string[] — IDs of knowledge bases to search (multi-KB support)
  - `knowledge_ids` string[] — IDs of specific knowledge (files) to search
  - `mentioned_items` InternalHandlerSessionMentionedItemRequest[] — Optional scoped tag mentions
    - `id` string
    - `kb_id` string — Parent knowledge base for file/tag mentions
    - `kb_name` string — Display name for parent KB
    - `kb_type` string — "document" or "faq" (only for kb type)
    - `name` string
    - `service_id` string — Parent MCP service for MCP tool mentions
    - `skill_name` string — Preloaded agent skill name
    - `type` string — "kb", "file", "tag", "mcp", "skill"
  - `query` string, required — Query text to search for
  - `tag_ids` string[] — Tag IDs for filtering within a single KB

## Response `200`

搜索结果

- object

## Other responses

- `400` — 请求参数错误

## Changes

- **2025-12-22** `e625bcd5b8b9` — 1 info
  - the endpoint scheme security `ApiKeyAuth` was added to the API
- **2025-12-16** `edf61e68559d` — 1 info
  - the endpoint scheme security `ApiKeyAuth` was removed from the API

[Change history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/sessions/search/post.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tencentblueking/apis/weknora-api/revisions/ef2e057b249e?raw)
