# SDK Reference

## AMESA SDK Documentation

### Introduction

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

### What is AMESA?

AMESA 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, AMESA 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 AMESA SDK consists of four main packages:

#### 1. AMESA (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. AMESA Core

The foundation layer providing:

* Agent and skill definitions
* Sensor and perceptor frameworks
* Simulator communication protocols
* Goal templates (Maintain, Approach, Avoid, Maximize, Minimize)

#### 3. AMESA Train

The training infrastructure features:

* Checkpointing and resume capabilities
* Multi-environment training
* Recording and visualization tools

#### 4. AMESA 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

```bash
pip install composabl
```

#### License Requirements

AMESA requires a valid license key. Request a license -> <support@composabl.com>

#### Quick Start Example

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

# Configure licensing
os.environ["AMESA_LICENSE"] = "your-license-key"
os.environ["AMESA_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                      │
├─────────────────────────────────────────────────────────┤
│                    AMESA (Main)                      │
├─────────────────┬───────────────────┬───────────────────┤
│  AMESA Core │  AMESA Train  │  AMESA 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 AMESA platform
5. **Train at Scale**: Leverage AMESA's training platform

{% embed url="<https://sdk.docs.amesa.com/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amesa.com/reference/sdk-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
