Skip to main content

Declarative YAML-based framework for defining, managing, and orchestrating AI coding agent instances

Project description

scitex-agent-container

SciTeX

Declarative YAML-based AI agent lifecycle management

PyPI version Documentation Tests License: AGPL-3.0

pip install scitex-agent-container


Problem

Managing AI coding agents (Claude Code, Cursor, Aider) in production requires manual script-writing, environment setup, and process monitoring for each agent instance. Scaling from one agent to a fleet means duplicating fragile shell scripts with no health checks, restart policies, or lifecycle management.

Solution

scitex-agent-container provides declarative YAML definitions that fully specify an agent -- runtime, model, channels, environment, health checks -- started with a single command:

  • YAML-first configuration -- one file defines runtime, model, watchdog, health checks, restart policy, and hooks
  • Pluggable runtimes -- run agents bare on screen, inside Docker, or inside Apptainer (HPC clusters)
  • Built-in watchdog -- auto-responds to Claude Code's permission prompts so agents run unattended
  • Health checks and restart policies -- agents self-heal with configurable backoff
YAML manifest --> scitex-agent-container start --> screen session
                                                   + watchdog
                                                   + health monitor
                                                   + restart policy

Installation

Requires Python >= 3.10.

pip install scitex-agent-container

# With Telegram integration
pip install scitex-agent-container[telegram]

# Development
pip install scitex-agent-container[dev]

Quickstart

  1. Write a YAML manifest:
apiVersion: cld-agent/v1
kind: Agent
metadata:
  name: telegram-master
  labels:
    role: telegram
    team: core
spec:
  runtime: claude-code
  model: opus[1m]
  workdir: ~/proj

  claude:
    channels:
      - plugin:telegram@claude-plugins-official
    flags:
      - --dangerously-skip-permissions
    session: continue

  env:
    CLAUDE_AGENT_ROLE: telegram
    CLAUDE_AGENT_ID: telegram-master

  screen:
    name: cld-telegram

  watchdog:
    enabled: true
    interval: 1.5
    responses:
      y_n: "1"
      y_y_n: "2"
      waiting: "/speak-and-call"

  health:
    enabled: true
    interval: 30
    method: screen-alive

  restart:
    policy: on-failure
    max_retries: 3
    backoff:
      initial: 30
      max: 300
      multiplier: 2
  1. Start and monitor:
scitex-agent-container start config/examples/telegram-master.yaml
scitex-agent-container status telegram-master
scitex-agent-container logs telegram-master -n 100
scitex-agent-container attach telegram-master   # Ctrl-A D to detach

Four Interfaces

Python API
from scitex_agent_container import (
    AgentConfig, load_config, validate_config,
    agent_start, agent_stop, agent_restart, agent_status, agent_logs,
    Registry,
)

config = load_config("agent.yaml")      # Parse YAML manifest
agent_start("agent.yaml")               # Launch agent
info = agent_status("telegram-master")   # Query status
agent_stop("telegram-master")            # Stop agent
agent_restart("telegram-master")         # Restart agent
output = agent_logs("telegram-master")   # Read logs
registry = Registry()                    # Access agent registry
CLI Commands
scitex-agent-container --help-recursive          # Show all commands

# Lifecycle
scitex-agent-container start <config.yaml>       # Start an agent
scitex-agent-container stop <name>               # Stop an agent
scitex-agent-container restart <name>            # Restart an agent
scitex-agent-container attach <name>             # Attach to screen session

# Inspection
scitex-agent-container status [name] [--json]    # Show agent status
scitex-agent-container list [--json]             # List all agents
scitex-agent-container ps [--json]               # Alias for list
scitex-agent-container logs <name> [-n LINES]    # Show recent output
scitex-agent-container health <name> [--json]    # Run health check

# Configuration
scitex-agent-container validate <config.yaml>    # Validate YAML config
scitex-agent-container build [--runtime docker|apptainer]

# Maintenance
scitex-agent-container cleanup                   # Remove stale entries
scitex-agent-container list-python-apis [-v]     # List public API tree
scitex-agent-container version                   # Show version
MCP Server -- for AI Agents

Not yet implemented. Planned for a future release.

Skills -- for AI Agent Discovery

Skills are planned for a future release. They will be available under _skills/ and via the CLI.

Part of SciTeX

scitex-agent-container is part of SciTeX. It depends on scitex-container for container runtime abstractions and is used by scitex-orochi for multi-machine agent orchestration.

Four Freedoms for Research

  1. The freedom to run your research anywhere -- your machine, your terms.
  2. The freedom to study how every step works -- from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 -- because we believe research infrastructure deserves the same freedoms as the software it runs on.


SciTeX

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

scitex_agent_container-0.4.0.tar.gz (409.6 kB view details)

Uploaded Source

Built Distribution

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

scitex_agent_container-0.4.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file scitex_agent_container-0.4.0.tar.gz.

File metadata

  • Download URL: scitex_agent_container-0.4.0.tar.gz
  • Upload date:
  • Size: 409.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_agent_container-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fad526157f7c3a906a39e4f3e0bd1244379d8c775be67132e11d7618bbc82c83
MD5 676a977cc13efff4b73ae53cd2c7442f
BLAKE2b-256 eb7da76319479974a267ad1d42d7e8202347b7d75fbf047fdfe2c1a8e2489cfe

See more details on using hashes here.

File details

Details for the file scitex_agent_container-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scitex_agent_container-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb559c62d4fe4350a10931be81607b531560695c85ab2000f4f98bc00520e4e3
MD5 eef47257ab6ae1db0625b2df5f5ba126
BLAKE2b-256 e58444eb81f11649d5df3369d0754aad0bbc341950fcc207435d7399a981c075

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