> ## Documentation Index
> Fetch the complete documentation index at: https://secndai.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://secndai.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://secndai.manicule.dev/api/mcp.
> Every agent surface: https://secndai.manicule.dev/.well-known/llms-manifest.json

# Document classification (/cookbooks/document-classification)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 303 · updated: 2026-11-12 -->
Related: [Support triage](/cookbooks/support-triage.md), [Refund decision](/cookbooks/refund-decision.md), [Content moderation](/cookbooks/content-moderation.md), [Lead routing](/cookbooks/lead-routing.md), [Tool selection](/cookbooks/tool-selection.md), [Python](/sdk/python.md)

> Classify the document you can actually fit in the request.

Extract text with your own parser and retain a stable document ID. Check whether the relevant content fits the complete input-token limit; never silently classify a truncated document as if it were complete.

```json title="request"
{
  "model": "ren-zero-2026-11-12",
  "type": "choice",
  "situation": "Document text: Invoice 0041. Amount due: 120 USD. Payment due within 30 days. This document requests payment; it does not confirm payment.",
  "question": "Which document class best fits the supplied text?",
  "options": [
    {"id": "invoice", "description": "Requests payment for goods or services"},
    {"id": "receipt", "description": "Confirms a completed payment"},
    {"id": "other", "description": "Neither class clearly fits"}
  ],
  "threshold": 0.9
}
```

On `act`, attach the class to the document record after checking it is allowed. Route `other` and `ask_human` to review. Treat API failures as incomplete processing.

Evaluate mixed documents, cover pages, quoted examples, poor extraction, and documents outside your taxonomy. Classification is not a reliable way to compute totals or extract legally binding payment terms.
