
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
rerank-ts is a lightweight TypeScript library for re-ranking search results from retreival systems.
Adding Re-Ranking almost always improves accuracy of retrieval pipelines. If you are building a RAG application, and using semantic search or full-text search using this library to re-rank the results will improve accuracy of the application in most cases. However, re-ranking usually adds some amount of latency. We have added knobs in the LLM ReRanker to control latency.
Install rerank using npm:
npm install rerank
Available Providers:
ProviderGroqProviderOpenAIModel Providers are implemented with a clean interface, we welcome contributions to add support for other model providers from the community!
Example Usage:
import { LLMReranker, ProviderGroq } from "rerank";
const provider = new ProviderGroq("llama3-8b-8192", API_KEY);
const reranker = new LLMReranker(provider);
// Replace with your own list of objects to rerank.
const list = [
{ key: "bc8fe338", value: "I hate vegetables" },
{ key: "236386f2", value: "I love mangoes" },
];
const query = "I love apples";
const result = await reranker.rerank(list, "key", "value", query);
// ["236386f2", "bc8fe338"]
Combine multiple rank lists by assigning scores based on reciprocal ranks, effectively prioritizing higher-ranked items across all lists. Paper
Example Usage:
import { reciprocalRankFusion } from "rerank";
// Example structure of a search result for this usage example
interface SearchResult {
url: string; // we will use this as our key identifier
name: string;
}
// Assume you are searching with 3 different queries and fetching results
// searchIndex is just for demonstration purposes and should be replaced with your actual search implementation
const rankedLists: SearchResult[][] = await Promise.all([
searchIndex("exampleIndex1", "person riding skateboard"),
searchIndex("exampleIndex2", "person skating on the sidewalk"),
searchIndex("exampleIndex3", "skateboard trick"),
]);
// Perform Reciprocal Rank Fusion (RRF) on all of the results
// The RRF function takes the ranked lists and a key identifier, in this case "url"
// It returns a map of all URLs now ranked with an RRF score
const rankedURLs = reciprocalRankFusion(rankedLists, "url");
// Build a map of results keyed by URL for easy access
const resultsMap = new Map<string, SearchResult>();
rankedLists.flat().forEach((result) => {
resultsMap.set(result.url, result);
});
// Get a single sorted list of results based on the RRF ranking
const sortedResults = Array.from(rankedURLs.keys()).map((url) => {
return resultsMap.get(url);
});
FAQs
rerank library for easy reranking of results
We found that rerank demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.