Metadata-Version: 2.4
Name: zymis
Version: 0.1.0
Summary: Lightweight multi-agent orchestration framework — Boss, Manager, Coder, Critics, and Worker pipeline
Author-email: Zymis Contributors <indrohelpdesk@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/abhinav00anand/zymis
Project-URL: Documentation, https://github.com/abhinav00anand/zymis#readme
Project-URL: Repository, https://github.com/abhinav00anand/zymis.git
Project-URL: Issues, https://github.com/abhinav00anand/zymis/issues
Keywords: ai,agents,orchestration,llm,swarm,code-generation,multi-agent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Code Generators
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyio>=4.4
Requires-Dist: asyncio-throttle>=1.0.2
Requires-Dist: openai>=1.35
Requires-Dist: anthropic>=0.30
Requires-Dist: google-generativeai>=0.7
Requires-Dist: boto3>=1.34
Requires-Dist: httpx>=0.27
Requires-Dist: aiohttp>=3.9
Requires-Dist: pydantic>=2.7
Requires-Dist: pydantic-settings>=2.3
Requires-Dist: structlog>=24.2
Requires-Dist: rich>=13.7
Requires-Dist: redis[hiredis]>=5.0
Requires-Dist: chromadb>=0.5
Requires-Dist: sentence-transformers>=3.0
Requires-Dist: tiktoken>=0.7
Requires-Dist: tree-sitter>=0.22
Requires-Dist: pygments>=2.18
Requires-Dist: gitpython>=3.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: omegaconf>=2.3
Requires-Dist: fastapi>=0.111
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: click>=8.1
Requires-Dist: typer>=0.12
Requires-Dist: opentelemetry-api>=1.25
Requires-Dist: opentelemetry-sdk>=1.25
Requires-Dist: opentelemetry-exporter-otlp>=1.25
Requires-Dist: prometheus-client>=0.20
Requires-Dist: python-telegram-bot>=21.3
Requires-Dist: cryptography>=42.0
Requires-Dist: tenacity>=8.3
Requires-Dist: cachetools>=5.3
Requires-Dist: humanize>=4.9
Requires-Dist: python-dateutil>=2.9
Requires-Dist: ujson>=5.10
Requires-Dist: xxhash>=3.4
Requires-Dist: aiofiles>=23.2
Requires-Dist: psutil>=5.9
Requires-Dist: pytest>=8.2
Requires-Dist: pytest-asyncio>=0.23
Requires-Dist: pytest-cov>=5.0
Requires-Dist: pytest-mock>=3.14
Requires-Dist: hypothesis>=6.103
Provides-Extra: dev
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: black>=24.4; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: ipython>=8.25; extra == "dev"
Provides-Extra: gpu
Requires-Dist: torch>=2.3; extra == "gpu"
Requires-Dist: numpy>=1.26; extra == "gpu"
Dynamic: license-file

# ⚡ Zymis

