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
Boilerplate Agent Provide a well-structured boilerplate for creating new agents to accelerate the development of agentic systems. Planned
Parallel Graph Execution Enhance the graph runner to support parallel execution of independent branches for improved performance. Implemented
Orkes Watcher Export Stream graph traces to Orkes Watcher, a separate web platform for inspecting runs live and across history. Progressing

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

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
File Size Uploaded Provenance Actions
orkes-0.1.4.tar.gz 52.6 kB With provenance Details for orkes-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 108.9 kB

Release files / orkes-0.1.4.tar.gz

Download URL orkes-0.1.4.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b561f5894c41a7ce0046a4bd4b05aa85e36f86e872c36a2d6f4a97f43288d05f
BLAKE2b-256 checksum
How to use checksums
33efe4e6869984a95c5067dfbd794d647624bbf192423735d09e6fecc9fd2bc4
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 29, 2026.

Transparency log

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

Download URL orkes-0.1.4-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f21f6afd4c60837d4e1bc01cdeb52640a4d7b1a0cdbb06f1fc0ee8568883eeb0
BLAKE2b-256 checksum
How to use checksums
51a09afc254cc21646fa78ddd0518b21ad54637909f8a872bc97738872537805
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 29, 2026.

Transparency log

Security for orkes 0.1.4

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.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 29, 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