Overview
Pack the best passages into a token budget with Maximal Marginal Relevance: relevance from your scores or BM25, redundancy from TF-IDF cosine, exact token count, citation labels. Selects passages greedily by Maximal Marginal Relevance (Carbonell and Goldstein 1998): lambda * relevance - (1 - lambda) * maximum TF-IDF cosine similarity to the passages already chosen; passages that no longer fit the budget are skipped.
Protocol
x402 (POST)
Price
$0.0030
Payment Asset
USD Coin
Payment Network
eip155:8453
Category
uncategorized
Provider
denk
Indexed
2026-11-20 16:11:04
Health
Status
unknown
Latency (p50)
—
Uptime (30d)
—
Reliability Score
—
Last Checked
Never
Last Healthy
Never
Consecutive Failures
0
Input Schema
{
"body": {
"budget_tokens": 200,
"passages": [
{
"id": "a",
"score": 0.9,
"text": "Die Kündigungsfrist beträgt drei Monate."
},
{
"id": "b",
"score": 0.4,
"text": "Die Kaution beträgt drei Monatsmieten."
}
],
"query": "Kündigungsfrist Mietvertrag"
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Output Schema
{
"example": {
"limitations": [
"Redundancy is lexical (TF-IDF), not semantic."
],
"result": {
"budget_tokens": 200,
"context": "[a] Die Kündigungsfrist beträgt drei Monate.\n\n[b] Die Kaution beträgt drei Monatsmieten.",
"encoding": "cl100k_base",
"method": "MMR, lambda 0.7; similarity: cosine of TF-IDF vectors",
"relevance_from": "scores",
"selected": [
{
"id": "a",
"max_similarity": 0,
"mmr_score": 0.7,
"position": 0,
"relevance": 1,
"selection_step": 1,
"tokens": 16
},
{
"id": "b",
"max_similarity": 0.094,
"mmr_score": 0.2829,
"position": 1,
"relevance": 0.4444,
"selection_step": 2,
"tokens": 14
}
],
"skipped": [],
"tokens": 30
},
"service": "context-pack",
"status": "success"
},
"type": "json"
}