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.3.1.tar.gz (405.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.3.1-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_agent_container-0.3.1.tar.gz
  • Upload date:
  • Size: 405.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.3.1.tar.gz
Algorithm Hash digest
SHA256 f9bb023cbe3e12a9c7b52616b3f8544ea73a0b39127d648a4a9d3ae202bf143d
MD5 4dbbfacea6121fbc4ce03bdf27eab4ff
BLAKE2b-256 2a1e71a0cb86d8368f89740a7d17871d229cbe5b03e17bfa5eb8a63fe304dbe0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scitex_agent_container-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbf874535a505815af2d6a7b4ad30742d99891d9e6d39b1353c800a01f14b950
MD5 e89bcdb3bcac09bdd07fdb1614c4cfb1
BLAKE2b-256 26c842b02c095e61dd7d1d11250c6e7ebd4292bc6c0ff57f0613c21e10024ce6

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