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
  • Hack Guide
  • Introduction
  • Install
  • Quickstart
  • FAQ
  • The Problem
  • Memory vs Beliefs
  • Drift
  • Examples

beliefs SDK

Your agent has memory.
It doesn't have beliefs.

Keep your agents coherent over long-running work on hard problems. Beliefs track what's known, what conflicts, and what's missing so every turn starts from reality.

$npm i beliefs
Get Started

Works withClaude Agent SDK·Vercel AI SDK·React·any LLM

thinkn.ai/llms.txt—give this to your coding agent

The core loop

before loads what your agent believes. after updates it.

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

Go deeper

Hackathon? Start here.

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

Hack Guide

Start

Install the SDK and run your first belief turn in 5 minutes.

Get started

Why

Why memory and RAG aren't enough — and what beliefs change.

Read

Core

The five primitives: beliefs, intent, clarity, moves, and world.

Learn

SDK

The full API: before, after, add, search, and patterns.

Browse

Integrations

Use beliefs with Anthropic, Vercel AI SDK, OpenAI, and any LLM.

Browse

Use Cases

How teams use beliefs in finance, health, engineering, and science.

Explore

Internals

How fusion, decay, and the ledger work under the hood.

Dive in