---
title: "搜索历史对话"
method: POST
path: "/messages/search"
tags: ["消息"]
---

# 搜索历史对话

`POST /messages/search`

通过关键词和/或向量相似度搜索历史对话记录，支持关键词、向量、混合三种模式

## Request body

- InternalHandlerSearchMessagesRequest
  - `limit` integer — Maximum number of results to return (default: 20)
  - `mode` string — Search mode: "keyword", "vector", "hybrid" (default: "hybrid")
  - `query` string, required — Query text for search
  - `session_ids` string[] — Filter by specific session IDs (optional)

## Response `200`

搜索结果

- object

## Other responses

- `400` — 请求参数错误

## Changes

- **2026-03-30** `08f8a25fbf1d` — 1 info
  - endpoint added
- **2025-12-16** `edf61e68559d` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/messages/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-service-production.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/a5ce73ad8921/schema)
