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.0.tar.gz (405.4 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.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_agent_container-0.3.0.tar.gz
  • Upload date:
  • Size: 405.4 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.0.tar.gz
Algorithm Hash digest
SHA256 a60c4cdb8e5a5b65e8dc2fe5569b23d64c57bcf67f083f503e9cf7e9c2234344
MD5 e143067f26c727336c6c0def3158106d
BLAKE2b-256 691c106101955a610cc6fa66c42ec87cf0c0d8f793c69e7dd0930b8e1c4e5a4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scitex_agent_container-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 547e234ef33bdc80f4bc62d0ab0f5644099f9d1398556678a05593bc1fc418cb
MD5 fb76c5ae4b114da9dcebf3380cf91ba7
BLAKE2b-256 3f5d1eb566977043913358307af8fe4cf1c9f3d834126ef87f3f2a0344a75d47

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