Skip to main content

Orkes logo
No abstractions. No black boxes. Just Your Logic

PyPI version License: MIT Docs

Orkes is a Python library for building, coordinating, and observing any complex workflow that can be represented as a graph. While it is well-suited for building LLM-powered agentic systems, its core focus is on providing a flexible and intuitive graph-based framework (inspired by NetworkX) with an emphasis on explicit control flow, transparent logic, and comprehensive traceability.

Getting Started

You can install the latest stable version of the Orkes using pip:

pip install orkes
Here's a simple example of how to build and run a graph with Orkes:
from orkes.graph.core import OrkesGraph
from typing import TypedDict, List

# 1. Define a simpler state
class SearchState(TypedDict):
    user_query: str
    search_queries: List[str]
    current_index: int
    raw_results: List[str]
    is_finished: bool
    final_answer: str

# --- Node 1: Planner (Mocked) ---
def planner_node(state: SearchState):
    """Instead of an LLM, we split the query into mock keywords."""
    print(f"📖 Planning for: {state['user_query']}")
    
    # Simple logic: split words as fake 'queries'
    state['search_queries'] = [f"Search for {word}" for word in state['user_query'].split()[:3]]
    state['current_index'] = 0
    state['raw_results'] = []
    return state

# --- Node 2: Execution (Mocked) ---
def execute_search_node(state: SearchState):
    idx = state['current_index']
    query = state['search_queries'][idx]
    
    print(f"📡 Executing Step {idx + 1}: {query}")
    state['raw_results'].append(f"Result for '{query}'")
    
    state['current_index'] += 1
    state['is_finished'] = state['current_index'] >= len(state['search_queries'])
    return state

# --- Node 3: Synthesis (Mocked) ---
def synthesis_node(state: SearchState):
    """Combines results into a simple string."""
    state['final_answer'] = "Combined Results: " + " | ".join(state['raw_results'])
    print(f"✨ Process Complete: {state['final_answer']}")
    return state

# --- Router Logic ---
def check_loop_condition(state: SearchState):
    return 'complete' if state.get('is_finished') else 'loop'

# --- Build the Graph ---
graph = OrkesGraph(SearchState)

graph.add_node('planner', planner_node)
graph.add_node('search_step', execute_search_node)
graph.add_node('synthesizer', synthesis_node)

graph.add_edge(graph.START, 'planner')
graph.add_edge('planner', 'search_step')

# Conditional Loop
graph.add_conditional_edge(
    'search_step',
    check_loop_condition,
    {
        'loop': 'search_step',   # Go back to search if not finished
        'complete': 'synthesizer' # Go to finish if done
    }
)

graph.add_edge('synthesizer', graph.END)

# --- Execute ---
runner = graph.compile()
initial_state: SearchState = {
    "user_query": "Orkes Conductor vs Temporal",
    "search_queries": [],
    "current_index": 0,
    "raw_results": [],
    "is_finished": False,
    "final_answer": ""
}

runner.run(initial_state)
runner.visualize_trace()
Here is an example how the orkes graph visualization will look like:

example

Core Concepts

At the heart of Orkes is a powerful graph-based architecture inspired by NetworkX. This design allows you to define your workflows as a graph of nodes and edges, where each node is a simple Python function.

  • OrkesGraph: The main canvas for your workflow. It holds the nodes and edges that define your application's logic.
  • Stateful Execution: A shared state object is passed between nodes, allowing for seamless data flow and management throughout the graph's execution.
  • Graph Traceability: Orkes provides a built-in traceability and visualization system. When you run a graph, Orkes can generate a detailed execution trace that can be visualized as an interactive HTML file, making it easy to debug and understand your workflows.

Features

  • Graph-based Architecture: Define complex workflows as a graph of nodes and edges, with support for conditional branching and loops.
  • Traceability and Visualization: Generate interactive traces of your graph executions to visualize the flow of data and control.
  • Pluggable LLM Integrations: A flexible and extensible system for integrating with LLMs, with out-of-the-box support for OpenAI, Anthropic's Claude, and Google's Gemini.
  • Agent and Tool Support: Define custom tools and use them within your graph's nodes to interact with external APIs and services.
  • Familiar Interface: The graph-based interface is inspired by NetworkX, providing a familiar and powerful paradigm for those with experience in graph-based programming.

