WeKnora/website-docs/03-features
Zhang GH aac4f1586b
Fix/hybrid search match count normalization (#2750)
* fix(hybrid-search): normalize MatchCount once instead of at the truncation site

An omitted match_count deserializes to Go's zero value, which reached the
truncation step in HybridSearch and sliced the deduplicated chunk list to
[:0] — a successful retrieval returned an empty result set. A negative
value panicked on that same slice bound and surfaced as a 500.

Resolve the value once at the top of HybridSearch via normalizedMatchCount
so all three consumers agree, rather than patching the truncation site
alone: the over-retrieval floor, the FAQ iterative-retrieval trigger
(which never fired on this path because len(chunks) < 0 is false), and the
truncation itself.

Bound the FAQ iterative path while here, since normalization is what makes
it reachable with a large MatchCount: its TopK seeds from MatchCount*3 and
doubles five times, previously without limit. It now stops at the pool cap
instead of re-issuing an identical query.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(retrieval): share the default retrieval depth as one constant

The value 50 was written three times — the over-retrieval floor in
HybridSearch, the MatchCount fallback added alongside it, and
RetrievalConfig.GetEffectiveEmbeddingTopK — with nothing recording that the
three are meant to agree. Anyone tuning one would silently desync the
others.

Promote it to types.DefaultRetrievalTopK. No behavior change.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: drakezhang <drakezhang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 11:36:38 +08:00
..
01-tenant-auth.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
02-knowledge-base.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
03-document-parsing.md fix(docker): 默认在 app 镜像中链接 anydoc 解析引擎 2026-08-16 13:31:51 +08:00
04-chunking.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
05-retrieval-engines.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
06-models.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
07-agent.md feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
08-mcp.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
09-knowledge-graph.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
10-datasource.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
11-web-search.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
12-im-integration.md feat(im): process file attachments in QA 2026-08-12 16:08:51 +08:00
13-embed-channel.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
14-wiki.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
15-evaluation.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
16-observability.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
17-faq.md Fix/hybrid search match count normalization (#2750) 2026-08-20 11:36:38 +08:00
18-chat-experience.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
19-storage-backends.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
20-platform-admin.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00
21-file-access.md docs(website-docs): add comprehensive product documentation site 2026-08-06 19:54:40 +08:00