# Introduction
> Autonomous AI for game NPCs
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
Local-first SLM inference engine for NPC AI
Neuro-symbolic state validation layer
RAG pipeline for persistent agent memory
Portable agent identity and state serialization
᛭ ᛫ ᛬ ᛫ ᛭
## Quick Start
Quíck_Stárt // Instáll_Séquence
```bash
npm install forbocai
```
Run the CLI to verify your connection to the Neuro-Symbolic Grid:
```bash
npx forbocai api status
```
**Functional Init**: Use `createCortex` factory, not classes.
```typescript
import { createCortex } from 'forbocai';
const cortex = createCortex({
model: 'smollm2-135m'
});
await cortex.init();
```
```typescript
import { createAgent } from 'forbocai';
const agent = createAgent({
cortex,
persona: `You are Kira, a cautious merchant in a dystopian market.
You distrust strangers but can be won over with fair trades.`,
initialState: {
inventory: ['rusty_key', 'healing_potion'],
mood: 'suspicious'
}
});
```
```typescript
const response = await agent.process({
input: "I'd like to buy that key from you.",
context: { playerGold: 50 }
});
// response.dialogue: "That key? It's... special. 50 gold and we have a deal."
// 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.
```bash
# 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
# Import an agent from a Soul (CID)
npx forbocai soul import
```
᛭ ᛫ ᛬ ᛫ ᛭
## Development Cycle
Tést_Séquence // Válidátion
For contributors and advanced integrators, the validation loop ensures stability across the Split-Brain architecture.
Make changes to the `sdk/` or `api/` codebase.
* **SDK**: Push to NPM (`npm publish`)
* **API**: Push to GitHub (Triggers Render auto-deploy)
Install the latest version in your client application:
```bash
npm install forbocai@latest
```
Validate the end-to-end connection using the CLI:
```bash
npx forbocai api status
# > Connecting to Neuro-Symbolic Grid...
# > Status: ONLINE
```
᛭ ᛫ ᛬ ᛫ ᛭
## Documentation
Dócs_Máp // Référence
What developers can build with the SDK
Complete endpoint documentation
Architecture and design patterns
Sample implementations and tutorials