Skip to content
HALOWERK

Denkwerk

chunk smart

Parses the document into blocks (Markdown via marked, HTML via a block-level walker that drops scripts and styles, plain text by blank lines), keeps a heading path for every block and never mixes sections in one chunk. Blocks are packed up to max_tokens (OpenAI encoding via js-tiktoken); oversized blocks are split at sentence boundaries (Unicode segmentation plus CLDR abbreviation list, e.g. "z. B.", "Dr."), oversized sentences at word boundaries. Overlap repeats whole trailing sentences of.

POST https://denk.halowerk.com/v1/chunk-smart

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
textstringYes
formatstringNo
max_tokensintegerNo
overlap_tokensintegerNo
encodingstringNoOpenAI encoding used for token counts.
include_heading_pathbooleanNoPrefix each chunk text with "A > B" breadcrumbs (counted in tokens).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500000
    },
    "format": {
      "type": "string",
      "enum": [
        "auto",
        "markdown",
        "html",
        "text"
      ],
      "default": "auto"
    },
    "max_tokens": {
      "type": "integer",
      "minimum": 32,
      "maximum": 8192,
      "default": 512
    },
    "overlap_tokens": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2048,
      "default": 64
    },
    "encoding": {
      "type": "string",
      "enum": [
        "cl100k_base",
        "o200k_base"
      ],
      "default": "cl100k_base",
      "description": "OpenAI encoding used for token counts."
    },
    "include_heading_path": {
      "type": "boolean",
      "default": false,
      "description": "Prefix each chunk text with \"A > B\" breadcrumbs (counted in tokens)."
    }
  }
}

Open original schema

Published input example

{
  "text": "# Handbuch\n\n## Installation\n\nPaket laden. Danach starten.\n\n## Betrieb\n\nDer Dienst läuft im Hintergrund.",
  "max_tokens": 64,
  "overlap_tokens": 16
}

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

All endpoints in this hub →