---
title: Start Here
description: "thinkⁿ is world model infrastructure for agents: a durable, auditable belief state that lives outside the model."
---

You tell your agent a fact. Eight turns later it contradicts you. A bigger context window makes this worse, not better, because now there's more text for the model to lose the thread in. The model has no place to keep what's settled, what's contested, and how sure it is.

**thinkⁿ is world model infrastructure for agents: a durable, auditable belief state that lives outside the model.** An agent's world model is the frame it acts from. That frame has six parts: the **environment** it works on (a codebase, an account, a production line, a portfolio, a patient), the **observations** streaming in, the **belief state** of what's currently true and how sure it is, the **intent** the agent is after (its goals and what success looks like), the **policy** that governs the world, and the **actions** the agent can take in it. You declare the environment, intent, policy, and actions; the engine compiles observations into the belief state and projects the worldview. The belief state is the live core. It holds what's been observed (past), what's held true (present), and what move would bring the picture closer to reality (future).

Beliefs are how you build that state. A belief is a claim with an explicit posterior, its evidence, and a lifecycle, and it's the unit that keeps the world model honest as reality changes. See [World](/dev/core/world) for the full frame, or the [FAQ](/dev/start/faq) for how it differs from memory, RAG, and a markdown file.

```bash
npm i beliefs
```

```ts
import Beliefs from 'beliefs'

const beliefs = new Beliefs({
  apiKey: process.env.BELIEFS_KEY,
  namespace: 'my-project',
  writeScope: 'space',
})

// Before the agent acts: read the bounded worldview for this turn.
// The argument is a relevance query (the task/turn/question at hand)
// that biases which beliefs and moves surface.
const context = await beliefs.before(userMessage)

// Run your agent with belief context injected.
// The top-ranked next move rides back as context.moves[0].
const result = await myAgent.run({ system: context.prompt })

// Feed the output back: beliefs extracted, conflicts detected, state updated.
// delta.moves carries the re-ranked moves after the turn.
const delta = await beliefs.after(result.text)
```

That's the loop: two calls per turn, regardless of which framework you ship on.

**The read surface, once.** `before()` and `after()` are the turn loop. Each returns the worldview plus its ranked `.moves` (`context.moves`, `delta.moves`). `read()` is the full snapshot, out of band. `moves.rank({ topN })` is the standalone ranked-move accessor when you want moves without running a turn. Inside the loop, prefer `context.moves[0]` over a redundant `moves.rank()`.

## Works with your stack

```ts
import { beliefsHooks } from 'beliefs/claude-agent-sdk'   // Anthropic Claude Agent SDK
import { beliefsMiddleware } from 'beliefs/vercel-ai'     // Vercel AI SDK
// React hooks + browser DevTools (coming soon)
```

Or call `beliefs.before()` / `beliefs.after()` manually around any LLM (OpenAI, plain fetch, your own agent loop). See the [Hack Guide](/dev/tutorial/hack-guide) for working recipes across frameworks.

## I want to...

| I want to... | Start here |
|---|---|
| **Ship in 10 minutes.** Hackathon, prototype, exploration. | [Hack Guide](/dev/tutorial/hack-guide): install + framework recipes + project ideas |
| **See it run end-to-end** before committing. | [Quickstart](/dev/start/quickstart): 30 lines that print clarity rising |
| **Learn the model first**, then build. | [World model](/dev/core/world) → [Concepts](/dev/core/beliefs) → [Tutorial](/dev/tutorial/research-agent) |
| **Build chat memory** that's separate per conversation. | [Install](/dev/start/install) → use `writeScope: 'thread'` and bind `thread: 'id'` |
| **Run multi-agent shared state** (debate, supervisor/worker, swarm). | [Patterns → Multi-Agent](/dev/sdk/patterns): same namespace, `writeScope: 'space'` |
| **Audit why an agent believes something.** | [How it works → Ledger](/dev/internals/how-it-works) and [`beliefs.trace()`](/dev/sdk/core-api) |
| **Evaluate fit** before integrating. | [FAQ](/dev/start/faq): when beliefs help, when they don't |
| **Add beliefs to a Claude Agent SDK app.** | [Adapter: Claude Agent SDK](/dev/adapters/claude-agent-sdk) |
| **Add beliefs to a Vercel AI SDK app.** | [Adapter: Vercel AI](/dev/adapters/vercel-ai) |
| **See it across domains** (the whole business, then engineering, research, investing, legal, support, operations, finance, and health). | [Use cases](/dev/cases/enterprise) |

## Why coding agents first

A codebase is already a compact world. It has laws (types, invariants), assumptions (architecture decisions, dependencies), history (commits, PRs), ownership, and contradictions (stale docs, drifted assumptions). Coding agents are already operating inside this world, but with short-lived context and weak memory.

The first world model thinkⁿ targets is the one your coding agent already lives in. Concrete beliefs the engine can hold for a repo:

```
belief:    Authentication is enforced at the API middleware layer
confidence: 0.82
evidence:   middleware.ts, auth.test.ts, architecture.md
contradicts: /api/internal/export bypasses middleware
next move:  inspect route-level auth coverage before modifying export flow
```

The same machinery carries across the whole business and the functions inside it: engineering, research, investing, legal, support, operations, finance, and health. Any system that has to hold a coherent picture of reality across many turns and many sources runs on the same belief state. See it worked end-to-end in [Use cases](/dev/cases/enterprise).

As agents take on real work, a company needs a shared operating state for what its agents understand and decide: what's true, what changed, what's uncertain, and what action is safe. That state is the world model, owned by the company, shared across every agent it runs, and auditable when a decision has to be explained. With it, a company can scale work without scaling management.

<Callout type="tip" title="Using a coding agent?">
Point your agent at the SDK reference: [llms.txt](https://thinkn.ai/llms.txt). It gives the agent enough to wire up the loop correctly without guessing at the surface.
</Callout>
