thinkn
  • Product
    Manifesto
    The reason we exist
    Founder Studioprivate beta
    Make better product decisions faster
    Belief SDKinvite only
    Add belief states to your AI system
    Request Access →Join the private beta waitlist
  • Docs
  • Pricing
  • FAQ
  • Docs
  • Pricing
  • FAQ
Sign In
Welcome
  • Start Here
  • Install
  • Quickstart
  • FAQ
  • Why beliefs

beliefs SDK

Beliefs for AI agents.

A structured world model your agent keeps across turns. It tracks claims, confidence, evidence, contradictions, and ranked next moves to manage drift and seek the truth.

$npm i beliefs
Get Started

Works 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.

1import Beliefs from 'beliefs'
2
3const beliefs = new Beliefs({
4  apiKey: process.env.BELIEFS_KEY,
5  agent: 'research-agent',
6})
7
8// Before work: load what the agent currently believes
9const context = await beliefs.before(
10  'What is the APAC market opportunity?'
11)
12
13// Your agent runs with belief context
14const result = await agent.run({ context: context.prompt })
15
16// After work: feed the observation — get back what changed
17const delta = await beliefs.after(result.text)
18
19if (delta.readiness === 'high') {
20  return summarize(delta.state.beliefs)
21}
22
23console.log(delta.changes)  // what was created/updated
24console.log(delta.moves)    // suggested next actions

clarity 0.42 → 0.71  ·  2 contradictions surfaced  ·  1 gap closed

Go deeper

Hackathon? Start here.

Get your key, install, and build — framework recipes for Vercel AI, Anthropic, OpenAI, and more.

Hack Guide

Why beliefs

Why memory and RAG don't fix multi-turn drift, and what beliefs change.

Read

Start

5-minute install. Your first belief turn.

Get started

Concepts

The five primitives that make up a world model: beliefs, intent, clarity, moves, world.

Learn

Reference

The full API: before, after, add, read, and the patterns that compose them.

Browse

Adapters

Drop-in for Claude Agent SDK, Vercel AI SDK, OpenAI, and any LLM.

Browse

Use Cases

How beliefs play out in finance, health, engineering, and science.

Explore

Internals

How fusion math, freshness decay, and the append-only ledger actually work. Trust-weighted, order-independent, replayable.

Dive in

Tutorial

30-minute build: a research agent that knows what it doesn't know.

Build