Denkwerk
context pack
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. Relevance is the supplied score divided by the highest score, or the BM25 score against the query divided by the highest one. Each passage is rendered with a template such as "[{id}] {text}" and the final context is counted exactly with the chosen OpenAI.
POST https://denk.halowerk.com/v1/context-packInputs
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | No | |
| passages | array | Yes | Strings or objects {id, text}. |
| budget_tokens | integer | Yes | |
| lambda | number | No | |
| order | string | No | |
| template | string | No | |
| separator | string | No | |
| encoding | string | No | OpenAI encoding used for token counts. |
Show full input schema
{
"type": "object",
"additionalProperties": false,
"required": [
"passages",
"budget_tokens"
],
"properties": {
"query": {
"type": "string",
"maxLength": 2000
},
"passages": {
"type": "array",
"minItems": 1,
"maxItems": 300,
"description": "Strings or objects {id, text}.",
"items": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 20000
},
{
"type": "object",
"additionalProperties": false,
"required": [
"text"
],
"properties": {
"id": {
"type": "string",
"maxLength": 128
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 20000
},
"score": {
"type": "number"
}
}
}
]
}
},
"budget_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 2000000
},
"lambda": {
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 0.7
},
"order": {
"type": "string",
"enum": [
"selection",
"source",
"edges"
],
"default": "selection"
},
"template": {
"type": "string",
"maxLength": 200,
"default": "[{id}] {text}"
},
"separator": {
"type": "string",
"maxLength": 20,
"default": "\n\n"
},
"encoding": {
"type": "string",
"enum": [
"cl100k_base",
"o200k_base"
],
"default": "cl100k_base",
"description": "OpenAI encoding used for token counts."
}
}
}Published input example
{
"query": "Kündigungsfrist Mietvertrag",
"budget_tokens": 200,
"passages": [
{
"id": "a",
"text": "Die Kündigungsfrist beträgt drei Monate.",
"score": 0.9
},
{
"id": "b",
"text": "Die Kaution beträgt drei Monatsmieten.",
"score": 0.4
}
]
}Result & documentation
Machine-readable documentation of this hub
Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.
More endpoints in this hub
- Denkwerk0.003 USDC
agent card generate
POSThttps://denk.halowerk.com/v1/agent-card-generateBuilds an Agent2Agent protocol Agent Card with protocolVersion, name, description, url, version, capabilities, default input/output modes and skills. Skills come from the supplied list or are derived from OpenAPI operations (operationId, su
- Denkwerk0.003 USDC
agent permission diff
POSThttps://denk.halowerk.com/v1/agent-permission-diffTakes the tool names (with optional descriptions) and permission scopes of an agent before and after a change and reports added and removed tools and scopes, classifies new capabilities by risk (payments, sending messages, deleting or writi
- Denkwerk0.003 USDC
annotation guide draft
POSThttps://denk.halowerk.com/v1/annotation-guide-draftTakes example texts per label and derives, without a language model, the most distinguishing terms per label (TF-IDF contrast against the other labels), representative examples, cross-label example pairs with high similarity that need a wri