denk.halowerk.com/v1/context-pack
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
POST
https://denk.halowerk.com/v1/context-packUptime100% of 2 checks in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://denk.halowerk.com/v1/context-pack", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"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"}),
});
console.log(await res.json());Example input
{
"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"
}