Core Platform v1.2.0 Stable

Platform Architecture

A modular, high-performance framework for building AI-powered applications with integrated session management, secure storage, and cloud-native capabilities.

System Design

/architecture
Application Layer
User-facing logic & UI Integration
Platform Services
Thread Pool
Usage Tracking
User Settings
Interface Layer
Storage API
Auth API
Cloud API
Implementation Layer
File System
HSQL DB
AWS SDK

Session Management

The platform uses a structured session ID system to isolate global resources from user-specific data.

  • G- Global sessions (Shared)
  • U- User sessions (Private)
kotlin
// Create new sessions
val globalSession = Session.newGlobalID()
val userSession = Session.newUserID()

// Parse and validate
val session = Session.parseSessionID("G-20231215-AbC1")

User Identity

The User data class encapsulates authenticated identity and credentials.

kotlin
val user = User(
    email = "user@example.com",
    name = "John Doe",
    id = "user123",
    picture = "https://example.com/avatar.jpg"
)

Developer Best Practices

🛡️

Resource Isolation

Always use the ThreadPoolManager to get pools scoped to a session. This prevents one session from starving others of CPU resources.

threadPoolManager.getPool(session, user)
⚠️

Error Handling

Validate session IDs at the entry point of every service call to prevent directory traversal or unauthorized access.

Session.validateSessionId(id)

Configuration

Lock the ApplicationServicesConfig after initialization to prevent runtime modification of core service providers.

ApplicationServicesConfig.isLocked = true
🚀 Quick Start: Initializing the Platform
kotlin
// 1. Set data root
ApplicationServices.dataStorageRoot = File("/var/lib/cognotik")

// 2. Initialize services
val storage = ApplicationServices.fileApplicationServices().dataStorageFactory(dataDir)

// 3. Lock config
ApplicationServicesConfig.isLocked = true