context-ranking

Solid

Rank an existing set of context chunks by relevance, diversity, freshness, and utility. Use when retrieval has already produced candidates that must be scored or reranked; use context-retrieval when the source corpus still needs to be searched.

AI & Automation 161 stars 32 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Context Ranking Context ranking is the process of ordering retrieved text chunks so the most relevant, diverse, and useful information rises to the top. In any retrieval pipeline, the initial search returns a broad set of candidates -- many of which are only tangentially related to the query. Ranking transforms this unordered candidate set into a prioritized list, enabling downstream steps (context assembly, prompt construction) to select the best material and discard the rest. Effective ranking is the difference between a grounded, precise answer and a vague, off-topic one. ## Workflow 1. **Collect Candidate Chunks**: Gather the initial set of retrieved chunks from the search layer. This is typically the top-k results (k = 15-30) from a vector search, keyword search, or hybrid search. Each chunk arrives with a preliminary score (e.g., cosine similarity or BM25 score) and source metadata. 2. **Apply First-Stage Scoring**: Score each candidate with a fast, lightweight algorithm. BM25 is the standard choice for keyword relevance; cosine similarity between the query embedding and chunk embedding is the standard for semantic relevance. In hybrid pipelines, compute both scores and combine them using Reciprocal Rank Fusion (RRF) or a weighted linear combination. This stage is meant to be fast and run over all candidates. 3. **Rerank with a Cross-Encoder**: Pass the top candidates (typically 15-25) from the first stage through a cross-encoder reranker. Unlike bi-encoder embed...

Details

Author
seb1n
Repository
seb1n/awesome-ai-agent-skills
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

context-retrieval

Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query. Use when the task starts with a corpus or index that must be searched; use context-ranking when candidate chunks already exist and only need ordering.

161 Updated 1 weeks ago
seb1n
AI & Automation Listed

code-context

How to answer codebase questions with the code-context MCP tools (search, sql, reindex): ranked hybrid keyword+semantic search, relevance-ranked SQL aggregation over the index, and index lifecycle. Use when a question spans many files ("how does X work", "where is Y handled"), when ranking or counting code by topic across a repo, or when the code-context tools are present but deferred and need loading before use. Not needed for jumping to one known identifier - plain grep is fine there.

20 Updated yesterday
infino-ai
AI & Automation Listed

can-i-actually-rank

Check whether a candidate keyword is actually winnable by reading the live SERP, then apply five commercial filters. Ends every candidate in QUALIFY, CONDITIONAL or KILL, kills freely, and never treats vendor authority scores as evidence. Use this skill whenever the user asks to: - Check whether they can rank for a keyword before building content - Qualify or kill a list of keyword candidates - Understand what format Google actually rewards for a query - Decide whether a topic is worth the effort Trigger even for casual requests like "can we rank for this", "check the SERPs for these keywords", "is this winnable", "should we bother with this keyword", "qualify this list".

0 Updated 2 weeks ago
vcxcvii