What World State Is
The world state is the full picture at any point in time: all beliefs, their relationships, contradictions, clarity, and recommended moves.
1const world = await beliefs.read()
2
3world.beliefs // all beliefs the agent holds
4world.goals // what the agent is pursuing
5world.gaps // unknowns and open questions
6world.edges // relationships: supports, contradicts, derives
7world.contradictions // active conflicts that need resolution
8world.clarity // 0-1 readiness score
9world.moves // suggested next actions
10world.prompt // serialized context for LLM injectionEdges
Beliefs form a coherence graph. Each edge represents a relationship between two beliefs.
| Edge type | Meaning |
|---|---|
supports | Evidence or reasoning that backs a claim |
contradicts | Direct conflict between two beliefs |
supersedes | A newer belief replaces an older one |
derived_from | One belief was inferred from another |
depends_on | A conclusion that rests on an assumption |
1{
2 type: 'contradicts',
3 source: 'belief_gartner_tam',
4 target: 'belief_sec_tam',
5 confidence: 0.9,
6}Edges are detected automatically during extraction. When the research agent finds a Gartner report citing $4.2B and an SEC filing showing $3.8B, the system creates a contradicts edge between them.
Contradictions
Contradictions are surfaced explicitly in world.contradictions. They penalize the clarity score and generate clarify moves.
A contradiction between two load-bearing beliefs has more impact on clarity than one between peripheral claims. The system weights contradictions by how many downstream beliefs depend on the conflicting pair.
The Prompt Field
world.prompt is a serialized summary of the current belief state, formatted for LLM injection. It includes the most relevant beliefs, open gaps, contradictions, and recommended moves.
1const context = await beliefs.before(userMessage)
2
3const result = await myAgent.run({
4 systemPrompt: context.prompt,
5 message: userMessage,
6})The prompt is constructed to give the agent awareness of its current understanding without overwhelming the context window.
Multi-Agent Fusion
When multiple agents contribute beliefs, the world state is the fused view: a single picture of reality assembled from every agent's contributions.
Each agent contributes via its own agent identifier. The backend merges contributions using trust-weighted fusion.
To share one fused world state, keep the same namespace and use writeScope: 'space' for every contributing agent.
1const researcher = new Beliefs({
2 apiKey: process.env.BELIEFS_KEY,
3 agent: 'researcher',
4 namespace: 'market-map',
5 writeScope: 'space',
6})
7
8const analyst = new Beliefs({
9 apiKey: process.env.BELIEFS_KEY,
10 agent: 'analyst',
11 namespace: 'market-map',
12 writeScope: 'space',
13})
14
15// Both contribute to the same namespace
16await researcher.after(researchResult)
17await analyst.after(analysisResult)
18
19// The world state includes beliefs from both, fused by the backend
20const world = await analyst.read()If you have a single agent, world state is your agent's belief state. Multi-agent fusion activates when different agent values write to the same namespace with a shared space scope.
Trust weight configuration and conflict resolution strategy selection are handled by the hosted backend. Per-agent views and advanced fusion controls are planned for a future SDK release.