Skip to main content

A framework for building composable, observable, and maintainable agent workflows

Project description

Agent Orchestration Library

A framework for building composable, observable, and maintainable agent workflows with Python.

Features

  • ExecutionContext: Dependency injection container for managing shared state and services
  • EventEmitter: Event-driven architecture with pub/sub pattern for notifications
  • AgentBlock: Base class for agent implementations with validation and error handling
  • RetryStrategy: Configurable retry logic with exponential backoff and LLM fallbacks
  • Flow: Multi-agent workflow orchestration with sequential, parallel, and conditional execution

Installation

pip install agent-orchestration-lib

Quick Start

from agent_lib import ExecutionContext, AgentBlock, EventEmitter
from pydantic import BaseModel

# Define your input/output models
class GreetingInput(BaseModel):
    name: str

class GreetingOutput(BaseModel):
    message: str

# Create an agent
class GreetingAgent(AgentBlock[GreetingInput, GreetingOutput]):
    def get_input_model(self):
        return GreetingInput

    def get_output_model(self):
        return GreetingOutput

    async def execute_impl(self, input_data: GreetingInput) -> GreetingOutput:
        return GreetingOutput(message=f"Hello, {input_data.name}!")

# Execute the agent
async def main():
    context = ExecutionContext()
    events = EventEmitter()

    agent = GreetingAgent("greeting", context, events)
    result = await agent.execute(GreetingInput(name="World"))
    print(result.message)  # Output: Hello, World!

Documentation

Full documentation available at: https://agent-orchestration-lib.readthedocs.io

Development

# Clone the repository
git clone https://github.com/yourusername/agent-orchestration-lib.git
cd agent-orchestration-lib

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run type checking
mypy src/agent_lib

# Format code
black src tests
ruff check src tests

Architecture

This library was designed based on patterns extracted from production agent systems. See the architecture documentation for detailed design decisions.

Key design principles:

  • Type Safety: Full Pydantic validation for inputs and outputs
  • Observability: Event emission for all significant operations
  • Composability: Agents can be combined into complex workflows
  • Testability: Each component is independently testable
  • Flexibility: Extensible through dependency injection

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

Project Status

Alpha - API may change. Not recommended for production use yet.

Current version: 0.1.0

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

agent_orchestration_lib-0.1.0.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

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

agent_orchestration_lib-0.1.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file agent_orchestration_lib-0.1.0.tar.gz.

File metadata

  • Download URL: agent_orchestration_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for agent_orchestration_lib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d626ea40d02e253509420151631d677f85e4a903297fd8177a0750e1b8d808bd
MD5 ca270eba315795e3bd2e0b402d71f7c7
BLAKE2b-256 2847d01df22ae8c1598cd6be2b2cdb2b4f1f540296889df66c19731824105154

See more details on using hashes here.

File details

Details for the file agent_orchestration_lib-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_orchestration_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c52cbabf2c74de943fb3fdd01e37b16aa22c86d35a3204c68be967f6ac0420
MD5 2807db44ebfba82522c5a128d8c30e34
BLAKE2b-256 518da96a2002225ea8ba32ecec33364ffa7e1a3e2682c83691ac5f7b4f60aa4d

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