ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ

classified.forboc.ai

Internal documentation — Layer 3

ForbocAI SDK & API Master Checklist

Tódó // Sýstém_Dóc

ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ

This document serves as the master checklist for building the ForbocAI SDK and its supporting API infrastructure. It consolidates the implementation plan with the architectural standards.

References

/Users/seandinwiddie/GitHub/Forboc/notes/TODOs/system-todo.md /Users/seandinwiddie/GitHub/sdk /Users/seandinwiddie/GitHub/api


System Architecture & Data Flow

Core Philosophy: - ForbocAI (SDK): The Characters’ Brain/Mind - Infrastructure Layer. It acts as a “tiny harddrive” containing the Vector DB, SLM, and API connectors. It does not contain logic; it serves as the local infrastructure that executes the API’s directives. - Game Engine (Host): The World’s Brain/Mind - Execution Layer. It handles physics, state validation, and execution. - ForbocAI API: The Mind/Law - Logic Layer. The API performs the “Thinking” using proprietary deterministic logic (Pure Functions). It orchestrates the SDK but contains NO AI Models.

The Data Flow:

Game (World State) → SDK (Format/Store) → API (Logic/Decide) → SDK (Generate/Validate) → Game (Execute)
  1. Game: Reports event via Protocol (e.g., “Player hit Orc”).
  2. SDK: Formats event as Observation, syncs to Local Vector DB, forwards to API.
  3. API (Cloud): Runs Pure Logic Gates (deterministic rules, NO AI). Determines Intent and constructs Directive (System Prompt + Constraints).
  4. SDK (Local):
    • Retrieval: Fetches relevant context from Vector DB.
    • Generation: Uses Local SLM (Cortex) to generate specific content (dialogue/action) based on API’s Directive.
    • Validation: Validates generated action against Protocol schema.
  5. SDK: Returns the final structured Action to the Game via Protocol.
  6. Game: Executes the validated action within physics constraints.

Key Principle: The API provides the “Law” (logic), the SDK provides the “Voice” (generation), and the Game provides the “Reality” (execution).

Workflow & Standards

  1. API-First Development: Features are built safely in the cloud before reaching the client.
    • Flow: User Stories -> BDD Tests (Haskell) -> API Endpoints -> SDK Integration.
    • The API and SDK are built in tandem, but the API leads.
  2. No-Database Policy (API):
    • The API is a Pure Logic Engine. It has NO Database. It holds no state.
    • All state is managed by the SDK’s Local Vector DB (Micro-Database) and passed to the API in the Context of every request.
    • The API determines the next state based only on the input context (Pure Function).

Phase 1: SDK Core Development (Client-Side)

Goal: A lightweight, portable client library that defines the Agent interfaces and infrastructure (Vector DB, SLM, API Client). Strict FP & Immutability.

1.1 Architecture & Setup

1.2 Module Implementation

Note: Use Factory Pattern or Functional Composition. Avoid heavy Class Inheritance.


Phase 2: API Service (Proprietary Source)

Goal: The Central Logic Engine. The API handles “Thinking” (Pure Functional Logic & State) and orchestrates the SDK. The SDK handles “Generation” (Local Inference & Memory).

Stack: Haskell Servant, deployed to Render

2.1 Service Infrastructure

2.2 Domain Implementation


BDD Test Suite ✅ COMPLETED 2026-02-03


Documentation ✅ COMPLETED 2026-02-03