Rath-Team/OpenRath

An open-source, PyTorch-like runtime for dynamic multi-agent and multi-session workflows.

1,097 ★54 forksPythonUpdated 7d ago

What you need to know

A PyTorch-like multi-agent and multi-session Python framework where Session is the central runtime value (carrying state, sandbox placement, lineage); not itself an MCP server, but stdio MCP tools can be adapted into the loop as FlowToolCall instances.

Install

pip install openrath
pip install "openrath[opensandbox]"  (optional sandbox backend)
pip install "openrath[openviking]"  (optional memory backend)
pip install "openrath[server,postgres]" && openrath-migrate  (production profile)

Usage

  • Build a flow.Agent with a prompt, provider, tools, and memory; call it on a Session (e.g. Session.from_user_message(...).to("local", spec="./")).
  • Compose flow.Workflow.forward(session) -> session; use flow.Selector for LLM-backed runtime routing between self-describing workflows.
  • Wrap stdio MCP tools into the loop as normal FlowToolCall instances (see example/06_mcp_tool.py).
  • Export OPENAI_API_KEY / OPENAI_BASE_URL / OPENAI_DEFAULT_MODEL, or configure providers in ~/.openrath/config.json.

Key features

  • Session-first design: structured chunk table with forking, detach, merge, and JSONL export; session lineage gives graph-shaped provenance for large agent clusters.
  • Sandbox as a backend: local (host workspace) or optional containerized OpenSandbox execution placement.
  • Memory as a backend: zero-dependency local memory (BM25 recall, optional embeddings) or OpenViking, with remember_memory / recall_memory / commit_memory.
  • v2.0.0 production runtime: durable execution over PostgreSQL/Redis/S3 with @step/@router boundaries, effect ledger, durable interrupts, and Agent Server mode with token grants.

Best for

Python teams building multi-agent, multi-session applications that need durable, traceable, sandboxed execution and persistent memory in one framework.

Caveats

  • Agent Server HTTP surface remains Beta; v1 JSONL imports are historical records, not resumable active Runs.
  • Synchronous steps cannot declare a preemptive timeout (use an async step or isolated executor).
  • Most example scripts need an LLM API key.
Platforms: macOS · Linux · Windows
Documentation ↗

Reviewed 2026-08-07

Topics

agent-frameworkagentic-aiai-agentsanthropiclllm-agentllmmemorymodel-context-protocolmulti-agentmulti-agent-systemsopen-sourceopenaiprovenancepythonruntime-statesandboxsession-graphsession-stateworkflow-orchestration
View on GitHub ↗
Stars
1,097★
Forks
54
Language
Python
License
BSD-3-Clause
Created
2026-05-04
Last push
2026-07-31