TRIMWISE · Query-agnostic context compression

Build high-signal prompts within an exact budget.

Trimwise helps fit long documents into a small AI prompt budget by picking the most relevant excerpts across them. It supports both queryless and query-aware extraction and can be used as a prompt and context compressor.


Use it to trim retrieved documents to fit either a per-document limit or a single budget shared across all documents.

What it does

Precise budgets

Limit output by tokens, words, or characters while retaining source spans.

Useful evidence

Choose structural, lexical, semantic, or hybrid extraction—or let auto decide.

Shared context

Trim a single or several sources under one budget, with optional wrappers and separators.

Try a request

This queryless request uses the configured auto default. Add a query to focus the result on a question.

curl -sS https://trimwise.aatbit.com/api/v1/trim \
  -H 'Content-Type: application/json' \
  -d '{"text": "The useful detail is here. More background follows.", "limit": 6, "unit": "words"}'

No key required. The current limit is 15,000 aggregate input words per request. See both examples and the JSON field reference →

What happens to your text

We use your text and query only to return the trimmed result. This API processes them in memory; it does not save your prompts, queries, or results, and does not use them to train models.

We keep basic service information, such as request counts, timing, and errors, without your text. For full control, run the open-source Python library on your own machine.

Free and open source

This API runs the Trimwise Python package. For local or private workloads, install the library directly. Read the library docs.

Install with Agent

Copy this prompt and paste it into your Agent.