Run one complete turn

The npm package is awaiting its initial authenticated publication. Until stateweave is available from npm, run the SDK from source. This path is complete and requires no API key.

1. Build the SDK

StateWeave requires Node.js 22 or newer.

2. Run a deterministic agent

Create quickstart.mjs in the repository root:
Run it:
MockModel is deterministic. It proves the agent loop, state commit, and cross-turn continuity without sending data to a provider.

3. Persist and resume

AgentState is plain validated data. Store the first run’s state wherever your application stores user-owned data.
Import validation rejects altered content identities, missing parents, invalid sequence order, and broken frontier references.

4. Connect Anthropic

Do not expose provider keys in browser code. Run model calls on a server boundary.

What just happened

One run() call:
  1. created a system root and goal;
  2. compiled a bounded causal view;
  3. called the model;
  4. parsed one ordinary action;
  5. recorded the inference and answer with exact read-set parents;
  6. committed a new AgentState only after success.
Next: why a graph is the right stored primitive.