Skip to main content

Control plane for AI agents

Project description

๐Ÿ”ฅ OpenAgentOrchestrator (OAO)

The Control Plane for AI Agents.

OpenAgentOrchestrator (OAO) is an infrastructure-grade orchestration engine designed to bring governance, determinism, and observability to AI agents.

License: MIT Python Build Enterprise Hardened

While most agent frameworks focus on building agents, OAO focuses on controlling them.

OAO acts as a control plane on top of existing AI frameworks, enabling safe, measurable, and scalable execution of AI agents.


๐Ÿ›ก๏ธ Fault Tolerance & Persistence

๐Ÿ’“ Robust Distributed Scheduler

  • Crash Recovery: Automatically detects dead workers and re-queues their jobs.
  • Heartbeats: Workers report liveness to prevent silent failures.
  • Safe Claiming: Uses RPOPLPUSH to ensure zero job loss during assignment.
  • Retries: Configurable exponential backoff for transient failures.

๐Ÿ’พ Durable DAG Execution

  • State Persistence: Persists every task's result to Redis.
  • Resume-on-Failure: Crashed workflows can be resumed; completed tasks are skipped.
  • Auditable History: Full execution trace stored in persistent storage.

๐Ÿš€ Why OAO?

Modern AI agent frameworks lack:

  • โŒ Deterministic lifecycle control
  • โŒ Strict policy enforcement
  • โŒ Tool-level governance
  • โŒ Execution observability
  • โŒ Parallel scheduling control
  • โŒ Infrastructure-grade architecture

OAO solves this.


๐Ÿง  Core Philosophy

OAO separates:

Agent Intelligence  โ‰   Agent Governance

Frameworks build intelligence.
OAO governs execution.

Think of OAO as:

Kubernetes for AI Agents.


โœจ Features

๐Ÿงญ Deterministic Lifecycle Engine

Strict execution flow:

INIT โ†’ PLAN โ†’ EXECUTE โ†’ REVIEW โ†’ TERMINATE

No uncontrolled recursion.
No hidden state transitions.


๐Ÿ” Policy Enforcement

Built-in StrictPolicy enforces:

  • Maximum execution steps
  • Maximum token usage
  • Maximum tool calls
  • Execution timeouts

Agents cannot bypass governance rules.


๐Ÿ”Œ Adapter Architecture

Pluggable adapter system allows integration with external frameworks.

Currently supported:

  • LangChain Adapter

Future roadmap:

  • CrewAI
  • AutoGen
  • LlamaIndex
  • Enterprise custom adapters

Adapters are fully decoupled from orchestration core.


๐Ÿ”„ Async Execution Engine

Supports both:

  • Synchronous execution (run)
  • Asynchronous execution (run_async)

Ready for scalable, high-throughput workloads.


๐Ÿ‘ฅ Multi-Agent Orchestration

Run multiple agents under centralized governance:

  • Independent lifecycle control
  • Independent execution reports
  • Controlled scheduling layer

โšก Parallel Agent Scheduler

Built-in concurrency management:

  • Configurable max concurrency
  • Async worker pool
  • Safe task isolation
  • Error containment

๐ŸŒ FastAPI Server (OAO as Service)

Expose OAO as an HTTP backend:

  • Single-agent endpoint
  • Multi-agent endpoint
  • Swagger documentation
  • Production-ready API layer

๐Ÿ“Š Structured Execution Reports

Every execution generates:

  • Unique execution ID
  • Agent name
  • Status (SUCCESS / FAILED)
  • Total steps
  • Token usage
  • Tool usage
  • Execution time
  • State history
  • Final output

Designed for observability and monitoring.


๐ŸŽ› Event Hook System

OAO emits structured lifecycle events:

  • STATE_ENTER
  • TOOL_CALL
  • POLICY_VIOLATION
  • EXECUTION_COMPLETE

