Metadata-Version: 2.4
Name: agentflow-orchestrator
Version: 1.3.0
Summary: A Multi-Agent Framework for AI-Powered Enterprise API Orchestration
Author-email: Venkata Pavan Kumar Gummadi <venkata.p.gummadi@ieee.org>
License: Apache-2.0
Project-URL: Homepage, https://github.com/venkatapgummadi/agentflow
Project-URL: Repository, https://github.com/venkatapgummadi/agentflow
Project-URL: Issues, https://github.com/venkatapgummadi/agentflow/issues
Keywords: ai,agents,api-orchestration,mulesoft,anypoint,multi-agent,resilience,circuit-breaker,dynamic-routing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Provides-Extra: all
Requires-Dist: pydantic>=2.0; extra == "all"
Provides-Extra: mulesoft
Requires-Dist: pyyaml>=6.0; extra == "mulesoft"
Dynamic: license-file

# AgentFlow

### A Multi-Agent Framework for AI-Powered Enterprise API Orchestration

[![CI](https://github.com/venkatapgummadi/agentflow/actions/workflows/ci.yml/badge.svg)](https://github.com/venkatapgummadi/agentflow/actions/workflows/ci.yml)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green.svg)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/agentflow-orchestrator.svg)](https://pypi.org/project/agentflow/)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-261230.svg)](https://github.com/astral-sh/ruff)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)


**AgentFlow** is a production-grade Python framework where autonomous AI agents dynamically orchestrate, compose, and self-heal API workflows across enterprise integration platforms — with first-class MuleSoft Anypoint support.

## The Problem

Modern enterprises run hundreds of APIs across MuleSoft, AWS API Gateway, Azure APIM, and custom services. Composing these APIs into reliable workflows requires:

- **Static orchestration** that breaks when APIs change
- **Manual error handling** per integration point
- **No intelligent routing** based on latency, cost, or capability
- **Zero natural-language accessibility** for non-technical stakeholders

## The Solution

AgentFlow introduces **autonomous AI agents** that understand API capabilities semantically and can:

1. **Parse natural-language intents** into executable API workflows
2. **Dynamically discover and compose** APIs at runtime
3. **Route intelligently** based on latency, cost, rate limits, and capability matching
4. **Self-heal** with circuit breakers, adaptive retries, and fallback chains
5. **Collaborate** via a multi-agent protocol for complex cross-platform orchestrations

## Architecture

```
┌─────────────────────────────────────────────────┐
│                  Intent Layer                     │
│   Natural Language → Structured API Plan          │
├─────────────────────────────────────────────────┤
│              Agent Orchestrator                   │
│   ┌──────────┐ ┌──────────┐ ┌──────────────┐    │
│   │ Planner  │ │ Executor │ │  Validator    │    │
│   │  Agent   │ │  Agent   │ │    Agent      │    │
│   └──────────┘ └──────────┘ └──────────────┘    │
├─────────────────────────────────────────────────┤
│            Dynamic Router                        │
│   Latency │ Cost │ Rate Limit │ Capability       │
├─────────────────────────────────────────────────┤
│           Resilience Layer                       │
│   Circuit Breaker │ Retry │ Fallback │ Bulkhead  │
├─────────────────────────────────────────────────┤
│              Connector Layer                     │
│   MuleSoft │ REST │ GraphQL │ gRPC │ Custom      │
└─────────────────────────────────────────────────┘
```

## Quick Start

```python
from agentflow import AgentOrchestrator, MuleSoftConnector

# Initialize with MuleSoft Anypoint
orchestrator = AgentOrchestrator(
    connectors=[
        MuleSoftConnector(
            anypoint_url="https://anypoint.mulesoft.com",
            org_id="your-org-id",
            environment="production"
        )
    ]
)

# Natural language orchestration
result = await orchestrator.execute(
    "Fetch customer 12345 from CRM, enrich with credit score, "
    "and create a loan application if score > 700"
)

# (Legacy v1.0 typed API still works; v1.1+ users should prefer the
# HybridIntentParser path shown above.)
from agentflow.agents import PlannerAgent, ExecutorAgent

plan = await PlannerAgent().create_plan(
    intent="Sync inventory across all warehouses",
    available_apis=orchestrator.discover_apis()
)
result = await ExecutorAgent().execute_plan(plan)
```

### v1.1 — Hybrid LLM + rule-based intent parsing

```python
from agentflow import (
    AgentOrchestrator, HybridIntentParser, RESTConnector,
)

# Default: rule-based when offline; swap in an LLM provider for richer parsing.
orchestrator = AgentOrchestrator(
    intent_parser=HybridIntentParser(),
    connectors=[RESTConnector(base_url="https://api.example.com")],
)
result = await orchestrator.execute(
    "Fetch customer 42 from CRM and create an order if KYC is valid"
)
```

To plug in a real LLM (zero AgentFlow dependency on vendor SDKs):

```python
from agentflow.nlp import CallableLLMProvider, HybridIntentParser, LLMIntentParser

async def call_openai(req):
    # ... your async OpenAI call returning a JSON string ...
    return json_string

provider = CallableLLMProvider(call_openai, name="openai", model="gpt-4o-mini")
parser   = HybridIntentParser(llm_parser=LLMIntentParser(provider=provider))
```

## Key Features

### Multi-Agent Collaboration
Each orchestration is handled by specialized agents (Planner, Executor, Validator) that communicate through a shared context and can negotiate execution strategies.

### MuleSoft-Native
First-class integration with MuleSoft Anypoint Platform: auto-discovery of APIs from Exchange, RAML/OAS parsing, CloudHub deployment awareness, and runtime policy compliance.

### Intelligent Routing
The Dynamic Router scores candidate APIs on latency (P95), cost-per-call, current rate-limit headroom, and semantic capability match — then selects the optimal endpoint in real time.

### Self-Healing Resilience
Adaptive circuit breakers learn from failure patterns. Retry policies adjust backoff based on error classification. Fallback chains provide graceful degradation.

## Installation

```bash
pip install agentflow-orchestrator-orchestrator
```

## Documentation

See the [docs/](docs/) directory for detailed guides:

- [Architecture Deep Dive](docs/architecture.md)
- [MuleSoft Integration Guide](docs/mulesoft_guide.md)
- [Writing Custom Agents](docs/custom_agents.md)
- [Routing Strategies](docs/routing.md)

## Who's Using AgentFlow?

Are you using AgentFlow at your company or in a project? We'd love to hear from you!

👉 **[Open an Adoption Story issue](../../issues/new?template=adoption-story.md)** — takes 2 minutes and helps the project grow.

| Company / Project | Industry | Use Case |
|---|---|---|
| *Your company here* | *Your industry* | *[Share your story →](../../issues/new?template=adoption-story.md)* |

## Community

| Channel | Purpose |
|---|---|
| [💬 Discussions — Show & Tell](../../discussions/categories/show-and-tell) | Share what you built |
| [❓ Discussions — Q&A](../../discussions/categories/q-a) | Ask questions |
| [🔌 Integration Requests](../../issues/new?template=integration-request.md) | Request a new connector |
| [✨ Feature Requests](../../issues/new?template=feature-request.md) | Suggest improvements |
| [🐛 Bug Reports](../../issues/new?template=bug-report.md) | Report issues |

If AgentFlow saves you time or solves a real problem, a ⭐ on this repo goes a long way — it helps more engineers find the framework.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=venkatapgummadi/agentflow&type=Date)](https://star-history.com/#venkatapgummadi/agentflow&Date)

## Contributing

Pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for the dev workflow, and check the [`good first issue`](../../issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [`help wanted`](../../issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) labels for places to start. By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).

## License

Apache License 2.0 — see [LICENSE](LICENSE) for details.

## Author

**Venkata Pavan Kumar Gummadi**
- Research focus: AI-driven API orchestration and enterprise integration intelligence
- [GitHub](https://github.com/venkatapgummadi)
- [LinkedIn](https://www.linkedin.com/in/venkata-p-1841146/)
- [IEEE](https://ieee.org) Member
