hybrid_search
Find memories by combining exact keyword matching with semantic similarity, so relevant results appear even when wording differs from stored memories.
Instructions
Hybrid search: BM25 full-text + vector similarity, fused with Reciprocal Rank Fusion.
Best default choice for "find memories about X" — combines exact keyword
matches (BM25) with semantic similarity, so it doesn't miss relevant
memories that use different words than the query (e.g. "显卡" vs "GPU").
Passing just query runs both branches — the server embeds the query text
itself (ollama, server-side) for the vector branch, no client-side
embedding model needed. Provide at least one of query/embedding.
Args:
query: Free-text query. Drives the BM25 branch (jieba-segmented
server-side) and, unless embedding is given, is also embedded
server-side for the vector branch. Optional if embedding is given.
embedding: Precomputed query embedding for the vector branch, advanced/
optional — normally you just pass query and let the server embed it.
user_id: Restrict to a specific user.
agent_id: Restrict to a specific agent's memories.
type: Restrict to a specific memory type.
limit: Max number of results (1-100). Defaults to 10.
rerank: Rerank the fused top results with the optional cross-encoder
(Qwen3-Reranker-0.6B). Off by default — adds latency; silently
falls back to RRF order if the reranker isn't enabled/available
server-side (HCC_RERANK_ENABLED).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | ||
| limit | No | ||
| query | No | ||
| rerank | No | ||
| user_id | No | ||
| agent_id | No | ||
| embedding | No |