Hooks enable:

  • Logging
  • Metrics
  • Monitoring
  • External integrations

๐Ÿ“ฆ Installation

Install from PyPI:

pip install open-agent-orchestrator

Optional Dependencies

For running the API server or using LangChain adapters:

# Install with API server and LangChain support
pip install "open-agent-orchestrator[server,langchain]"

Or install locally:

pip install -e ".[all]"

โšก Quick Start (Single Agent)

from oao import Orchestrator, StrictPolicy

class DummyAgent:
    def invoke(self, task):
        return {"output": f"Processed: {task}"}

policy = StrictPolicy(max_steps=5)

orch = Orchestrator(policy=policy)

report = orch.run(
    agent=DummyAgent(),
    task="Explain AI orchestration",
)

print(report.json(indent=2))

โšก Async Execution

import asyncio
from oao import Orchestrator

class DummyAgent:
    def invoke(self, task):
        return {"output": f"Processed: {task}"}

async def main():
    orch = Orchestrator()
    report = await orch.run_async(
        agent=DummyAgent(),
        task="Async execution demo"
    )
    print(report.json(indent=2))

asyncio.run(main())

๐Ÿ‘ฅ Multi-Agent Example

import asyncio
from oao.runtime.multi_agent import MultiAgentOrchestrator

class DummyAgent:
    def __init__(self, name):
        self.name = name

    def invoke(self, task):
        return {"output": f"{self.name} processed: {task}"}

agents = {
    "researcher": DummyAgent("Researcher"),
    "critic": DummyAgent("Critic"),
}

async def main():
    multi = MultiAgentOrchestrator(max_concurrency=2)

    results = await multi.run_multi_async(
        agents=agents,
        task="Discuss AI governance"
    )

    for name, report in results.items():
        print(name, report.status)

asyncio.run(main())

๐Ÿ•ธ๏ธ DAG Orchestration

Execute complex workflows with dependencies and automatic parallelism.

from oao.runtime.dag import TaskGraph, GraphExecutor, TaskNode

# Define graph
graph = TaskGraph()
graph.add_node(TaskNode("research", agent_researcher, "Research topic X"))
graph.add_node(TaskNode("draft", agent_writer, "Draft article", dependencies={"research"}))
graph.add_node(TaskNode("critique", agent_critic, "Critique draft", dependencies={"research"}))
graph.add_node(TaskNode("polisher", agent_polisher, "Improve draft", dependencies={"critique", "draft"}))

# Execute
executor = GraphExecutor(graph)
results = executor.execute("Write a blog post about AI")

Features:

  • Topological Sorting: Ensures corect execution order.
  • Cycle Detection: Prevents infinite loops.
  • Parallel Execution: Independent branches run concurrently.
  • Context Passing: Results flow from dependencies to dependents.

๐ŸŒ Run as API Service

Start server:

# Ensure server dependencies are installed
pip install "open-agent-orchestrator[server]"

uvicorn oao.server:app --reload

Open:

http://127.0.0.1:8000/docs

Available endpoints:

  • POST /run
  • POST /run-multi

๐Ÿ“Š Observability (Metrics & Tracing)

OAO provides deep visibility into your agent fleets.

Prometheus Metrics

Exposed at /metrics:

  • oao_executions_total: Execution counter (status, agent_type)
  • oao_execution_duration_seconds: Histogram of execution time
  • oao_active_agents: Gauge of concurrent agents
  • oao_token_usage_total: Token consumption counter
  • oao_queue_size: Distributed queue depth

OpenTelemetry Tracing

Full distributed tracing for workflows:

  • Root Spans: orchestrator.run, dag.execute
  • Child Spans: agent.step, tool.execute, dag.schedule_task
  • Context Propagation: Trace IDs flow across async tasks and Redis queues.

๐Ÿ”Œ Enterprise Plugin System

Extend OAO without modifying core code. Built on a Secure Plugin Interface.

