Introduction
Store/thunk runtime for autonomous NPC protocol execution
ForbocAI sdk@0.6.3 is a Redux Toolkit-based runtime for executing the NPC multi-round protocol.
This page reflects the current SDK source (packages/core, packages/node, packages/browser) and CLI implementation, not legacy factory APIs.
What the SDK Is
@forbocai/core: protocol types, API client slice, state slices, and thunks@forbocai/node: Node runtime slices +createNodeCortex()+ CLI (forbocai)@forbocai/browser: browser runtime slices/thunks for WebLLM + memory/vector state
Canonical Runtime Pattern
For core integration, create a store, register NPC metadata, then dispatch protocol thunks.
Protocol Flow (Implemented)
processNPC executes the multi-round API-directed loop:
Primary path (current SDK runtime):
POST /npcs/{npcId}/processwith{ tape, lastResult }- execute returned instruction locally (identify actor / recall / infer)
- repeat
/processuntil finalize instruction is returned - apply finalize memory store + state delta instructions
Compatibility path (also supported by API):
POST /npcs/{npcId}/directive- local memory recall (only if instructed)
POST /npcs/{npcId}/context- local cortex completion
POST /npcs/{npcId}/verdict- local memory store + state delta application
The SDK fails fast when required runtime components are missing (persona, cortex, and memory when API requires memory operations).
