ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ

classified.forboc.ai

Internal documentation — Layer 3

ForbocAI API Overview

API_Óvervíew // Scópe_&_Cádence

ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ

Scope, Audience, and Cadence

Glossary and Key Terms

Architecture Diagrams

Three-layer diagram (ASCII):

+---------------+        +-------------------+        +-----------------+
|  Game Engine  | ---> |  SDK (Container)  | ---> |  API (Mind)     |
|   (Forboc)     |       |  Vector DB, SLM,  |       |  Rule Engine,   |
|                 | <--- |  Memory, State    | <--- |  Directive Gen   |
+---------------+        +-------------------+        +-----------------+
        ^                       ^                          ^
        | Observations/Actions  | Protocol/Requests        | Directive/Actions
        |                       |                          |
        +---------------------------------------------------------+
                                 Data Flow

Versioning and Compatibility Policy

Onboarding and Contribution Guidelines

Canonical Data Models and Protocol Definitions

Example TypeScript interfaces (shared location):

export interface Observation {
  id: string;
  timestamp: string; // ISO 8601
  event: string;
  payload?: any;
}

export interface Directive {
  id: string;
  systemPrompt: string;
  constraints: string[];
}

export type AgentAction =
  | { type: 'MOVE'; x: number; y: number }
  | { type: 'ATTACK'; targetId: string }
  | { type: 'INTERACT'; objectId: string }
  | { type: 'SPEAK'; text: string };

export interface ProtocolAction {
  type: 'MOVE' | 'ATTACK' | 'INTERACT' | 'SPEAK' | 'IDLE';
  payload?: any;
}

Cross‑repo Doc Map

System Todo (area) API Todo (Surface) Forboc client touchpoints SDK touchpoints
1. Cortex integration (SDK) Cortex integration points / cortex/init, /cortex/models client/src/features/mechanics/services/ai/aiLogic.ts (example) sdk/core/cortex.ts (example)
1.2 Cortex Mapper Director mapping bridge client/src/features/mechanics/services/ai/cortexMapper.ts sdk/services/ai/cortexMapper.ts
2. Memory (RAG) Memory endpoints: /agents/{id}/memory client/src/features/mechanics/services/memory sdk/memory/Memory.ts
3. Actuation/Actuations Actuation handlers: /agents/{id}/process client/src/features/mechanics/orchestrators/systems/bots/actuation.ts sdk/actuation.ts
4. Dialogue UI streaming Cortex event streaming; UI tokens client/src/features/ui/dialogue sdk/ui/stream.ts

Onboarding Guide (End-to-end Local Dev Loop)

  1. Prerequisites: Node.js, a package manager (pnpm/yarn/npm), and access to the private repos.
  2. API: In api/hs, install dependencies and run the API locally.
    • Commands: cabal update, cabal build, cabal run
  3. SDK: In sdk, install dependencies and build.
    • Commands: npm install or pnpm install, npm run build or pnpm run build
  4. Game client: In Forboc/client, install dependencies and point to the local API base URL.
    • Update config to API_BASE_URL=http://localhost:port
  5. Verification loop:
    • Send a sample Observation to the API (curl or test client) and verify a Directive is returned.
    • Let the SDK generate an AgentAction and verify the action is executed by the game engine.
    • Confirm end-to-end flow by reproducing a small scenario.

Source of Truth for Versioning and Compatibility


This file represents the canonical overview for the API in this private project. Update this overview whenever you introduce changes to the protocol contract, data models, or API surface.