Metadata-Version: 2.4
Name: pygeai-orchestration
Version: 0.1.0b2
Summary: Agentic AI orchestration patterns built on Globant Enterprise AI
Author-email: Globant <geai-sdk@globant.com>
Keywords: geai,pygeai,orchestration,agents,ai,multi-agent,autogen,crewai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygeai>=0.7.0b9
Requires-Dist: pydantic>=2.11.3
Requires-Dist: typing-extensions>=4.13.2
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Requires-Dist: sphinx-markdown-builder; extra == "docs"
Provides-Extra: tests
Requires-Dist: coverage; extra == "tests"
Dynamic: license-file

# PyGEAI-Orchestration - Agentic AI Orchestration Patterns

PyGEAI-Orchestration is a complementary package to [PyGEAI](https://pypi.org/project/pygeai/) that implements agentic AI orchestration patterns built on top of [Globant Enterprise AI](https://wiki.genexus.com/enterprise-ai/wiki?8,Table+of+contents%3AEnterprise+AI). It provides powerful orchestration capabilities similar to AutoGen and CrewAI, designed specifically for the Globant Enterprise AI platform.

> [!WARNING]
> This project is in Alpha stage and it's NOT suitable for production yet.
> While you can install the package and try it out, it's recommended to avoid using it in production until version 1.0.0
> is released

## Features

**Multiple Orchestration Patterns**
- **Reflection Pattern**: Self-critique and iterative improvement
- **Tool Use Pattern**: Function calling and tool integration
- **ReAct Pattern**: Reasoning + Acting loop for complex problem-solving
- **Planning Pattern**: Multi-step planning and execution
- **Multi-Agent Pattern**: Collaborative agent coordination

**Built on PyGEAI**
- Leverages PyGEAI's robust SDK capabilities
- Seamless integration with Globant Enterprise AI
- No code duplication - reuses PyGEAI infrastructure

**Easy to Use**
- Simple CLI tool: `geai-orch`
- Pythonic API for programmatic access
- Rich examples and documentation

## Installation

```bash
pip install pygeai-orchestration
```

**Requirements:**
- Python >= 3.10
- PyGEAI >= 0.7.0b9

## Quick Start

### CLI Usage

```bash
# Run a reflection pattern
geai-orch reflection --agent my-agent --iterations 3

# Execute a ReAct pattern
geai-orch react --agent reasoning-agent --task "Solve complex problem"

# Multi-agent collaboration
geai-orch multi-agent --config agents.yaml
```

### Python API

```python
import asyncio
from pygeai_orchestration import (
    GEAIAgent,
    AgentConfig,
    ReflectionPattern
)

async def main():
    # Create an agent
    config = AgentConfig(
        name="my-agent",
        model="gpt-4",
        temperature=0.7
    )
    agent = GEAIAgent(config)
    
    # Create and execute pattern
    pattern = ReflectionPattern(agent=agent)
    result = await pattern.execute("Improve this text: Hello world")
    
    print(f"Success: {result.success}")
    print(f"Result: {result.result}")
    print(f"Iterations: {result.iterations}")

asyncio.run(main())
```

## Configuration

PyGEAI-Orchestration uses the same configuration as PyGEAI. Set up your credentials using one of these methods:

**Environment Variables:**
```bash
export GEAI_API_KEY=<your-api-key>
export GEAI_API_BASE_URL=<base-url>
```

**Credentials File:**
Create `$USER_HOME/.geai/credentials`:
```ini
[default]
geai_api_key = <API_TOKEN>
geai_api_base_url = <GEAI_BASE_URL>
```

See [PyGEAI Configuration](https://github.com/genexus-books/pygeai#configuration) for more details.

## Orchestration Patterns

### 1. Reflection Pattern
Enables agents to self-critique and iteratively improve their outputs.

```python
from pygeai_orchestration.patterns.reflection import ReflectionAgent

agent = ReflectionAgent(session=session, agent_id="critic-agent")
result = agent.reflect_and_improve("Initial output", iterations=3)
```

**Use Cases:**
- Content quality improvement
- Code review and refinement
- Self-correcting responses

### 2. Tool Use Pattern
Integrates function calling and tool execution into agent workflows.

```python
from pygeai_orchestration.patterns.tool_use import ToolUseAgent

agent = ToolUseAgent(session=session)
agent.register_tool("search", search_function)
result = agent.execute("Search for information about AI")
```

**Use Cases:**
- API integration
- External data retrieval
- Action execution

### 3. ReAct Pattern
Implements the Reasoning + Acting loop for step-by-step problem solving.

```python
from pygeai_orchestration.patterns.react import ReActAgent

agent = ReActAgent(session=session, agent_id="reasoning-agent")
result = agent.solve("Complex multi-step problem")
```

**Use Cases:**
- Complex problem solving
- Research tasks
- Multi-step workflows

### 4. Planning Pattern
Creates and executes multi-step plans with adaptive execution.

```python
from pygeai_orchestration.patterns.planning import PlanningAgent

agent = PlanningAgent(session=session, planner_id="planner")
plan = agent.create_plan("Build a web application")
result = agent.execute_plan(plan)
```

**Use Cases:**
- Project planning
- Task decomposition
- Workflow automation

### 5. Multi-Agent Pattern
Coordinates multiple agents working collaboratively on complex tasks.

```python
from pygeai_orchestration.patterns.multi_agent import MultiAgentCoordinator

coordinator = MultiAgentCoordinator(session=session)
coordinator.add_agent("researcher", researcher_agent)
coordinator.add_agent("writer", writer_agent)
result = coordinator.execute("Create research report")
```

**Use Cases:**
- Team collaboration simulation
- Complex task delegation
- Specialized agent workflows

## Documentation

- [Getting Started Guide](docs/getting-started.md)
- [Pattern Documentation](docs/patterns/)
- [API Reference](docs/api-reference/)
- [Examples](snippets/)

## Development

### Setup Development Environment

```bash
git clone https://github.com/genexus-books/pygeai-orchestration.git
cd pygeai-orchestration
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
```

### Running Tests

```bash
# Run all tests
python testing.py

# Run specific pattern tests
python -m unittest pygeai_orchestration.tests.patterns.test_reflection

# Check coverage
python testing.py --coverage
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.

## Examples

Check the [snippets/](snippets/) directory for working examples of each pattern:

- [Reflection Pattern Example](snippets/reflection/basic_reflection.py)
- [Tool Use Pattern Example](snippets/tool_use/function_calling.py)
- [ReAct Pattern Example](snippets/react/simple_react_loop.py)
- [Planning Pattern Example](snippets/planning/multi_step_plan.py)
- [Multi-Agent Pattern Example](snippets/multi_agent/collaborative_agents.py)

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

This project is licensed under the MIT License - see [LICENSE](LICENSE) for details.

## Terms and Conditions

By using this SDK, you agree to the [Globant Enterprise AI Terms of Use](https://www.globant.com/enterprise-ai/terms-of-use).

## Support

- [Documentation](docs/)
- [Issue Tracker](https://github.com/genexus-books/pygeai-orchestration/issues)
- [Discussions](https://github.com/genexus-books/pygeai-orchestration/discussions)

## Related Projects

- [PyGEAI](https://github.com/genexus-books/pygeai) - Core SDK for Globant Enterprise AI
- [AutoGen](https://github.com/microsoft/autogen) - Multi-agent framework by Microsoft
- [CrewAI](https://github.com/joaomdmoura/crewAI) - Framework for orchestrating AI agents

## Compatibility

This package is compatible with Globant Enterprise AI release from February 2026 and requires PyGEAI >= 0.7.0b9.

---

**Made by Globant**