1. Create a Plugin (my_plugin.py)

Plugins must implement PluginInterface:

from oao.plugins.base import PluginInterface
from oao.policy.registry import PolicyRegistry

class MyPlugin(PluginInterface):
    @property
    def name(self): return "my_security_plugin"
    
    @property
    def version(self): return "1.0.0"

    def activate(self):
        # Register custom components safely
        PolicyRegistry.register("custom_policy", MyCustomPolicy)
        
    def deactivate(self):
        pass

2. Load the Plugin

from oao.plugins.loader import PluginLoader

# Verifies signature and version before loading
PluginLoader.load("path/to/my_plugin.py")

Supports custom:

  • Policies (Governance)
  • Schedulers (Execution strategy)
  • Event Listeners (Logging/Tracing)
  • Adapters (Framework support)

๐Ÿ— Architecture Overview

Client / CLI / Dashboard
            โ†“
        FastAPI Server
            โ†“
     OAO Orchestrator Core
            โ†“
   Adapter โ†’ External Framework

Core Components:

  • Lifecycle State Machine
  • Policy Engine
  • Adapter Registry
  • Tool Interception Layer
  • Event Bus
  • Execution Report Generator
  • Parallel Scheduler
  • Multi-Agent Coordinator

๐Ÿ”’ Governance Model

OAO enforces:

  • Deterministic state transitions
  • Token budgeting
  • Tool access limits
  • Execution boundaries
  • Timeout enforcement

Agents cannot override governance rules.


๐Ÿงช Project Structure

oao/
 โ”œโ”€โ”€ runtime/
 โ”œโ”€โ”€ adapters/
 โ”œโ”€โ”€ policy/
 โ”œโ”€โ”€ protocol/
 โ”œโ”€โ”€ server.py
 โ”œโ”€โ”€ cli.py

๐Ÿ“ˆ Roadmap

  • Deterministic lifecycle engine
  • Strict policy enforcement
  • Adapter abstraction
  • Async execution engine
  • Multi-agent orchestration
  • Parallel scheduler
  • FastAPI service
  • Web dashboard
  • Distributed scheduler (Redis)
  • DAG-based orchestration
  • Metrics exporter
  • Enterprise plugin ecosystem

๐Ÿค Contributing

Contributions are welcome.

Guidelines:

  • Maintain clean architecture principles
  • Keep lifecycle deterministic
  • Preserve adapter abstraction
  • Add tests for new modules

๐Ÿ“œ License

MIT License


๐Ÿง  Vision

OAO aims to become:

The Infrastructure Layer for AI Agents.

As AI agents become more autonomous, governance becomes essential.

OAO ensures agents remain:

  • Observable
  • Measurable
  • Controllable
  • Scalable
  • Safe

โญ Support

If you find OAO useful:

  • Star the repository
  • Contribute adapters
  • Build plugins
  • Share with the AI community

Letโ€™s define the control plane for AI systems.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_agent_orchestrator-1.0.0.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_agent_orchestrator-1.0.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file open_agent_orchestrator-1.0.0.tar.gz.

File metadata

  • Download URL: open_agent_orchestrator-1.0.0.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for open_agent_orchestrator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c2c25c442e2e97bd7f2e00a890bdb2566ee19bb49d0ee677e541bb30df6abc03
MD5 8eb2ff83ea014780a64f5aec3917a25b
BLAKE2b-256 371fab36bd16600a4b24f11ccc1da044b5511c807c7c980e1eb7cff01de08c2a

See more details on using hashes here.

File details

Details for the file open_agent_orchestrator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_agent_orchestrator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f076b9b093ad43ad0ac86da794f55fdb8a8631f69010daeb34aa4713a2060a1b
MD5 edb21549b1d6a890b8a525add62ef6bc
BLAKE2b-256 9daafebf1cecf70f134413c25acb0b9413b2f61382d8264bdb8099a318bfa0c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page