BM25 Context Relevance Scorer

BM25 Context Relevance Scorer MCP Connector for Claude

A+

Deterministic BM25 relevance scoring engine for RAG optimization.

3 tools Official Updated Oct 1, 2026 Official Vinkius Partner

This MCP server provides a precision engine for calculating document relevance using the BM25 algorithm. It allows AI agents to solve the RAG relevance problem without relying on expensive LLM calls by providing deterministic, mathematical scores. Use compute_relevance_score to find how relevant a specific document is to a query, calculate_term_weights to compute term importance (IDF), and analyze_document_composition to extract structural statistics like token counts and frequencies.

bm25ragrelevancenlpinformation-retrieval

3 tools expose this connector's capabilities to your AI agent.

analyze_document_composition

Extracts statistics from a document

calculate_term_weights

Computes the IDF for each term in a query

compute_relevance_score

Calculates the BM25 relevance score for a document

See how to talk to your AI agent using BM25 Context Relevance Scorer.

Calculate the relevance score for a query 'apple' in a document containing 'apple pie' with a corpus size of 100, term doc counts {'apple': 10}, and avg doc length 50.

The calculated BM25 score for the document is approximately 1.45, indicating high relevance.

What is the IDF weight for the term 'algorithm' in a corpus of 500 documents where it appears in 50 documents?

The calculated IDF weight for 'algorithm' is approximately 2.30.

Analyze the composition of this document: ['the', 'quick', 'brown', 'fox']

The document length is 4 tokens, and the term frequency map is {'the': 1, 'quick': 1, 'brown': 1, 'fox': 1}.

The engine uses the BM25 algorithm, calculating IDF based on corpus size and term prevalence, then applying length normalization and saturation constants.

Related Connectors