SDK Reference

Composabl SDK Documentation

Introduction

Welcome to the Composabl SDK documentation. Composabl is an enterprise platform for building, training, and deploying autonomous multi-agent systems using reinforcement learning and intelligent control systems.

What is Composabl?

Composabl provides a comprehensive toolkit for creating AI agents that can learn and adapt to complex environments. Whether you're automating industrial processes, optimizing logistics, or building intelligent game agents, Composabl offers the tools and infrastructure you need.

Key Features

  • Modular Agent Design: Build agent systems using reusable skills, sensors, and perceptors

  • Multiple Training Targets: Train locally, in Docker, on Kubernetes, or in the cloud

  • Flexible Skill Types: Combine learning-based and programmatic control strategies

SDK Components

The Composabl SDK consists of four main packages:

1. Composabl (Main Package)

The unified interface that combines all SDK components. This is the primary package you'll install and import.

Key Features:

  • Single import for all functionality

  • Simplified API for common tasks

  • Integrated licensing and configuration

2. Composabl Core

The foundation layer providing:

  • Agent and skill definitions

  • Sensor and perceptor frameworks

  • Simulator communication protocols

  • Goal templates (Maintain, Approach, Avoid, Maximize, Minimize)

3. Composabl Train

The training infrastructure features:

  • Checkpointing and resume capabilities

  • Multi-environment training

  • Recording and visualization tools

4. Composabl CLI

Command-line tools for:

  • Project scaffolding

  • Component management

  • Simulator operations

  • Training job submission

  • Debugging and validation

Getting Started

Prerequisites

  • Python 3.10 or 3.11

  • Docker (optional, for containerized simulators)

Installation

pip install composabl

License Requirements

Composabl requires a valid license key. Request a license -> [email protected]

Quick Start Example

import os
from composabl import Agent, Skill, Trainer, MaintainGoal, Sensor

# Configure licensing
os.environ["COMPOSABL_LICENSE"] = "your-license-key"
os.environ["COMPOSABL_EULA_AGREED"] = "1"

# Create an agent
agent = Agent()

# Define sensors
agent.add_sensors([
    Sensor("temperature", "Current temperature in Celsius", 
           lambda obs: obs[0]),
    Sensor("pressure", "Current pressure in bar", 
           lambda obs: obs[1])
])

# Create a skill with a maintain goal
temp_skill = Skill("maintain-temp", 
                  MaintainGoal("temperature", 
                              "Keep temperature at 25°C", 
                              target=25.0))
agent.add_skill(temp_skill)

# Configure training
trainer = Trainer({
    "target": {
        "docker": {
            "image": "composabl/sim-reactor:latest"
        }
    },
    "env": {
        "name": "reactor-optimization"
    }
})

# Train the agent
trainer.train(agent, train_cycles=100)

Architecture Overview

┌─────────────────────────────────────────────────────────┐
│                    User Application                      │
├─────────────────────────────────────────────────────────┤
│                    Composabl (Main)                      │
├─────────────────┬───────────────────┬───────────────────┤
│  Composabl Core │  Composabl Train  │  Composabl CLI   │
├─────────────────┴───────────────────┴───────────────────┤
│              Infrastructure (Ray, Docker, K8s)           │
└─────────────────────────────────────────────────────────┘

Core Concepts

Agents

The central orchestrator that combines skills, sensors, and perceptors to solve tasks.

Skills

Modular behaviors that can be:

  • Teachers: Learning-based using reinforcement learning

  • Controllers: Programmatic with deterministic logic

  • Selectors: Choose between multiple sub-skills

  • Coordinated: Multi-agent coordination

Sensors

Transform raw observations into meaningful features for skills.

Perceptors

Pre-process sensor data (e.g., calculate derivatives, filter noise).

Scenarios

Define variable initial conditions for robust training.

Goals

Pre-built objectives:

  • MaintainGoal: Keep a value stable

  • ApproachGoal: Move toward a target

  • AvoidGoal: Stay away from a value

  • MaximizeGoal: Increase a value

  • MinimizeGoal: Decrease a value

Training Workflow

  1. Define the Agent: Create sensors and skills

  2. Configure Training: Set target, algorithm, and resources

  3. Train: Run training cycles with automatic checkpointing

  4. Evaluate: Test the trained agent's performance

  5. Deploy: Package and deploy the trained agent

Development Workflow

  1. Create Components: Use CLI to scaffold skills, simulators, etc.

  2. Implement Logic: Define behaviors in Python

  3. Test Locally: Validate with local simulators

  4. Publish: Upload to the Composabl platform

  5. Train at Scale: Leverage Composabl's training platform

Last updated