Why MMR keeps returning duplicate chunks to your agent: check candidates_limit first
izgorodin · reddit · 2026-10-13
If your agent gets five near-identical passages after enabling maximal marginal relevance, the culprit is often the candidate pool, not the prompt.
Key points:
- In Qdrant's native MMR query, candidateslimit defaults to limit; with 5 candidates and limit=5, membership can't change, only order.
- Diagnostic: keep query vector, filters, diversity=0.5 and limit=5 fixed, compare candidateslimit=5 vs 30, then inspect IDs and text — did you gain real evidence or just reworded copies?
- Caveats: a bigger cap won't help if only 5 eligible candidates exist, and may pull in less relevant material. This only affects what reaches the agent per call; stored data is untouched, and version/contradiction resolution needs separate handling.
More from coding & agent
- Dev ships throwaway Postgres for agents: pg19 via pglite on Cloudflare DO over raw TCP — ritakozlov · 2026-11-29
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- PM shares playbook for shipping 4 customer-facing Claude agents into production — PawelHuryn · 2026-11-29