[![PyPI version](https://img.shields.io/pypi/v/zymis.svg)](https://pypi.org/project/zymis/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CI Validation](https://github.com/abhinav00anand/aiswarm/actions/workflows/ci.yml/badge.svg)](https://github.com/abhinav00anand/aiswarm/actions)

```text
  _____           _     
 |__  /_   _ _ __ (_)___ 
   / /| | | | '_ \| / __|
  / /_| |_| | | | | \__ \
 /____|\__, |_| |_|_|___/
       |___/             
```

> **The Autonomous, Safeguarded Swarm Orchestra for Software Engineering.**
>
> Zymis is a usable, lightweight, and modular multi-agent orchestration framework designed to plan, code, review, compile, and validate software within sandboxed boundaries.

---

## 🎭 The Orchestra Architecture

Zymis organizes AI agents into a structured hierarchical pipeline where every agent plays a distinct instrument:

```mermaid
graph TD
    User([User Request]) --> Boss[Boss Agent]
    Boss --> Router{Host-1 Global Router}
    
    Router -->|FAST Path| CapManager[Host-2 Capability Manager]
    Router -->|PRODUCTION Path| Manager[Manager Agent]
    
    Manager --> Planner[Task Planner]
    Planner --> RAG[Context Selector & RAG]
    RAG --> Coder[Coder Agent]
    Coder --> Sandbox[Execution Sandbox & Pre-Check]
    Sandbox --> Critics[Style / Performance / Security / Reliability Critics]
    Critics --> Compiler[Compiler / Python/C++/Rust build checks]
    Compiler --> TestRunner[Unit & Stress Test runner]
    TestRunner --> MergeController{5-Gate Merge Controller}
    
    MergeController -->|Pass| Success([Merged & Confirmed Code])
    MergeController -->|Fail| SelfHealing[Self-Healing & Retry Loop]
    SelfHealing --> Coder
```

---

## 🚀 Key Orchestral Features

*   **Host-1 Global Router**: Smart task routing with multiple execution paths:
    *   `FAST` lane (~0.1s latency) for trivial file operations or simple completions.
    *   `PRODUCTION` lane (12-stage Boss pipeline) for complex codebases and full swarms.
    *   `HYBRID` lane dynamically scaling based on task risk assessment.
*   **Execution Sandbox**: Subprocess code isolation with built-in path-traversal protection and restricted commands allowlisting (`python`, `pytest`, `git`, `pip`).
*   **Security Subsystem**:
    *   `APIKeyValidator`: Fail-fast startup checks.
    *   `SecretRedactor`: Filters API keys (OpenAI, Anthropic, Google, AWS, GitHub) from output logs.
    *   `EngineeringGovernor`: Spending limits, cost safeguards, and usage tracking.
    *   `AuditLedger`: Thread-safe, append-only logs kept locally in `~/.zymis/audit.jsonl`.
*   **5-Gate Merge Controller**: Strict automated validation checks on compilation, unit tests, code quality, and style before merging files.
*   **Rich Telemetry**: Built-in Prometheus metrics (`/metrics`) and OpenTelemetry-compatible tracing wrappers.

---

## 📦 Installation

Install Zymis from PyPI:

```bash
pip install zymis
```

To enable development dependencies:

```bash
pip install "zymis[dev]"
```

---

## 🛠️ Quick Start

### 1. Configure Credentials
Set your credentials in your shell or create a `.env` file in your workspace directory:

```bash
# Zymis API configuration
ZYMIS_API_KEY=your-zymis-key
OPENAI_API_KEY=your-openai-api-key
# Or use Anthropic, Google (Gemini), Bedrock, etc.
```

### 2. Command Line Interface (CLI)
Zymis includes a powerful command line tool to run swarms directly:

```bash
# Run a simple coding task in fast mode
zymis run "create a database schema for user profiles" --desc "Using SQLite and SQLAlchemy" --file models.py

# Cancel a running task
zymis cancel <task_id>

# Check active swarm task statuses
zymis status
```

### 3. FastAPI Web Server
Spin up the FastAPI integration server to interact with Zymis via REST API endpoints:

```bash
# Start the API server on port 8000
python -m apps.api.main
```

---

## ⚙️ Environment Variables

Customize the behavior of the Zymis engine:

| Variable | Description | Default |
| :--- | :--- | :--- |
| `ZYMIS_API_KEY` | Secret token to authenticate local execution clients. | None |
| `ZYMIS_NO_OLLAMA` | Disable local Ollama provisioning and model auto-pulls. | `0` |
| `ZYMIS_NOTEBOOK_MODE` | Enable lightweight notebook-friendly stdout stream formats. | `0` |
| `ZYMIS_AUDIT_LOG_PATH` | Override target folder for the local audit ledger. | `~/.zymis/audit.jsonl` |
| `ZYMIS_LOCAL_FIRST` | Prioritize local models or custom OpenAI-compatible adapters. | `0` |

---

## 👥 Contributing

Contributions are welcome! Please refer to the [Contributing Guide](CONTRIBUTING.md) and adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).

## 📄 License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

For support, contact us at [indrohelpdesk@gmail.com](mailto:indrohelpdesk@gmail.com).
