Skip to main content

Python SDK for the komputer.ai platform

Project description

komputer-ai Python SDK

Python client for the komputer.ai platform.

Installation

pip install komputer-ai-sdk

Or install directly from the repository:

pip install git+https://github.com/kontroloop-ai/komputer-ai.git#subdirectory=komputer-sdk/python

Quick Start

from komputer_ai.client import KomputerClient

client = KomputerClient("http://localhost:8080")

# Create an agent
agent = client.create_agent(
    name="my-agent",
    instructions="Summarize the latest Kubernetes release notes",
    model="claude-sonnet-4-6",
)

# Stream events as the agent works
for event in client.watch_agent("my-agent"):
    if event.type == "text":
        print(event.payload.content)
    elif event.type == "task_completed":
        print(f"Done — cost: ${event.payload.cost_usd}")
        break

Usage

Agents

# Create
client.create_agent(name="researcher", instructions="Research AI trends", model="claude-sonnet-4-6")

# List
agents = client.list_agents()

# Get
agent = client.get_agent("researcher")

# Update
client.patch_agent("researcher", model="claude-haiku-4-5-20251001", lifecycle="Sleep")

# Send a follow-up task to an idle agent
client.create_agent(name="researcher", instructions="Now focus on LLM benchmarks")

# Cancel a running task
client.cancel_agent_task("researcher")

# Delete
client.delete_agent("researcher")

Memories

client.create_memory(name="company-context", content="We are a B2B SaaS company.", description="Background info")
client.patch_agent("my-agent", memories=["company-context"])

memories = client.list_memories()
client.patch_memory("company-context", content="Updated context.")
client.delete_memory("company-context")

Skills

client.create_skill(name="healthcheck", description="Check service health", content="curl -s http://api/healthz")
client.patch_agent("my-agent", skills=["healthcheck"])

skills = client.list_skills()
client.delete_skill("healthcheck")

Schedules

client.create_schedule(
    name="daily-report",
    schedule="0 9 * * *",
    instructions="Generate a daily status report",
    timezone="America/New_York",
)

schedules = client.list_schedules()
client.patch_schedule("daily-report", schedule="0 10 * * *")
client.delete_schedule("daily-report")

Secrets

client.create_secret(name="api-keys", data={"GITHUB_TOKEN": "ghp_xxx", "SLACK_TOKEN": "xoxb-xxx"})
client.patch_agent("my-agent", secret_refs=["api-keys"])

secrets = client.list_secrets()
client.update_secret("api-keys", data={"GITHUB_TOKEN": "ghp_new"})
client.delete_secret("api-keys")

Connectors

client.create_connector(name="slack", service="slack", url="https://mcp.slack.com", auth_type="token")
client.patch_agent("my-agent", connectors=["slack"])

connectors = client.list_connectors()
client.delete_connector("slack")

Offices

offices = client.list_offices()
office = client.get_office("my-office")

Streaming Events

for event in client.watch_agent("my-agent"):
    match event.type:
        case "task_started":
            print("Agent started working...")
        case "text":
            print(event.payload.content)
        case "tool_call":
            print(f"Using tool: {event.payload.tool}")
        case "task_completed":
            print(f"Done — cost: ${event.payload.cost_usd}")
            break
        case "error":
            print(f"Error: {event.payload.error}")
            break

Event types: task_started, thinking, tool_use, tool_result, text, task_completed, task_cancelled, error.

Context Manager

with KomputerClient("http://localhost:8080") as client:
    agents = client.list_agents()

Project details


Download files

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

Source Distribution

komputer_ai_sdk-0.11.5.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

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

komputer_ai_sdk-0.11.5-py3-none-any.whl (86.2 kB view details)

Uploaded Python 3

File details

Details for the file komputer_ai_sdk-0.11.5.tar.gz.

File metadata

  • Download URL: komputer_ai_sdk-0.11.5.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for komputer_ai_sdk-0.11.5.tar.gz
Algorithm Hash digest
SHA256 deb1b1a493f4405f3289de20c30034f9cdab486987ffc1bbf423cf9303a7f2d7
MD5 cc8b3266a24757f4da423faa6d633fe1
BLAKE2b-256 4670eab62135195c8ecd6892861fd96d1b7df6e88f97ee6500715eaa826289cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for komputer_ai_sdk-0.11.5.tar.gz:

Publisher: build.yaml on kontroloop-ai/komputer-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file komputer_ai_sdk-0.11.5-py3-none-any.whl.

File metadata

File hashes

Hashes for komputer_ai_sdk-0.11.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a9bc3225c8f69a56d04d82a8709ceb833b1d8cdb182be45d17ee015fa195ba
MD5 93949d7dc143e6b307af1579222c4245
BLAKE2b-256 65b10ddb0702219606629d36292a0c61469d2a5d83e9f4a81cd615b5ad4e11fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for komputer_ai_sdk-0.11.5-py3-none-any.whl:

Publisher: build.yaml on kontroloop-ai/komputer-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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