Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Roboz

CI Python 3.13+ License: Apache-2.0

Typed control flow and context management for reliable agentic workflows. Roboz lets the model decide what needs judgment, then hands the result to ordinary, typed Python for the steps that should not be probabilistic.

[!WARNING] Roboz is pre-release software requiring Python 3.13 or newer. APIs may change before 1.0.

Why Roboz

Chain tools instead of prompting through every step. The model chooses an active tool; successful output can flow directly into typed, passive tools with no additional model decision. Conditions can route by output value or type, external policy, or current state. Branches can converge on a shared successor. Only active tools enter the model's tool surface, keeping orchestration details out of the prompt while Python and Pydantic enforce the handoffs.

Treat context as a lifecycle, not an ever-growing transcript. Every message can carry its own truncation policy. Keep an operational result intact while it is recent, reduce it to a stub later, and remove it from model context when it is stale. NO_MESSAGE hides internal chatter immediately. These policies change only the view sent to the model; runtime events and persisted messages retain the full record.

Install

The PyPI commands below require a published release. For an unpublished checkout, build and test the local wheels. Maintainers publish reviewed package tags directly to PyPI.

uv add roboz

Or with pip:

python -m pip install roboz

Optional tools and adapters are separate distributions in this repository: roboshed, roboz-endpoints, and roboz-proton-bridge. Start with the installation and add-on guide to build their wheels and compose agents from capabilities. These companion releases must be published before their named PyPI installs and convenience extras are usable.

Quick start

from builtins import input as read_input

import roboz as rz


@rz.tool
def ask_number(input: rz.Empty, messages: list[rz.Message]) -> rz.Int:
    """Ask the user for an integer, repeating until the response is valid."""
    while True:
        try:
            reply = read_input("Enter an integer: ")
        except EOFError:  # Keep the example runnable in non-interactive checks.
            reply = "7"
        try:
            return rz.Int(value=int(reply))
        except ValueError:
            print("Please enter a whole number.")


@rz.tool(
    chained_to=ask_number,
    chain_condition=lambda output: output.value % 2 == 0,
)
def report_even(input: rz.Int, messages: list[rz.Message]) -> rz.Stop:
    """Report that the supplied integer is even."""
    print(f"{input.value} is even.")
    return rz.Stop(value="even")


@rz.tool(
    chained_to=ask_number,
    chain_condition=lambda output: output.value % 2 != 0,
)
def report_odd(input: rz.Int, messages: list[rz.Message]) -> rz.Stop:
    """Report that the supplied integer is odd."""
    print(f"{input.value} is odd.")
    return rz.Stop(value="odd")


agent = rz.Agent(
    name="demo",
    is_agentic=False,
    agent_endpoint=None,
    default_tools=[ask_number],
    tools=[report_even, report_odd],
)

agent.invoke()

ask_number starts with Empty, handles input validation locally, and returns a typed Int. Roboz then evaluates both conditions and runs exactly one passive successor. The routing is ordinary, testable Python; no model needs to interpret the reply or choose the next step.

The same program is available in examples/quickstart.py. See examples/tool_chaining.py for conditional routing and convergence, and examples/message_truncation.py for a sliding message-visibility window.

Primitives

Primitive Role
rz.Agent Owns the tool surface, prompt assembly, invoke loop, and runtime events.
@rz.tool Creates an action from typed input, messages, and output models.
rz.Ctx Binds keyword configuration and dependency objects without a custom class.
@rz.factory Creates a tool whose runtime context declares external dependencies.
rz.Skill Packages reusable instructions and optional tools.
rz.Message Carries content plus its model-context truncation lifecycle.
roboz.runtime.EventPipe Emits lifecycle, message, and runtime events to explicit sinks.

The package contains agent and LLM primitives, models, runtime and persistence infrastructure, dependencies, skills, tooling, and foundational control/interaction tools. roboz.dependencies also validates exact dependency registrations and binds checker callbacks without running them. Shed supplies health probes and scheduling through roboshed.dependency_health. roboz.llm.ModelSelector selects among lazy model endpoints without constructing clients and can supply the current endpoint to a DependencyRoute. Provider catalogs and SDK integrations, guarded file and CLI tools, and application integrations belong in companion packages and are not dependencies of Roboz. Install roboz-endpoints[openai] for the initial OpenRouter, Cerebras, and Groq catalogues; it installs core automatically. See the endpoint guide for model selection and SDK adapters.

roboz.deployment supplies recursive DeployableAgent definitions and capability contracts. Put definitions directly in subagents or background_agents, append extensions with the explicit add methods, and unpack agent, background_agents = definition.build(). Capabilities declare required owner attributes and bind with build(agent, pipe). roboshed supplies reusable orchestrator and Librarian constructors, concrete capabilities, memory tools, and sandbox structure. Import the constructors from roboshed.agents; the fixed lazy RoboSprawl recipe is roboshed.deployments.robosprawl.RoboSprawl. Construct it without inputs, configure it through setters, then call argument-free build() with all required inputs supplied. The recipe owns project context and persistence; the caller owns invocation.

Documentation

Guide Contents
docs/reference.md Concise API and runtime reference
docs/agent-authoring.md Agent composition and prompt policy
docs/tool-authoring.md Tools, factories, dependencies, and chaining
docs/docstrings.md Python and agent-facing tool docstring conventions
docs/testing-practices.md Test design and review expectations
docs/build-and-test.md Local setup and CI-equivalent validation
docs/port-parity.md Audited source-commit parity and deliberate exclusions
docs/addons.md Optional packages, composition, and releases
docs/maintainer-basics.md Practical changelog, versioning, release, and open-source basics

Development

uv sync --locked --dev
uv run pytest
uv run ruff check
uv run pyright
bash scripts/run_type_tests.sh
uv build

Build companions with uv build --all-packages --out-dir dist/first-slice.

Roboz is typed and ships a PEP 561 py.typed marker.

License

Roboz is licensed under the Apache License 2.0. Copyright © 2026 Tachion Oy.

Context-aware tools use ctx: rz.Ctx and bind with rz.Ctx(prefix="hello"). See tool authoring and the context API migration.

Release files for roboz 0.1.2.dev4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roboz 0.1.2.dev4
File Size Uploaded
roboz-0.1.2.dev4.tar.gz 78.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for roboz 0.1.2.dev4
File Interpreter ABI Platform
roboz-0.1.2.dev4-py3-none-any.whl Python 3 none any Details

Total release size: 179.4 kB

Release files / roboz-0.1.2.dev4.tar.gz

Download URL roboz-0.1.2.dev4.tar.gz
Size 78.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c743438a5359e26dd1df134ca0ec2030701e61ba11c023c77da4294613f04b9
BLAKE2b-256 checksum
How to use checksums
cf04168f1fc6bfb0e83e330caf6646d87234e699ea0481741f509b496dbd085a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / roboz-0.1.2.dev4-py3-none-any.whl

Download URL roboz-0.1.2.dev4-py3-none-any.whl
Size 100.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
366cb30618817f671320966610508d7cfde8e9ff426b9a60b4f5b9010c64cb82
BLAKE2b-256 checksum
How to use checksums
cbe6ed3d0b7a3f8314eb6f2addd1f5adb7b7504968c2634fc8bc02fcceaf864e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page