Skip to content
botassemblyPublic

About

ThinkThen: code that knows what you mean

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

13,127 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThinkThen

thinkthen

ThinkThen is ten functions on top of Jev, TypeSafe's decision model, or any model like it. It puts these decision models in your code, whatever model, language or database you use. Use Jev, OpenAI or a local model. Ask a typed question and get back true, false, a label or a number. Your code branches on the answer. A model can say not sure, and a failed call never looks like an answer. ThinkThen packs many records into few requests, saves each answer for reuse, and lets tests replay saved answers with no key and no network.

thinkthen decide 'Does the customer ask for money back?' < message.txt
true

The exit code is 0 for yes, 1 for no, and 3 for not sure. A shell if can branch on it. The demo Gate a script step on a yes/no answer runs this question against a recorded answer.

The ten functions

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.

Why not call the model yourself?

  • Your code can branch on the answer. decide exits 0 for yes, 1 for no and 3 for not sure, and a failure never looks like no. See How answers work.
  • You pay once. 306 song titles went out in one request: 11,468 input tokens instead of 88,933 one at a time. Each question keeps its own saved answer, however records group. See Pay once.
  • Tests replay saved answers with no key and no network. See Replay in tests.
  • You tune for free. Change the threshold on saved answers with zero new calls, and let runs audit pick it from your own labels. See Tune for free.
  • --plan prints the first request and counts every request and its expected tokens. It sends nothing. See See before you send.
  • One option switches the model or the provider: TypeSafe, another hosted vendor, or a model on your own machine. See Models.
  • The same code runs from the command line, 21 languages and 3 databases. In a library, ThinkThen's own work takes about 2 ms of a 138 ms call. See Speed, Languages and Databases.
  • ThinkThen is yours under the MIT license. Your questions live in your own code and SQL, not in one vendor's database function.

Install

curl -fsSL https://thinkthen.dev/install.sh | sh

On a Mac, Homebrew works too:

brew install botassembly/thinkthen/thinkthen

With Rust installed, cargo install thinkthen builds the command from crates.io. Start covers every other route, and Languages and Databases cover each of the 24 bindings.

A live run needs a backend. A hosted backend needs a key. Models shows how to point ThinkThen at TypeSafe or another server, such as Ollama on your own machine. By default ThinkThen sends your question and text to TypeSafe. Read the terms that page links before you send sensitive text.

ThinkThen is free and MIT licensed. Hosted models charge per token; local models are free.

Try it with no key

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.txt
true

Test a script with no network shows how a test uses a recording.

Links

  • thinkthen.dev teaches each function and every binding.
  • The specification holds the contracts.
  • For agents, the agent skill explains function selection, evidence framing, abstention and bounded requests.
  • For agent builders, the MCP guide runs the ten functions as tools over local stdio.
  • All recipes lists every finished job, by reader.
  • CONTRIBUTING.md explains how to build from a checkout and run the gate. No gate touches the network.
  • LICENSE holds the MIT license text.

About

ThinkThen: code that knows what you mean

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages