(openrath-documentation)= # 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

```python 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](install.md) | | Project Status | Understand v1.2.0 maturity, new runtime layers, and remaining productization work. | [Project Status](project_status.md) | | Tutorials | Learn from the v1.2 numbered example ladder and focused runtime tutorials. | [Tutorials](tutorial/index.md) | | Blog | Read project updates, release announcements, and engineering notes. | [Blog](https://blog.openrath.com) | | Developer Notes | Understand runtime components, call boundaries, memory, and async behavior. | [Developer Notes](developer_notes/index.md) | | API Reference | Look up public modules, function signatures, and integration points. | [API Reference](reference/index.md) | ## 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. | ```{figure} _static/pytorch-lens.png :alt: 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. ``` ```{figure} _static/paradigm-map.png :alt: 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](tutorial/examples/01_hello_agent.md) | The smallest `flow.Agent` program. | | [02 Session Lineage](tutorial/examples/02_session_lineage.md) | Fork, detach, session graph, and JSONL export. | | [09 Memory](tutorial/examples/09_memory.md) | Key-free local memory remember / recall / commit. | | [10 Provider Variation](tutorial/examples/10_provider_variation.md) | 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 | ```{toctree} --- maxdepth: 3 caption: OpenRath hidden: --- Installation Tutorials Developer Notes API Reference ```