Skip to main content

Agent Control Plane API - Multi-tenant AI agent orchestration and management platform

Project description

Kubiya Control Plane API

A multi-tenant AI agent orchestration and management platform built with FastAPI, Temporal, and PostgreSQL.

Features

  • Multi-tenant Architecture: Manage multiple projects, teams, and agents
  • Workflow Orchestration: Temporal-based workflow execution
  • Flexible Agent Runtime: Support for multiple agent types and skills
  • Policy Enforcement: OPA-based policy engine for agent governance
  • Scalable Workers: Distributed worker architecture for agent execution
  • Context Management: Environment and team-specific context handling
  • LLM Integration: Support for multiple LLM providers via LiteLLM
  • Comprehensive APIs: RESTful APIs for all platform features

Installation

Using pip

pip install kubiya-control-plane-api

With optional dependencies

# For API server
pip install kubiya-control-plane-api[api]

# For worker runtime
pip install kubiya-control-plane-api[worker]

# For development
pip install kubiya-control-plane-api[dev]

# All dependencies
pip install kubiya-control-plane-api[all]

From source

git clone https://github.com/kubiyabot/agent-control-plane.git
cd agent-control-plane
pip install -e .

Quick Start

1. Set up environment variables

Create a .env file or set the following environment variables:

# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/control_plane

# Supabase (for serverless deployments)
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-key

# Temporal Configuration
TEMPORAL_HOST=localhost:7233
TEMPORAL_NAMESPACE=default

# API Configuration
API_TITLE="Agent Control Plane"
API_VERSION="1.0.0"
ENVIRONMENT=development
LOG_LEVEL=info

# Security
SECRET_KEY=your-secret-key-here

# Optional: Kubiya Integration
KUBIYA_API_KEY=your-kubiya-api-key
KUBIYA_API_URL=https://api.kubiya.ai

2. Run database migrations

alembic upgrade head

3. Start the API server

uvicorn control_plane_api.app.main:app --host 0.0.0.0 --port 7777 --reload

The API will be available at http://localhost:7777

4. Access the API documentation

Open your browser and navigate to:

  • Swagger UI: http://localhost:7777/api/docs
  • ReDoc: http://localhost:7777/api/redoc

5. Start a worker

To process agent execution workflows:

kubiya-control-plane-worker

API Endpoints

Core Resources

  • Projects: /api/v1/projects - Multi-project management
  • Environments: /api/v1/environments - Environment configuration
  • Agents: /api/v1/agents - Agent management
  • Teams: /api/v1/teams - Team management
  • Workflows: /api/v1/workflows - Workflow definitions
  • Executions: /api/v1/executions - Execution tracking
  • Workers: /api/v1/workers - Worker registration and management

Skills and Policies

  • Skills: /api/v1/skills - Tool sets and definitions
  • Policies: /api/v1/policies - Policy management and enforcement

Integration

  • Secrets: /api/v1/secrets - Secrets management (proxies to Kubiya)
  • Integrations: /api/v1/integrations - Third-party integrations
  • Models: /api/v1/models - LLM model configuration

Utilities

  • Health: /api/health - Health check endpoint
  • Task Planning: /api/v1/task-planning - AI-powered task planning

Configuration

The application uses Pydantic Settings for configuration management. All settings can be configured via environment variables or a .env file.

Key Configuration Options

  • DATABASE_URL: PostgreSQL connection string
  • SUPABASE_URL, SUPABASE_KEY: Supabase configuration for serverless
  • TEMPORAL_HOST: Temporal server address
  • KUBIYA_API_KEY: Kubiya platform API key
  • SECRET_KEY: Secret key for JWT token signing
  • LOG_LEVEL: Logging level (debug, info, warning, error)
  • ENVIRONMENT: Deployment environment (development, staging, production)

Development

Install development dependencies

pip install -e ".[dev]"

Run tests

# All tests
pytest

# Unit tests only
pytest -m unit

# Integration tests
pytest -m integration

# With coverage
pytest --cov=control_plane_api --cov-report=html

Code formatting

# Format code with black
black .

# Lint with ruff
ruff check .

Database migrations

# Create a new migration
alembic revision --autogenerate -m "Description of changes"

# Apply migrations
alembic upgrade head

# Rollback migration
alembic downgrade -1

Architecture

Workflow Orchestration

The platform uses Temporal for reliable workflow execution:

  • Durable execution with automatic retries
  • Activity-based task decomposition
  • Support for long-running workflows
  • Built-in observability and monitoring

Multi-tenancy

  • Projects: Top-level isolation boundary
  • Environments: Isolated execution contexts within projects
  • Teams: Collaborative agent groups
  • Agents: Individual agent instances

Worker Architecture

Workers pull tasks from environment-specific queues and execute agent workflows using Temporal.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

License

GNU Affero General Public License v3.0 (AGPL-3.0) - see LICENSE file for details

Support

For issues and questions:

Links

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kubiya_control_plane_api-0.7.0.tar.gz (751.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubiya_control_plane_api-0.7.0-py3-none-any.whl (901.1 kB view details)

Uploaded Python 3

File details

Details for the file kubiya_control_plane_api-0.7.0.tar.gz.

File metadata

  • Download URL: kubiya_control_plane_api-0.7.0.tar.gz
  • Upload date:
  • Size: 751.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kubiya_control_plane_api-0.7.0.tar.gz
Algorithm Hash digest
SHA256 745bbee106676548ffc17c575db5f2016a916be1aaa63e26a108928d044faedc
MD5 4b17493d840d7f1fa031966b906e13b1
BLAKE2b-256 3b45db41752df37cf7ed7bb9b8638688bad6686f2c1990eaf3260a55a2f6c8d0

See more details on using hashes here.

File details

Details for the file kubiya_control_plane_api-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kubiya_control_plane_api-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 332699a1cc17d9e5d2d9287e02d7c143693ccc3d8efaabcdb23cc505c3659877
MD5 e623e3d0725f3beb45d6c1e896314036
BLAKE2b-256 71261f5068d9b8764a8bd9f68ec4af2e8b9755a6b6e67f23a289a01a7f115289

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page