Introduction

Autonomous AI for game NPCs
View as MarkdownOpen in Claude

Architect the next generation of Synthetic Life. ForbocAI is the proprietary substrate for embedding autonomous consciousness into your digital worlds.

The Architecture

Systém_Óverview // Prótocol_Init
ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ

ForbocAI is not a chatbot wrapper. It is a Neuro-Symbolic Intelligence Protocol that gives you god-like control over your agents.

🚫 The No-Class Manifesto

We reject Object-Oriented Programming (OOP) classes (class) in favor of Functional Composition.

  • State is Immutable: Objects are never mutated via this. New versions are returned.
  • Pure Functions: Logic is separated from data.
  • Factory Pattern: We use factory functions (createAgent) with closures to encapsulate private state.

🏛️ The Architecture

The ForbocAI Protocol strictly separates State from Logic:

  1. SDK (The Vessel): Self-contained container for the Agent’s existence.
    • SLM Cortex: Local inference engine (no cloud dependency).
    • Vector Memory: Local database (browser/fs) for persistent memory.
    • Self-Contained: Can run headless without any external requirements except the API connection.
  2. API (The Truth): Stateless validation oracle.
    • No Database: The API stores nothing. It is pure logic.
    • The Grid: Enforces the laws of physics/game rules via pure functions.

You don’t just script NPCs. You birth them.

Core Components

Módulátion_Máp // Sýstem_Óverview
᛭ ᛫ ᛬ ᛫ ᛭

Quick Start

Quíck_Stárt // Instáll_Séquence
1

Install the SDK

$npm install forbocai
2

Verify Connection

Run the CLI to verify your connection to the Neuro-Symbolic Grid:

$npx forbocai api status
3

Initialize the Cortex

Functional Init: Use createCortex factory, not classes.

1import { createCortex } from 'forbocai';
2
3const cortex = createCortex({
4 model: 'smollm2-135m'
5});
6await cortex.init();
4

Create an Agent

1import { createAgent } from 'forbocai';
2
3const agent = createAgent({
4 cortex,
5 persona: `You are Kira, a cautious merchant in a dystopian market.
6 You distrust strangers but can be won over with fair trades.`,
7 initialState: {
8 inventory: ['rusty_key', 'healing_potion'],
9 mood: 'suspicious'
10 }
11});
5

Interact with the Agent

1const response = await agent.process({
2 input: "I'd like to buy that key from you.",
3 context: { playerGold: 50 }
4});
5
6// response.dialogue: "That key? It's... special. 50 gold and we have a deal."
7// response.action: { type: 'OFFER_TRADE', item: 'rusty_key', price: 50 }
᛭ ᛫ ᛬ ᛫ ᛭

CLI Toolkit

Tóol_Kít // Cónsole

The SDK includes a built-in CLI for interacting with the Neuro-Symbolic Grid directly.

$# Check connection to the Grid
$npx forbocai api status
$
$# Create a test agent
$npx forbocai agent create "Cyberpunk Merchant"
$
$# Export an agent's Soul to IPFS
>npx forbocai soul export <agent-id>
>
># Import an agent from a Soul (CID)
>npx forbocai soul import <cid>
᛭ ᛫ ᛬ ᛫ ᛭

Development Cycle

Tést_Séquence // Válidátion

For contributors and advanced integrators, the validation loop ensures stability across the Split-Brain architecture.

1

Local Updates

Make changes to the sdk/ or api/ codebase.

2

Deploy

  • SDK: Push to NPM (npm publish)
  • API: Push to GitHub (Triggers Render auto-deploy)
3

Consume

Install the latest version in your client application:

$npm install forbocai@latest
4

Verify

Validate the end-to-end connection using the CLI:

$npx forbocai api status
$# > Connecting to Neuro-Symbolic Grid...
$# > Status: ONLINE
᛭ ᛫ ᛬ ᛫ ᛭

Documentation

Dócs_Máp // Référence