Skip to main content
Pre-release

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

RoboZ

Chain tools. Skip calls.

RoboZ is a framework for building llm powered agents. The core ingredient is that every tool can may be chained conditionally to a subsequent tool thus allowing easy injection of deterministic flows into agentic processes.

The package root contains the concise agent and tool authoring API. Models, LLM operations, built-in tools, and runtime interfaces live in their corresponding domain namespaces; see public imports.

CI Python 3.13+ License: Apache-2.0

Basic idea

The usual agent loop sends every lunch-planning step back through the agent. A Roboz chain returns to the agent when Bob wants no lunch, passes any cuisine into one parameterized restaurant search, and retries the plan directly when no seats are available.

Problems in agents: Context bloat and excessive back-and-forth

Suppose the task we want to achieve is ask our buddy Bob out to lunch and then book a table. For the sake of argument assume that our agent has access to the following MCP servers (Note: this is an example, RoboZ has native Tool primitives):

  • Ask Bob what they want
  • Find a restaurant
  • Book a table.

In the usual approach an agent is presented each MCP server separately in the their system prompt and it must call them one-by-one to complete the task. When the agent is completing the task, at every turn it must choose the correct tool, formulate its output accordingly and absorb the reply into its context, which already must contain the specific instructions on how to use each tool. In addition, at each turn one has to wait for the llm to reply, each reply costs tokens and each reply risks a mistake from the llm.

Deterministic chains

The philosophy in RoboZ is that the workflow is deterministic an only choosing when to initiate is the agent's job. In RoboZ the agent would trigger the "ask Bob what they want" tool and all subsequent steps come by chaining: each tool is chained to other tools upstream and their output is passed down to the chained tool. Each link/edge may introduce a True/False condition, in this case for example if Bob interested in having lunch (with us). If he is not, RoboZ allows for the chain to break and returns back to the default tool, which for an agentic process is usually "ask the llm what to do next". The default mode is that chained tools are not presented to the agent, they are thus passive or in other words their role is strictly in forming deterministic workflows and they cannot be invoked.

Message truncation

Lengthy tasks with many tool calls also add many tokens in the context that may not be relevant to the end result. In RoboZ all tools may choose to truncate their message i.e. not show it to the agent in its complete form or only show it in its entirety a few times and then remove it from the agents context entirely, for example.

Code example

TBD

from roboz import tool
from roboz.models import Empty, Message


class LunchPreference(Empty):
    cuisine: str | None


class Restaurant(Empty):
    name: str
    seats_available: bool


class Booking(Empty):
    confirmation: str


@tool
def plan_lunch_with_bob(
    input: Empty, messages: list[Message]
) -> LunchPreference:
    ...


@tool
def retry_plan_lunch_with_bob(
    input: Restaurant, messages: list[Message]
) -> LunchPreference:
    ...


@tool(
    chained_to=[plan_lunch_with_bob, retry_plan_lunch_with_bob],
    chain_condition=lambda output: (
        isinstance(output, LunchPreference)
        and output.cuisine is not None
    ),
)
def find_restaurant(
    input: LunchPreference, messages: list[Message]
) -> Restaurant:
    ...


retry_plan_lunch_with_bob.chain(
    chained_to=find_restaurant,
    chain_condition=lambda output: (
        isinstance(output, Restaurant) and not output.seats_available
    ),
)


@tool(
    chained_to=find_restaurant,
    chain_condition=lambda output: (
        isinstance(output, Restaurant) and output.seats_available
    ),
)
def book_a_table(input: Restaurant, messages: list[Message]) -> Booking:
    ...

factory closure, endpoint instance and seeing the entire prompt

TBD

Try it

uv add roboz

Or with pip:

python -m pip install roboz

The complete quick start uses a deterministic mock endpoint. Bob first chooses sushi; when no seats are available, the typed chain retries the planner, routes his second choice to pizza, and books—all from one model-selected entry into the chain and without credentials:

uv run python examples/quickstart.py

For an unpublished checkout, first run uv sync --locked --dev. PyPI commands require a published release; see the build and test guide for local wheels.

Control what reaches the model

Context is a projection, not an ever-growing transcript. Every Message can carry a lifecycle policy: keep an output intact while it is recent, reduce it to a stub later, and remove it from model context when it is stale. NO_MESSAGE keeps operational chatter out of model context immediately. These policies affect only what the model sees; runtime events and persisted messages retain the full record.

The prompt is not assembled behind an opaque stack of framework layers. The complete generated system prompt is available before invocation:

print(agent.full_system_prompt)

One execution abstraction

Roboz uses tools for work and for orchestration instead of adding a separate hook mechanism for each new concern.

Concern Roboz abstraction
A model-selectable action Active @tool
A deterministic follow-up Passive chained tool
Runtime configuration or dependencies @factory bound to a concrete typed object
Startup, preflight, and default flow default_tools
Synchronous delegation A subagent exposed as a named tool
Background work An idempotent background-start tool in the default flow

Tools remain independently testable callables with typed inputs and outputs. An agent's dependency view is derived from this same tool graph rather than a second registry.

Put models where they belong

Each agent owns its endpoint. A model-backed factory can bind another endpoint directly, so a planner, specialist, summarizer, or transcription tool does not have to share a model merely because it belongs to the same workflow. LLMEndpointRoute follows a typed endpoint getter when a tool or agent should track live model selection; concrete endpoints keep other uses fixed.

Provider SDKs remain outside core. The roboz package supplies the agent, tooling, model, runtime, persistence, dependency, and deployment primitives; install integrations only where they are needed.

Core primitives

Primitive Role
roboz.Agent Owns the active tool surface, prompt, invoke loop, and runtime events.
roboz.tool Defines an action with typed input and output models.
roboz.factory Binds a concrete typed context or resource to a tool.
roboz.Skill Packages reusable instructions and optional tools.
roboz.models.Message Carries content and its model-context lifecycle.
roboz.deployment.DeployableAgent Composes capabilities, subagents, and background agents.

Optional ecosystem

Start with core and add only the integrations the application needs.

Distribution Adds
roboshed Guarded file and CLI tools, memory, compaction, reusable agents, and deployment recipes.
roboz-endpoints Lazy model catalogues and SDK adapters for OpenAI-compatible providers.
roboz-proton-bridge Proton Bridge email tools.

See the add-on guide for installation and composition, and the endpoint guide for model selection and provider adapters.

Documentation

Guide Start here for
Tool authoring Chaining, factories, conditions, and typed handoffs
Agent authoring Agent composition and prompt policy
Reference Runtime and API semantics
Message truncation example Sliding model-context visibility
Testing practices Deterministic workflow and contract tests

Development

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

See CONTRIBUTING.md and the build and test guide for the complete release gate. 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.

Release files for roboz 0.1.2.dev6

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.dev6
File Size Uploaded
roboz-0.1.2.dev6.tar.gz 81.9 kB Details

Built distribution (wheel)

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

Total release size: 184.8 kB

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

Download URL roboz-0.1.2.dev6.tar.gz
Size 81.9 kB
Tags Source
SHA-256 checksum
How to use checksums
68e29a2f20aad67fa49a60c8b279c099bb1bb2733634c4034e81a4beed595666
BLAKE2b-256 checksum
How to use checksums
56fef916de5c8425741e05270e9a24e167c3f31fcf89954e810b2b18370c4515
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 14, 2026.

Transparency log

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

Download URL roboz-0.1.2.dev6-py3-none-any.whl
Size 102.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f575a90f736eafbc49c417b79ed9a0333a253c8ba6a84de61e6a42a708008766
BLAKE2b-256 checksum
How to use checksums
1a388b0f06a1e72170a37b04cf0539dddfda5ba93155e891a82f9be6f305730f
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 14, 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