Sending Traces to Orkes Watcher

Orkes Watcher is a dashboard that shows your runs live and keeps their history. It works with a plain pip install orkes; attach a WatcherSink to your graph and nothing else in your code changes:

from orkes.exporters.watcher import WatcherSink

sink = WatcherSink(api_key="<project ingest key>", base_url="http://localhost:8000")
graph = OrkesGraph(SearchState, name="search", trace_sinks=[sink])

base_url is the watcher backend (port 8000 by default), not the dashboard. Create one sink and reuse it for all your graphs and runs. Sending happens in a background thread, and a watcher that is down or rejects the data never affects your run: at most, a run waits up to 3 seconds at the end for its data to be sent.

State snapshots, prompts and LLM replies are sent as they are. To leave out secrets or personal data, pass redact, a function that receives each event (and each node entry) as a dict and returns what should be sent:

def redact(event):
    if "state_snapshot" in event:
        event = {**event, "state_snapshot": {"redacted": True}}
    return event

sink = WatcherSink(api_key=..., base_url=..., redact=redact)

Any object with on_run_start, on_edge and on_run_end methods can be a trace sink; see orkes.exporters.TraceSink.

Benchmarks

Orkes has been benchmarked against LangGraph on simple graph structures, demonstrating performance advantages. In direct comparisons of graphs with identical nodes and edges, Orkes consistently outperforms LangGraph in both latency and memory utilization.

Key Findings

  • For a simple graph comprising 5 nodes, Orkes exhibits up to a 5x increase in speed and consumes up to 2x less memory compared to LangGraph.
  • When scaled to a 10-node graph, Orkes's performance gap widens, achieving up to 10x faster execution and using up to 3x less memory than LangGraph.

These preliminary results suggest Orkes can offer a more efficient and performant solution for developing and deploying LLM applications, particularly in scenarios involving graph-based workflows.

Results

Example Benchmark Results (values may vary):

Basic Benchmark Results

Basic Benchmark Results

Statebloat Benchmark Results

Statebloat Benchmark Results

To replicate or run the benchmarks, navigate to the tests/benchmarks directory and execute the run_all_benchmarks.py script:

python tests/benchmarks/run_all_benchmarks.py

Roadmap

Feature Description Status
Pilot: Run Control Stop, pause and resume a running graph from Orkes Watcher. orkes checks for commands between nodes, never inside one, and a stopped run ends cleanly with its own status. Planned
Pilot: Human Feedback Let a node ask a person a question from Orkes Watcher (text, optional choices, timeout) and wait for the answer before continuing. Planned
Concurrent Branch Execution Run the branches of a parallel split at the same time, as an opt-in for arun(). Today branches run one after another; for concurrent calls, use asyncio.gather inside a node. Under consideration

Documentation

For more details, visit our Documentation Page.

Contributing

Contributions are welcome! Please see the Contributing Guide for more information.

License

Orkes is licensed under the MIT License.

Metadata

Release files for orkes 0.1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orkes 0.1.4.1
File Size Uploaded Provenance Actions
orkes-0.1.4.1.tar.gz 52.9 kB With provenance Details for orkes-0.1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orkes 0.1.4.1
File Interpreter ABI Platform Actions
orkes-0.1.4.1-py3-none-any.whl Python 3 none any Details for orkes-0.1.4.1-py3-none-any.whl

Total release size: 109.5 kB

Release files / orkes-0.1.4.1.tar.gz

Download URL orkes-0.1.4.1.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
42864da3fc8ede62ba3d738a333e3234aeb3019c441d80b86ee685b682c97d2d
BLAKE2b-256 checksum
How to use checksums
2e0943f4ee74e00b8ddcddf1e09ccf7852a6969bb68506c7000831f846d3a681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Release files / orkes-0.1.4.1-py3-none-any.whl

Download URL orkes-0.1.4.1-py3-none-any.whl
Size 56.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cca8c9489eadd04a32d6e17b5754035c589d10c8431ef6af077a02ac558fd8ba
BLAKE2b-256 checksum
How to use checksums
5d52d7478d6eb36cdcc199bef500a149882e8d818b1e495e5a2cb15dcacd862c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Security for orkes 0.1.4.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for orkes-0.1.4.1.tar.gz

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 Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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