beliefs SDK
The shared state your agents act from. thinkⁿ holds a durable, auditable belief state outside the model, so every agent works from what is true instead of what it last guessed.
npm i beliefsWorks withClaude Agent SDK·Vercel AI SDK·OpenAI·any LLM
thinkn.ai/llms.txt·give this to your coding agent
The core loop
before loads what your agent currently believes. after updates it from the turn's output.
clarity 0.42 → 0.71 · 2 contradictions surfaced · 1 gap closed
Go deeper
Get your key, install, and ship. Framework recipes for Vercel AI, Anthropic, OpenAI, and more.
How a belief state differs from memory, RAG, and a markdown file, and when to skip it.
Install in five minutes and run your first belief turn end to end.
The parts of a world model: environment, observations, beliefs, intent, policy, actions, the bounded worldview, clarity, and moves. What each one means and how they connect.
Every SDK method: before, after, observe, add, read, snapshot, resolve, retract, trace, and the moves and forecast calls. Signatures, returns, and the patterns that compose them.
Drop the before and after loop into the Claude Agent SDK, the Vercel AI SDK, OpenAI, or any LLM you already run.
The same belief loop across nine worlds, from the whole business down to a single codebase: enterprise, engineering, research, investing, legal, support, operations, finance, and health.
How the state holds up under load: trust-weighted Bayesian fusion, a decay schedule, and an append-only ledger that replays in any order to the same result.
Build a research agent in 30 minutes that tracks its own open questions and knows where it is still guessing.