From agentdb-search
Maximal Marginal Relevance rerank — get diverse top-k instead of redundant top-k. Use when standard search returns 5 near-duplicates, or when you want broader coverage of a topic.
npx claudepluginhub ruvnet/agentdb --plugin agentdb-searchThis skill uses the workspace's default tool permissions.
Diversity reranking on top of vector search. MMR balances relevance to the query with novelty among the picked results.
LLM-powered multi-attribute reranking of candidate sets from SQL or lists via pairwise comparisons on clarity, technical depth, insight. Supports custom prompts, model tiers, TopK.
Covers RAG architecture including design patterns, chunking strategies, embedding models, retrieval techniques, hybrid search, and context assembly for LLM pipelines.
Build RAG systems for LLM apps using vector databases, embeddings, and retrieval strategies. Use for document Q&A, grounded chatbots, and semantic search.
Share bugs, ideas, or general feedback.
Diversity reranking on top of vector search. MMR balances relevance to the query with novelty among the picked results.
agentdb_diversity_rank(
query: <embedding | string>
candidates: <id list> // typically the top-50 from vector search
k: 5 // final size
lambda: 0.5 // 0=pure diversity, 1=pure relevance
)
MMR picks greedily:
score(i) = λ · sim(query, i) - (1-λ) · max sim(i, picked_j)
High λ → behaves like vanilla top-k (relevance-only). Low λ → emphasizes novelty among picks.
Default λ = 0.5 is a sensible balance for most uses.
agentdb_diversity_rank with k=5.This is a 50→5 reduction with much higher topic coverage than top-5 directly.
lambda: 'auto' and let it learn.