ThinkThen answers typed questions about text. Development 0.2 also admits JPEG and PNG images for decide, choose and score. Ask from a shell script or from your own program, and get back true, false, a label, or a number. A failed call never looks like an answer. Use it to gate a script, label records, or grade answers in an eval.
thinkthen decide 'Does the customer ask for money back?' < message.txttrue
The exit code is 0 for yes, 1 for no, and 3 for not sure. A shell if can branch on it. How-to 01 runs this question against a recorded answer.
The public release remains 0.1.2. The 0.2 examples below require a reviewed development command or candidate SDK; they do not describe a published package.
curl -fsSL https://thinkthen.dev/install.sh | shOn a Mac, Homebrew works too:
brew install botassembly/thinkthen/thinkthenWith Rust installed, cargo install thinkthen builds the command from crates.io.
Windows x86-64 support starts with 0.2. Development builds are unsigned. Public signing and distribution remain open; a public 0.2 archive may not exist yet. From a reviewed development checkout, use a supplied development mirror in Windows PowerShell 5.1 or PowerShell 7:
$env:THINKTHEN_INSTALL_BASE = 'https://your-development-mirror.example'
.\install.ps1 -Version 0.2.0Review install.ps1 before running it. If your host execution policy refuses the script, follow your organization's policy; the installer changes no execution policy. It installs thinkthen.exe and a receipt under %LOCALAPPDATA%\Programs\thinkthen, or the absolute local NTFS directory named by THINKTHEN_INSTALL_DIR. It verifies the archive checksum and executable version. Checksums do not establish publisher identity.
The installer prints the full command path and a PATH command for the current session. For future sessions, add its directory through Windows environment settings. It changes no profile, registry or runtime configuration. To remove it, delete thinkthen.exe, thinkthen.install.json and .thinkthen-install.lock from the install directory. If interrupted recovery artifacts remain, inspect them before removing them or retrying. The script's Windows runner proof remains pending.
Windows reads %APPDATA%\thinkthen\config.json, stores cached answers in %LOCALAPPDATA%\thinkthen\cache, and stores count-only usage totals in %LOCALAPPDATA%\thinkthen\usage.
A live run needs a backend. A hosted backend needs a key. Backends shows how to get a TypeSafe key or point ThinkThen at another server, such as Ollama on your own machine.
Download the release's sample, then replay its recorded answer with no key and no network:
curl -fsSL https://github.com/botassembly/thinkthen/releases/latest/download/thinkthen-first-run.tar.gz | tar -xz && cd thinkthen-first-run
thinkthen decide 'Does this report say what the person did before the problem appeared?' \
--replay recording < report.txttrue
How-to 27 shows how a test uses a recording.
| Function | It answers |
|---|---|
decide |
yes, no, or not sure |
choose |
the one option that fits best |
tag |
every label that applies |
score |
a number on a scale |
filter |
the records that pass a yes/no question |
rank |
the records, best first |
find |
the one unit of text that answers the question, or nothing |
annotate |
a saved set of named questions for each record |
recognize |
the names in a text and what kind each is |
relate |
the relations between named things |
The specification gives each function's contract, its exit codes, and its failures.
For agents, the official ThinkThen skill explains function selection, evidence framing, abstention and bounded requests.
decide, filter, rank and annotate accept document files as positional operands. For other functions, repeat --input FILE; positional operands in choose, tag and score name options, labels and levels. The two file input forms cannot mix. With several document files, decide/choose/tag/score print one JSONL row per file with input_file and value. A completed multi-document run exits 0 even for false or not sure answers. One document retains its scalar output and answer exit code.
Use --input folder --unit line, --unit file or --window N for located readers. Folder descendants sort by relative path; explicit operands and duplicates keep their order. Details retain physical file/line positions separately from selected evidence. Blank lines still count toward physical positions. Paths never become model evidence or cache identity. --field selects evidence from JSON records; the original stays in the answer. The file guide shows each function's located output and limits.
Select an admitted backend and model explicitly. For example, with the Liquid backend key configured:
thinkthen decide 'Does the package have visible damage?' \
--backend liquid --model d1 --image package.jpg
thinkthen choose 'Which package is damaged?' first second neither \
--backend liquid --model d1 --image first.jpg --image second.jpg
thinkthen score 'How severe is the damage?' none minor severe \
--backend liquid --model d1 --image package.jpgRepeated --image attachments form one ordered input. Duplicates remain present. Optional stdin text or framed caption records can accompany attachments. --image-media image/png or image/jpeg declares the attachment format; omission detects it from bytes. Attachments cannot accompany --media, --unit or --window. To judge separate whole-file images, use --input photos --unit file --media image instead. Seven other functions refuse images before reading files or sending.
Liquid d1 and Perplexity pplx-decider-v1-27b have admitted image routes. Local images require an explicit profile declaring an exact supported setup and model alias. TypeSafe, OpenRouter, Ollama, the named MLX route and OpenAI Decisions refuse images. A provider name alone establishes no image capability. The image contract and local setup declarations give limits and profiles. No image accuracy claim follows from admission.
Write refund.json yourself:
{
"decide": "Does the writer request a refund?",
"true": "The writer asks for money back.",
"false": "The writer asks for something else.",
"threshold": "0.2:0.8",
"name": "refund",
"wording_version": 1,
"item_schema": {"type": "string"},
"context_schema": {"type": "string"}
}thinkthen decide @refund.json --jsonl --field /body \
--context-field /policy < tickets.jsonlEach JSON record supplies its own body and separate policy context. The answer retains the whole original record. Per-record context changes request/cache identity and stays associated with its record. An explicit empty context suppresses shared context from --context FILE. Item selection precedes declaration validation; extra properties remain present and values are never coerced. Declarations support root strings or root objects with string, finite number, boolean and string-list properties. They are a restricted grammar, not arbitrary JSON Schema.
true and false are authored readings of yes and no. Saved readings can also be JSON objects, lists or null. A present null remains distinct from an absent reading. CLI --true and --false supply text overrides.
For named lookup, place the same file at questions/refund.json under the platform configuration directory. On Linux this defaults to ~/.config/thinkthen/questions/refund.json; macOS uses ~/Library/Application Support/thinkthen/questions/refund.json; Windows uses %APPDATA%\thinkthen\questions\refund.json. Then use @refund. An existing local refund entry takes precedence over named lookup. References containing path punctuation keep path behavior. ThinkThen creates no question file or configuration. A present authored name must match the requested name. Author names, wording versions and declarations describe the caller's question; they do not change its digest or answer identity. Existing 0.1 question files remain accepted. The question-file contract gives the full grammar and safe refusals.
Install or unpack the reviewed candidate command, put it on PATH, and configure its backend environment as for the CLI. Configure your MCP client to launch:
{"command":"thinkthen","args":["mcp"]}The Rust server uses local stdio, one native engine and the same cache. It exposes exactly the ten functions above. It starts no shell and no process per call. A decide tool call accepts {"question":"Does the writer request a refund?","evidence":"Please refund my order."}. Use question_file, question_name or question_reference for explicit file, named or @ lookup; those selectors are exclusive with literal question. Literal @ text is never treated as a path. Ordered images are admitted only for decide/choose/score. The MCP guide gives source inputs, per-record context, complete results and a no-key recorded call. Final platform and release qualification remain required.
Every language uses the same Rust engine. Each page below gives the install line and a first call.
The Rust crate supports Linux, macOS and Windows x86-64. Add it to a Rust project with cargo add thinkthen. The Windows C archive contains the header, thinkthen.dll and its MSVC import library. The Windows command archive contains thinkthen.exe alone. Native C runner proof remains pending.
| Kind | Install pages |
|---|---|
| Command line | Bash |
| Libraries | Python, pandas, Polars, TypeScript, Ruby, R, Rust, C, C++, C#, Go, Java, Kotlin, Scala, Swift, Zig, PHP, Dart, Ada, Objective-C, COBOL |
| Databases | DuckDB, SQLite, PostgreSQL |
Each folder under libraries/ and databases/ has a README that builds that binding from source.
On 2026-10-01 a call to Jev took a median of 138 ms. ThinkThen's own work took about 2 ms of it. Each binding added a median of 3 ms or less, and the slowest single function added 6.7 ms. Overhead gives every measurement and its spread.
- Build a triage pipeline that drafts, blocks, or asks a person
- Gate a script step on a yes/no answer
- Branch on a label with
chooseandcase - Lint a change by meaning and fail the build
- Grade an assistant's answers with a rubric
All how-tos lists every page. Each green one is a real shell job that the gate runs.
By default ThinkThen sends your question and text to TypeSafe. Backends links TypeSafe's terms. Read them before you send sensitive text.
CONTRIBUTING.md explains how to build from a checkout, run the gate, and record work. It also defines the four names this repository uses. No gate touches the network.
MIT. LICENSE holds the text.