OpenRath#

A PyTorch-like multi-agent and multi-session runtime.

OpenRath turns agent runtime state into explicit Python objects: Session carries collaboration state, Sandbox decides where tools run, Memory persists knowledge across runs, and Workflow composes agents into reusable systems.

Start Tutorials Read Developer Notes GitHub

import os

from rath import flow
from rath.session import Session

agent = flow.Agent(
    "Use tools when helpful.",
    model=os.environ.get("OPENAI_DEFAULT_MODEL") or "gpt-5.5",
    memory="local",
)

user = Session.from_user_message(
    "Create a file, then read it back."
).to("local", spec="./")

out = agent(user)

Tutorials use deterministic steps where reproducibility matters. Production agent workflows use the same Session, FlowToolCall, Workflow, Memory, and Backend abstractions with OpenAI-compatible or Anthropic configuration.

Where To Start#

Path

Use it for

Entry

Installation

Install OpenRath, configure model credentials, and connect a sandbox backend when needed.

Installation

Project Status

Understand v1.2.0 maturity, new runtime layers, and remaining productization work.

Project Status

Tutorials

Learn from the v1.2 numbered example ladder and focused runtime tutorials.

Tutorials

Blog

Read project updates, release announcements, and engineering notes.

Blog

Developer Notes

Understand runtime components, call boundaries, memory, and async behavior.

Developer Notes

API Reference

Look up public modules, function signatures, and integration points.

API Reference

Core Model#

Concept

Role

Session

Carries ordered chunk rows, sandbox placement, and lineage metadata through a run.

Backend

Opens the local or OpenSandbox execution environment attached to a session.

Memory

Persists recalled and committed agent knowledge through local or optional OpenViking stores.

FlowToolCall

Exposes JSON schemas to the model and Python callables to the runtime.

Workflow

Composes agents and session transformations as ordinary Python modules.

AgentParam

Stores the agent system session plus LLM routing options.

Provider

Stores LLM routing, request parameters, retry/budget policy, and optional config lookup.

OpenRath in the PyTorch lens

OpenRath borrows PyTorch’s compositional vocabulary for agent runtime state: Session as the flowing value, Backend as placement, Memory as persistent state, Tool as callable operation, and Workflow as composition.#

OpenRath paradigm map

The runtime separates agent composition, session state, backend placement, and memory into explicit surfaces.#

Runnable Example Ladder#

Example

Demonstrates

01 Hello Agent

The smallest flow.Agent program.

02 Session Lineage

Fork, detach, session graph, and JSONL export.

09 Memory

Key-free local memory remember / recall / commit.

10 Provider Variation

Swapping OpenAI-compatible and Anthropic providers.

PyTorch Mental Model#

PyTorch mental model

OpenRath counterpart

Tensor carries data

Session carries agent state

Module composes computation

Workflow / Agent composes behavior

device controls placement

Backend controls execution placement

Parameter persists state

Memory persists agent knowledge

callable module exposes a reusable interface

FlowToolCall exposes tools