# Repository Briefing: Rath-Team/OpenRath
> Source: https://repoforai.com/repo/Rath-Team/OpenRath (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Rath-Team/OpenRath
- **Official Docs / Website**: https://www.openrath.com/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: BSD-3-Clause
- **Engineering Health**: B+ (67/100 · Maintenance 20/35 · Adoption 13/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v2.0.0 (2026-07-31) — https://github.com/Rath-Team/OpenRath/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted
- **Momentum**: 955 ★ total (+0 24h / +1 7d) · 51 forks
- **Topics**: `agent-framework`, `agentic-ai`, `ai-agents`, `anthropic`, `lllm-agent`, `llm`, `memory`, `model-context-protocol`, `multi-agent`, `multi-agent-systems`, `open-source`, `openai`
- **When to Use**: Best for: Python teams building multi-agent workflows that branch, share context, and need traceable outputs, restart recovery, or human approval before consequential actions. Skip if: A single prompt-and-response loop is enough, or you need a fully managed platform without taking on database operations, tool isolation, and approval handling.

## Overview
```text
### Architecture & Core Mechanics
OpenRath is a Python SDK and durable runtime built around Session rather than per-agent chat history. A Session holds ordered message and tool-result chunks alongside execution placement, lineage, and token usage. Agents map Session to Session; Workflows compose those transforms, and an LLM-backed Selector can choose a child workflow inside a normal Python loop. For durable execution, explicit @step and @router boundaries compile into an execution plan with an immutable revision.

The core package depends on openai>=1.0.0, anthropic>=0.40.0, Pydantic>=2.0.0,<3, and mcp>=1.28.1,<2. FlowToolCall couples the model-facing name, description, and JSON schema with a Python callable that receives the Session. Stdio MCP tools can be adapted to the same interface. Sandbox backends determine where operations run; memory is a separate store, not part of tool execution.

### Key Capabilities & Differentiators
Sessions can fork, detach from parent lineage, merge compatible branches, and serialize to JSONL. This makes it possible to trace which branch and workspace contributed to an output, rather than reconstructing that path from transcripts. The local backend runs tools against the host workspace; optional OpenSandbox moves that work into a containerized runtime. The built-in memory store under .openrath/memory/ supports BM25 recall and optional embeddings; OpenViking is an alternative backend. OpenAI-compatible endpoints can be set through OPENAI_BASE_URL.

Durable Runs, Events, and Checkpoints survive worker restarts. Leases and fencing guard against stale commits, while retries, deadlines, and cancellation govern execution. The Effect Ledger records outcomes and idempotency keys; if a non-idempotent action has an uncertain outcome, the run enters NEEDS_REVIEW rather than repeating it blindly. Durable Interrupts handle deliberate pauses for approval or input. Agent Server adds explicit action grants, tenant and project scope, policy checks, secret references, trust labels, and audit.

### Trade-offs & Limitations
Compared with a graph-first orchestrator, OpenRath makes it natural to pass context through ordinary Python and preserve its lineage across branches. The trade-off is that an LLM-routed path is less predictable than a fixed transition table. Durability also takes explicit design: an embedded loop does not become resumable just because it uses Session. A hosted agent service may reduce operational work; self-hosting OpenRath gives the team control over deployment and integrations but leaves migrations, recovery, access policy, and review queues in its hands.

The Effect Ledger is not an exactly-once guarantee for external APIs: prefer idempotent operations and plan for manual resolution where outcomes can be ambiguous. The local sandbox runs against the host workspace, so use it only for trusted workloads and evaluate isolation for model-driven tools. BSD-3-Clause permits commercial use with notice and non-endorsement conditions; external providers and optional backends have separate terms.

### Hardware & Deployment Guide
The openrath package supports Python 3.10–3.13 and installs with pip install openrath; code imports from rath. Embedded mode fits a trusted Python process. OpenAI-compatible model calls can use OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_DEFAULT_MODEL, with environment variables taking precedence over ~/.openrath/config.json. Local BM25 recall and session lineage inspection do not require a model API, but a local tool backend does not make model inference offline. No GPU is inherently needed for API-backed orchestration.

For production, use Agent Server and run schema migration as a separate operation. PostgreSQL is the durable source of truth; Redis can accelerate signaling, S3-compatible storage holds artifacts, and OpenTelemetry supports observability. The tree includes docker/ and deploy/, with container and Kubernetes references. Size workers for concurrent sessions and tool processes, and plan storage around retained history and artifacts. v1.3.0 introduced static Workflow.compile() and hardened persistence and configuration; v2.0.0rc1 targeted integration and operator validation, and v2.0.0 added the durable runtime and Agent Server.
```

## Key Capabilities
```text
- Session provenance: Ordered chunks carry token usage and sandbox placement; fork and compatible merge preserve lineage, detach drops parent lineage, and sessions can be exported as JSONL.
- Dynamic composition: Agents and nested Workflows share a Session-to-Session interface; an LLM-backed Selector routes among workflows inside ordinary Python control flow.
- Tool and memory backends: Python tools and stdio MCP adapters use FlowToolCall; tool execution can target the host or optional OpenSandbox, while local memory offers BM25 recall without a model call.
- Durable execution: @step and @router definitions compile into immutable revisions; checkpoints, worker leases, and fencing support recovery and guard against stale commits.
- Side-effect handling: The Effect Ledger records outcomes and idempotency keys; ambiguous non-idempotent effects enter NEEDS_REVIEW, while durable Interrupts support planned approval or input.
- Self-hosted operations: Agent Server supports action grants and tenant/project scoping; PostgreSQL holds durable state, Redis can accelerate signaling, and S3-compatible storage holds artifacts.
```

## Quick Start / Clone
```bash
pip install "openrath[server,postgres]"
openrath-migrate
openrath-migrate --check
```
