Provides four fusion methods: Reciprocal Rank Fusion (RRF) for general use, linear combination for tunable balance, cross-encoder reranking for highest quality, and cascade filtering for efficiency
Includes production-ready templates for PostgreSQL with pgvector, Elasticsearch with dense vectors, and custom Python pipelines with parallel search execution
Confirm successful installation by checking the skill directory location:
.cursor/skills/hybrid-search-implementation
Restart Cursor to activate hybrid-search-implementation. Access via /hybrid-search-implementation in your agent's command palette.
β
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
from typing import List, Dict, Tuple
from collections import defaultdict
defreciprocal_rank_fusion( result_lists: List[List[Tuple[str,float]]], k:int=60, weights: List[float]=None)-> List[Tuple[str,float]]:"""
Combine multiple ranked lists using RRF.
Args:
result_lists: List of (doc_id, score) tuples per search method
k: RRF constant (higher = more weight to lower ranks)
weights: Optional weights per result list
Returns:
Fused ranking as (doc_id, score) tuples
"""if weights isNone: weights =[1.0]*len(result_lists) scores = defaultdict(float)for result_list, weight inzip(result_lists, weights):for rank,(doc_id, _)inenumerate(result_list):# RRF formula: 1 / (k + rank) scores[doc_id]+= weight *(1.0/(k + rank +1))# Sort by fused scorereturnsorted(scores.items(), key=lambda x: x[1], reverse=True)deflinear_combination( vector_results: List[Tuple[str,float]], keyword_results: List[Tuple[str,float]], alpha:float=0.5)-> List[Tuple[str,float]]:"""
Combine results with linear interpolation.
Args:
vector_results: (doc_id, similarity_score) from vector search
keyword_results: (doc_id, bm25_score) from keyword search
alpha: Weight for vector search (1-alpha for keyword)
"""# Normalize scores to [0, 1]defnormalize(results):ifnot results:return{} scores =[s for _, s in results] min_s, max_s =min(scores),max(scores) range_s = max_s - min_s if max_s != min_s else1return{doc_id:(score - min_s)/ range_s for doc_id, score in results} vector_scores = normalize(vector_results) keyword_scores = normalize(keyword_results)# Combine all_docs =set(vector_scores.keys())|set(keyword_scores.keys()) combined ={}for doc_id in all_docs: v_score = vector_scores.get(doc_id,0) k_score = keyword_scores.get(doc_id,0) combined[doc_id]= alpha * v_score +(1- alpha)* k_score
returnsorted(combined.items(), key=lambda x: x[1], reverse=True)
Template 2: PostgreSQL Hybrid Search
import asyncpg
from typing import List, Dict, Optional
import numpy as np
classPostgresHybridSearch:"""Hybrid search with pgvector and full-text search."""def__init__(self, pool: asyncpg.Pool): self.pool = pool
asyncdefsetup_schema(self):"""Create tables and indexes."""asyncwith self.pool.acquire()as conn:await conn.execute("""
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS documents (
id TEXT PRIMARY KEY,
content TEXT NOT NULL,
embedding vector(1536),
metadata JSONB DEFAULT '{}',
ts_content tsvector GENERATED ALWAYS AS (
to_tsvector('english', content)
) STORED
);
-- Vector index (HNSW)
CREATE INDEX IF NOT EXISTS documents_embedding_idx
ON documents USING hnsw (embedding vector_cosine_ops);
-- Full-text index (GIN)
CREATE INDEX IF NOT EXISTS documents_fts_idx
ON documents USING gin (ts_content);
""")asyncdefhybrid_search( self, query:str, query_embedding: List[float], limit:int=10, vector_weight:float=0.5, filter_metadata: Optional[Dict]=None)-> List[Dict]:"""
Perform hybrid search combining vector and full-text.
Uses RRF fusion for combining results.
"""asyncwith self.pool.acquire
β
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
βΊAccess to product documentation and roadmap tools (Jira, Notion, etc.)
βΊUnderstanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
βΊStakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Steps
1Install product management skill
2Start with user story generation for known feature
3Progress to competitive analysis: research 2-3 competitors
4Use for roadmap prioritization: apply RICE/ICE scoring
5Draft stakeholder communications and refine based on feedback
6Build template library for recurring PM tasks
7Share effective prompts with product team
Common Pitfalls
β Not validating competitive researchβverify facts before sharing
β Accepting user stories without involving engineering team
β Over-relying on frameworks without qualitative judgment
β Not customizing outputs to company culture and communication style
β Skipping stakeholder validation of generated requirements
Best Practices
β Do
+Validate research and competitive analysis with real data
+Collaborate with engineering when generating technical requirements
+Customize frameworks and templates to your company context
+Use skill for first drafts, refine with stakeholder input
+Document successful prompt patterns for PM tasks
+Combine AI efficiency with human judgment and intuition
β Don't
βDon't publish competitive analysis without fact-checking
βDon't finalize user stories without engineering review
βDon't make prioritization decisions solely on AI scoring
βDon't skip customer validation of generated requirements
βDon't ignore company-specific context and culture
π‘ Pro Tips
β Provide context: company goals, constraints, customer feedback
β Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
β Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
β Use skill for 70% generation + 30% customization to company needs
When to Use This
β Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
β Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path
1Basic: user stories, feature specs, status updates