agentflow-orchestrator 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentflow_orchestrator-1.3.0/LICENSE +19 -0
- agentflow_orchestrator-1.3.0/PKG-INFO +225 -0
- agentflow_orchestrator-1.3.0/README.md +190 -0
- agentflow_orchestrator-1.3.0/agentflow/__init__.py +68 -0
- agentflow_orchestrator-1.3.0/agentflow/agents/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/agentflow/agents/base_agent.py +67 -0
- agentflow_orchestrator-1.3.0/agentflow/agents/executor.py +307 -0
- agentflow_orchestrator-1.3.0/agentflow/agents/planner.py +265 -0
- agentflow_orchestrator-1.3.0/agentflow/agents/validator.py +228 -0
- agentflow_orchestrator-1.3.0/agentflow/caching/__init__.py +21 -0
- agentflow_orchestrator-1.3.0/agentflow/caching/backends.py +108 -0
- agentflow_orchestrator-1.3.0/agentflow/caching/response_cache.py +238 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/__init__.py +21 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/aws/__init__.py +5 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/aws/client.py +303 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/azure/__init__.py +5 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/azure/client.py +295 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/base.py +138 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/graphql/__init__.py +5 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/graphql/client.py +256 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/mulesoft/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/mulesoft/client.py +369 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/rest/__init__.py +19 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/rest/auth.py +78 -0
- agentflow_orchestrator-1.3.0/agentflow/connectors/rest/client.py +240 -0
- agentflow_orchestrator-1.3.0/agentflow/core/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/agentflow/core/context.py +187 -0
- agentflow_orchestrator-1.3.0/agentflow/core/cyclic_workflow.py +334 -0
- agentflow_orchestrator-1.3.0/agentflow/core/orchestrator.py +239 -0
- agentflow_orchestrator-1.3.0/agentflow/core/plan.py +218 -0
- agentflow_orchestrator-1.3.0/agentflow/nlp/__init__.py +24 -0
- agentflow_orchestrator-1.3.0/agentflow/nlp/hybrid_intent_parser.py +117 -0
- agentflow_orchestrator-1.3.0/agentflow/nlp/intent_parser.py +391 -0
- agentflow_orchestrator-1.3.0/agentflow/nlp/llm_intent_parser.py +204 -0
- agentflow_orchestrator-1.3.0/agentflow/nlp/llm_provider.py +231 -0
- agentflow_orchestrator-1.3.0/agentflow/observability/__init__.py +17 -0
- agentflow_orchestrator-1.3.0/agentflow/observability/metrics.py +169 -0
- agentflow_orchestrator-1.3.0/agentflow/observability/tracer.py +229 -0
- agentflow_orchestrator-1.3.0/agentflow/resilience/__init__.py +30 -0
- agentflow_orchestrator-1.3.0/agentflow/resilience/bulkhead.py +204 -0
- agentflow_orchestrator-1.3.0/agentflow/resilience/circuit_breaker.py +224 -0
- agentflow_orchestrator-1.3.0/agentflow/resilience/cooldown_strategy.py +228 -0
- agentflow_orchestrator-1.3.0/agentflow/resilience/retry_policy.py +171 -0
- agentflow_orchestrator-1.3.0/agentflow/routing/__init__.py +37 -0
- agentflow_orchestrator-1.3.0/agentflow/routing/adaptive_weight_optimizer.py +335 -0
- agentflow_orchestrator-1.3.0/agentflow/routing/budget_router.py +205 -0
- agentflow_orchestrator-1.3.0/agentflow/routing/dynamic_router.py +289 -0
- agentflow_orchestrator-1.3.0/agentflow/utils/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/agentflow_orchestrator.egg-info/PKG-INFO +225 -0
- agentflow_orchestrator-1.3.0/agentflow_orchestrator.egg-info/SOURCES.txt +59 -0
- agentflow_orchestrator-1.3.0/agentflow_orchestrator.egg-info/dependency_links.txt +1 -0
- agentflow_orchestrator-1.3.0/agentflow_orchestrator.egg-info/requires.txt +14 -0
- agentflow_orchestrator-1.3.0/agentflow_orchestrator.egg-info/top_level.txt +3 -0
- agentflow_orchestrator-1.3.0/benchmarks/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/benchmarks/baseline_comparison.py +305 -0
- agentflow_orchestrator-1.3.0/experiments/__init__.py +1 -0
- agentflow_orchestrator-1.3.0/experiments/intent_corpus.py +252 -0
- agentflow_orchestrator-1.3.0/experiments/parser_quality_benchmark.py +213 -0
- agentflow_orchestrator-1.3.0/experiments/routing_weight_ablation.py +215 -0
- agentflow_orchestrator-1.3.0/pyproject.toml +83 -0
- agentflow_orchestrator-1.3.0/setup.cfg +4 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
Copyright 2024-2026 Venkata Pavan Kumar Gummadi
|
|
8
|
+
|
|
9
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License.
|
|
11
|
+
You may obtain a copy of the License at
|
|
12
|
+
|
|
13
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
|
|
15
|
+
Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
See the License for the specific language governing permissions and
|
|
19
|
+
limitations under the License.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentflow-orchestrator
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: A Multi-Agent Framework for AI-Powered Enterprise API Orchestration
|
|
5
|
+
Author-email: Venkata Pavan Kumar Gummadi <venkata.p.gummadi@ieee.org>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/venkatapgummadi/agentflow
|
|
8
|
+
Project-URL: Repository, https://github.com/venkatapgummadi/agentflow
|
|
9
|
+
Project-URL: Issues, https://github.com/venkatapgummadi/agentflow/issues
|
|
10
|
+
Keywords: ai,agents,api-orchestration,mulesoft,anypoint,multi-agent,resilience,circuit-breaker,dynamic-routing
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
19
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
29
|
+
Requires-Dist: mypy>=1.5; extra == "dev"
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: pydantic>=2.0; extra == "all"
|
|
32
|
+
Provides-Extra: mulesoft
|
|
33
|
+
Requires-Dist: pyyaml>=6.0; extra == "mulesoft"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# AgentFlow
|
|
37
|
+
|
|
38
|
+
### A Multi-Agent Framework for AI-Powered Enterprise API Orchestration
|
|
39
|
+
|
|
40
|
+
[](https://github.com/venkatapgummadi/agentflow/actions/workflows/ci.yml)
|
|
41
|
+
[](https://www.python.org/downloads/)
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](https://pypi.org/project/agentflow/)
|
|
44
|
+
[](https://github.com/astral-sh/ruff)
|
|
45
|
+
[](CONTRIBUTING.md)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
**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.
|
|
49
|
+
|
|
50
|
+
## The Problem
|
|
51
|
+
|
|
52
|
+
Modern enterprises run hundreds of APIs across MuleSoft, AWS API Gateway, Azure APIM, and custom services. Composing these APIs into reliable workflows requires:
|
|
53
|
+
|
|
54
|
+
- **Static orchestration** that breaks when APIs change
|
|
55
|
+
- **Manual error handling** per integration point
|
|
56
|
+
- **No intelligent routing** based on latency, cost, or capability
|
|
57
|
+
- **Zero natural-language accessibility** for non-technical stakeholders
|
|
58
|
+
|
|
59
|
+
## The Solution
|
|
60
|
+
|
|
61
|
+
AgentFlow introduces **autonomous AI agents** that understand API capabilities semantically and can:
|
|
62
|
+
|
|
63
|
+
1. **Parse natural-language intents** into executable API workflows
|
|
64
|
+
2. **Dynamically discover and compose** APIs at runtime
|
|
65
|
+
3. **Route intelligently** based on latency, cost, rate limits, and capability matching
|
|
66
|
+
4. **Self-heal** with circuit breakers, adaptive retries, and fallback chains
|
|
67
|
+
5. **Collaborate** via a multi-agent protocol for complex cross-platform orchestrations
|
|
68
|
+
|
|
69
|
+
## Architecture
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
┌─────────────────────────────────────────────────┐
|
|
73
|
+
│ Intent Layer │
|
|
74
|
+
│ Natural Language → Structured API Plan │
|
|
75
|
+
├─────────────────────────────────────────────────┤
|
|
76
|
+
│ Agent Orchestrator │
|
|
77
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
|
|
78
|
+
│ │ Planner │ │ Executor │ │ Validator │ │
|
|
79
|
+
│ │ Agent │ │ Agent │ │ Agent │ │
|
|
80
|
+
│ └──────────┘ └──────────┘ └──────────────┘ │
|
|
81
|
+
├─────────────────────────────────────────────────┤
|
|
82
|
+
│ Dynamic Router │
|
|
83
|
+
│ Latency │ Cost │ Rate Limit │ Capability │
|
|
84
|
+
├─────────────────────────────────────────────────┤
|
|
85
|
+
│ Resilience Layer │
|
|
86
|
+
│ Circuit Breaker │ Retry │ Fallback │ Bulkhead │
|
|
87
|
+
├─────────────────────────────────────────────────┤
|
|
88
|
+
│ Connector Layer │
|
|
89
|
+
│ MuleSoft │ REST │ GraphQL │ gRPC │ Custom │
|
|
90
|
+
└─────────────────────────────────────────────────┘
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Quick Start
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from agentflow import AgentOrchestrator, MuleSoftConnector
|
|
97
|
+
|
|
98
|
+
# Initialize with MuleSoft Anypoint
|
|
99
|
+
orchestrator = AgentOrchestrator(
|
|
100
|
+
connectors=[
|
|
101
|
+
MuleSoftConnector(
|
|
102
|
+
anypoint_url="https://anypoint.mulesoft.com",
|
|
103
|
+
org_id="your-org-id",
|
|
104
|
+
environment="production"
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Natural language orchestration
|
|
110
|
+
result = await orchestrator.execute(
|
|
111
|
+
"Fetch customer 12345 from CRM, enrich with credit score, "
|
|
112
|
+
"and create a loan application if score > 700"
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# (Legacy v1.0 typed API still works; v1.1+ users should prefer the
|
|
116
|
+
# HybridIntentParser path shown above.)
|
|
117
|
+
from agentflow.agents import PlannerAgent, ExecutorAgent
|
|
118
|
+
|
|
119
|
+
plan = await PlannerAgent().create_plan(
|
|
120
|
+
intent="Sync inventory across all warehouses",
|
|
121
|
+
available_apis=orchestrator.discover_apis()
|
|
122
|
+
)
|
|
123
|
+
result = await ExecutorAgent().execute_plan(plan)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### v1.1 — Hybrid LLM + rule-based intent parsing
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from agentflow import (
|
|
130
|
+
AgentOrchestrator, HybridIntentParser, RESTConnector,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# Default: rule-based when offline; swap in an LLM provider for richer parsing.
|
|
134
|
+
orchestrator = AgentOrchestrator(
|
|
135
|
+
intent_parser=HybridIntentParser(),
|
|
136
|
+
connectors=[RESTConnector(base_url="https://api.example.com")],
|
|
137
|
+
)
|
|
138
|
+
result = await orchestrator.execute(
|
|
139
|
+
"Fetch customer 42 from CRM and create an order if KYC is valid"
|
|
140
|
+
)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To plug in a real LLM (zero AgentFlow dependency on vendor SDKs):
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from agentflow.nlp import CallableLLMProvider, HybridIntentParser, LLMIntentParser
|
|
147
|
+
|
|
148
|
+
async def call_openai(req):
|
|
149
|
+
# ... your async OpenAI call returning a JSON string ...
|
|
150
|
+
return json_string
|
|
151
|
+
|
|
152
|
+
provider = CallableLLMProvider(call_openai, name="openai", model="gpt-4o-mini")
|
|
153
|
+
parser = HybridIntentParser(llm_parser=LLMIntentParser(provider=provider))
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Key Features
|
|
157
|
+
|
|
158
|
+
### Multi-Agent Collaboration
|
|
159
|
+
Each orchestration is handled by specialized agents (Planner, Executor, Validator) that communicate through a shared context and can negotiate execution strategies.
|
|
160
|
+
|
|
161
|
+
### MuleSoft-Native
|
|
162
|
+
First-class integration with MuleSoft Anypoint Platform: auto-discovery of APIs from Exchange, RAML/OAS parsing, CloudHub deployment awareness, and runtime policy compliance.
|
|
163
|
+
|
|
164
|
+
### Intelligent Routing
|
|
165
|
+
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.
|
|
166
|
+
|
|
167
|
+
### Self-Healing Resilience
|
|
168
|
+
Adaptive circuit breakers learn from failure patterns. Retry policies adjust backoff based on error classification. Fallback chains provide graceful degradation.
|
|
169
|
+
|
|
170
|
+
## Installation
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
pip install agentflow-orchestrator-orchestrator
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Documentation
|
|
177
|
+
|
|
178
|
+
See the [docs/](docs/) directory for detailed guides:
|
|
179
|
+
|
|
180
|
+
- [Architecture Deep Dive](docs/architecture.md)
|
|
181
|
+
- [MuleSoft Integration Guide](docs/mulesoft_guide.md)
|
|
182
|
+
- [Writing Custom Agents](docs/custom_agents.md)
|
|
183
|
+
- [Routing Strategies](docs/routing.md)
|
|
184
|
+
|
|
185
|
+
## Who's Using AgentFlow?
|
|
186
|
+
|
|
187
|
+
Are you using AgentFlow at your company or in a project? We'd love to hear from you!
|
|
188
|
+
|
|
189
|
+
👉 **[Open an Adoption Story issue](../../issues/new?template=adoption-story.md)** — takes 2 minutes and helps the project grow.
|
|
190
|
+
|
|
191
|
+
| Company / Project | Industry | Use Case |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| *Your company here* | *Your industry* | *[Share your story →](../../issues/new?template=adoption-story.md)* |
|
|
194
|
+
|
|
195
|
+
## Community
|
|
196
|
+
|
|
197
|
+
| Channel | Purpose |
|
|
198
|
+
|---|---|
|
|
199
|
+
| [💬 Discussions — Show & Tell](../../discussions/categories/show-and-tell) | Share what you built |
|
|
200
|
+
| [❓ Discussions — Q&A](../../discussions/categories/q-a) | Ask questions |
|
|
201
|
+
| [🔌 Integration Requests](../../issues/new?template=integration-request.md) | Request a new connector |
|
|
202
|
+
| [✨ Feature Requests](../../issues/new?template=feature-request.md) | Suggest improvements |
|
|
203
|
+
| [🐛 Bug Reports](../../issues/new?template=bug-report.md) | Report issues |
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
## Star History
|
|
208
|
+
|
|
209
|
+
[](https://star-history.com/#venkatapgummadi/agentflow&Date)
|
|
210
|
+
|
|
211
|
+
## Contributing
|
|
212
|
+
|
|
213
|
+
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).
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
Apache License 2.0 — see [LICENSE](LICENSE) for details.
|
|
218
|
+
|
|
219
|
+
## Author
|
|
220
|
+
|
|
221
|
+
**Venkata Pavan Kumar Gummadi**
|
|
222
|
+
- Research focus: AI-driven API orchestration and enterprise integration intelligence
|
|
223
|
+
- [GitHub](https://github.com/venkatapgummadi)
|
|
224
|
+
- [LinkedIn](https://www.linkedin.com/in/venkata-p-1841146/)
|
|
225
|
+
- [IEEE](https://ieee.org) Member
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# AgentFlow
|
|
2
|
+
|
|
3
|
+
### A Multi-Agent Framework for AI-Powered Enterprise API Orchestration
|
|
4
|
+
|
|
5
|
+
[](https://github.com/venkatapgummadi/agentflow/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://pypi.org/project/agentflow/)
|
|
9
|
+
[](https://github.com/astral-sh/ruff)
|
|
10
|
+
[](CONTRIBUTING.md)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
**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.
|
|
14
|
+
|
|
15
|
+
## The Problem
|
|
16
|
+
|
|
17
|
+
Modern enterprises run hundreds of APIs across MuleSoft, AWS API Gateway, Azure APIM, and custom services. Composing these APIs into reliable workflows requires:
|
|
18
|
+
|
|
19
|
+
- **Static orchestration** that breaks when APIs change
|
|
20
|
+
- **Manual error handling** per integration point
|
|
21
|
+
- **No intelligent routing** based on latency, cost, or capability
|
|
22
|
+
- **Zero natural-language accessibility** for non-technical stakeholders
|
|
23
|
+
|
|
24
|
+
## The Solution
|
|
25
|
+
|
|
26
|
+
AgentFlow introduces **autonomous AI agents** that understand API capabilities semantically and can:
|
|
27
|
+
|
|
28
|
+
1. **Parse natural-language intents** into executable API workflows
|
|
29
|
+
2. **Dynamically discover and compose** APIs at runtime
|
|
30
|
+
3. **Route intelligently** based on latency, cost, rate limits, and capability matching
|
|
31
|
+
4. **Self-heal** with circuit breakers, adaptive retries, and fallback chains
|
|
32
|
+
5. **Collaborate** via a multi-agent protocol for complex cross-platform orchestrations
|
|
33
|
+
|
|
34
|
+
## Architecture
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
┌─────────────────────────────────────────────────┐
|
|
38
|
+
│ Intent Layer │
|
|
39
|
+
│ Natural Language → Structured API Plan │
|
|
40
|
+
├─────────────────────────────────────────────────┤
|
|
41
|
+
│ Agent Orchestrator │
|
|
42
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
|
|
43
|
+
│ │ Planner │ │ Executor │ │ Validator │ │
|
|
44
|
+
│ │ Agent │ │ Agent │ │ Agent │ │
|
|
45
|
+
│ └──────────┘ └──────────┘ └──────────────┘ │
|
|
46
|
+
├─────────────────────────────────────────────────┤
|
|
47
|
+
│ Dynamic Router │
|
|
48
|
+
│ Latency │ Cost │ Rate Limit │ Capability │
|
|
49
|
+
├─────────────────────────────────────────────────┤
|
|
50
|
+
│ Resilience Layer │
|
|
51
|
+
│ Circuit Breaker │ Retry │ Fallback │ Bulkhead │
|
|
52
|
+
├─────────────────────────────────────────────────┤
|
|
53
|
+
│ Connector Layer │
|
|
54
|
+
│ MuleSoft │ REST │ GraphQL │ gRPC │ Custom │
|
|
55
|
+
└─────────────────────────────────────────────────┘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from agentflow import AgentOrchestrator, MuleSoftConnector
|
|
62
|
+
|
|
63
|
+
# Initialize with MuleSoft Anypoint
|
|
64
|
+
orchestrator = AgentOrchestrator(
|
|
65
|
+
connectors=[
|
|
66
|
+
MuleSoftConnector(
|
|
67
|
+
anypoint_url="https://anypoint.mulesoft.com",
|
|
68
|
+
org_id="your-org-id",
|
|
69
|
+
environment="production"
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
# Natural language orchestration
|
|
75
|
+
result = await orchestrator.execute(
|
|
76
|
+
"Fetch customer 12345 from CRM, enrich with credit score, "
|
|
77
|
+
"and create a loan application if score > 700"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# (Legacy v1.0 typed API still works; v1.1+ users should prefer the
|
|
81
|
+
# HybridIntentParser path shown above.)
|
|
82
|
+
from agentflow.agents import PlannerAgent, ExecutorAgent
|
|
83
|
+
|
|
84
|
+
plan = await PlannerAgent().create_plan(
|
|
85
|
+
intent="Sync inventory across all warehouses",
|
|
86
|
+
available_apis=orchestrator.discover_apis()
|
|
87
|
+
)
|
|
88
|
+
result = await ExecutorAgent().execute_plan(plan)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### v1.1 — Hybrid LLM + rule-based intent parsing
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from agentflow import (
|
|
95
|
+
AgentOrchestrator, HybridIntentParser, RESTConnector,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
# Default: rule-based when offline; swap in an LLM provider for richer parsing.
|
|
99
|
+
orchestrator = AgentOrchestrator(
|
|
100
|
+
intent_parser=HybridIntentParser(),
|
|
101
|
+
connectors=[RESTConnector(base_url="https://api.example.com")],
|
|
102
|
+
)
|
|
103
|
+
result = await orchestrator.execute(
|
|
104
|
+
"Fetch customer 42 from CRM and create an order if KYC is valid"
|
|
105
|
+
)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
To plug in a real LLM (zero AgentFlow dependency on vendor SDKs):
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from agentflow.nlp import CallableLLMProvider, HybridIntentParser, LLMIntentParser
|
|
112
|
+
|
|
113
|
+
async def call_openai(req):
|
|
114
|
+
# ... your async OpenAI call returning a JSON string ...
|
|
115
|
+
return json_string
|
|
116
|
+
|
|
117
|
+
provider = CallableLLMProvider(call_openai, name="openai", model="gpt-4o-mini")
|
|
118
|
+
parser = HybridIntentParser(llm_parser=LLMIntentParser(provider=provider))
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Key Features
|
|
122
|
+
|
|
123
|
+
### Multi-Agent Collaboration
|
|
124
|
+
Each orchestration is handled by specialized agents (Planner, Executor, Validator) that communicate through a shared context and can negotiate execution strategies.
|
|
125
|
+
|
|
126
|
+
### MuleSoft-Native
|
|
127
|
+
First-class integration with MuleSoft Anypoint Platform: auto-discovery of APIs from Exchange, RAML/OAS parsing, CloudHub deployment awareness, and runtime policy compliance.
|
|
128
|
+
|
|
129
|
+
### Intelligent Routing
|
|
130
|
+
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.
|
|
131
|
+
|
|
132
|
+
### Self-Healing Resilience
|
|
133
|
+
Adaptive circuit breakers learn from failure patterns. Retry policies adjust backoff based on error classification. Fallback chains provide graceful degradation.
|
|
134
|
+
|
|
135
|
+
## Installation
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install agentflow-orchestrator-orchestrator
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Documentation
|
|
142
|
+
|
|
143
|
+
See the [docs/](docs/) directory for detailed guides:
|
|
144
|
+
|
|
145
|
+
- [Architecture Deep Dive](docs/architecture.md)
|
|
146
|
+
- [MuleSoft Integration Guide](docs/mulesoft_guide.md)
|
|
147
|
+
- [Writing Custom Agents](docs/custom_agents.md)
|
|
148
|
+
- [Routing Strategies](docs/routing.md)
|
|
149
|
+
|
|
150
|
+
## Who's Using AgentFlow?
|
|
151
|
+
|
|
152
|
+
Are you using AgentFlow at your company or in a project? We'd love to hear from you!
|
|
153
|
+
|
|
154
|
+
👉 **[Open an Adoption Story issue](../../issues/new?template=adoption-story.md)** — takes 2 minutes and helps the project grow.
|
|
155
|
+
|
|
156
|
+
| Company / Project | Industry | Use Case |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| *Your company here* | *Your industry* | *[Share your story →](../../issues/new?template=adoption-story.md)* |
|
|
159
|
+
|
|
160
|
+
## Community
|
|
161
|
+
|
|
162
|
+
| Channel | Purpose |
|
|
163
|
+
|---|---|
|
|
164
|
+
| [💬 Discussions — Show & Tell](../../discussions/categories/show-and-tell) | Share what you built |
|
|
165
|
+
| [❓ Discussions — Q&A](../../discussions/categories/q-a) | Ask questions |
|
|
166
|
+
| [🔌 Integration Requests](../../issues/new?template=integration-request.md) | Request a new connector |
|
|
167
|
+
| [✨ Feature Requests](../../issues/new?template=feature-request.md) | Suggest improvements |
|
|
168
|
+
| [🐛 Bug Reports](../../issues/new?template=bug-report.md) | Report issues |
|
|
169
|
+
|
|
170
|
+
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.
|
|
171
|
+
|
|
172
|
+
## Star History
|
|
173
|
+
|
|
174
|
+
[](https://star-history.com/#venkatapgummadi/agentflow&Date)
|
|
175
|
+
|
|
176
|
+
## Contributing
|
|
177
|
+
|
|
178
|
+
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).
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
Apache License 2.0 — see [LICENSE](LICENSE) for details.
|
|
183
|
+
|
|
184
|
+
## Author
|
|
185
|
+
|
|
186
|
+
**Venkata Pavan Kumar Gummadi**
|
|
187
|
+
- Research focus: AI-driven API orchestration and enterprise integration intelligence
|
|
188
|
+
- [GitHub](https://github.com/venkatapgummadi)
|
|
189
|
+
- [LinkedIn](https://www.linkedin.com/in/venkata-p-1841146/)
|
|
190
|
+
- [IEEE](https://ieee.org) Member
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AgentFlow - A Multi-Agent Framework for AI-Powered Enterprise API Orchestration.
|
|
3
|
+
|
|
4
|
+
A production-grade framework where autonomous AI agents dynamically orchestrate,
|
|
5
|
+
compose, and self-heal API workflows across enterprise integration platforms,
|
|
6
|
+
with first-class MuleSoft Anypoint support.
|
|
7
|
+
|
|
8
|
+
Author: Venkata Pavan Kumar Gummadi
|
|
9
|
+
License: Apache 2.0
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__version__ = "1.3.0"
|
|
13
|
+
__author__ = "Venkata Pavan Kumar Gummadi"
|
|
14
|
+
|
|
15
|
+
from agentflow.agents.executor import ExecutorAgent
|
|
16
|
+
from agentflow.agents.planner import PlannerAgent
|
|
17
|
+
from agentflow.agents.validator import ValidatorAgent
|
|
18
|
+
from agentflow.caching.response_cache import ResponseCache
|
|
19
|
+
from agentflow.connectors.base import BaseConnector
|
|
20
|
+
from agentflow.connectors.graphql.client import GraphQLConnector
|
|
21
|
+
from agentflow.connectors.mulesoft.client import MuleSoftConnector
|
|
22
|
+
from agentflow.connectors.rest.client import RESTConnector
|
|
23
|
+
from agentflow.core.context import OrchestrationContext
|
|
24
|
+
from agentflow.core.orchestrator import AgentOrchestrator
|
|
25
|
+
from agentflow.core.plan import ExecutionPlan, PlanStep
|
|
26
|
+
from agentflow.nlp.hybrid_intent_parser import HybridIntentParser
|
|
27
|
+
from agentflow.nlp.intent_parser import IntentParser
|
|
28
|
+
from agentflow.nlp.llm_intent_parser import LLMIntentParser
|
|
29
|
+
from agentflow.nlp.llm_provider import (
|
|
30
|
+
CallableLLMProvider,
|
|
31
|
+
DeterministicMockProvider,
|
|
32
|
+
LLMProvider,
|
|
33
|
+
)
|
|
34
|
+
from agentflow.observability.metrics import MetricsCollector
|
|
35
|
+
from agentflow.observability.tracer import Tracer
|
|
36
|
+
from agentflow.resilience.bulkhead import Bulkhead, BulkheadRegistry
|
|
37
|
+
from agentflow.resilience.circuit_breaker import CircuitBreaker
|
|
38
|
+
from agentflow.routing.budget_router import BudgetMode, BudgetRouter
|
|
39
|
+
from agentflow.routing.dynamic_router import DynamicRouter
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"AgentOrchestrator",
|
|
43
|
+
"OrchestrationContext",
|
|
44
|
+
"ExecutionPlan",
|
|
45
|
+
"PlanStep",
|
|
46
|
+
"MuleSoftConnector",
|
|
47
|
+
"RESTConnector",
|
|
48
|
+
"GraphQLConnector",
|
|
49
|
+
"BaseConnector",
|
|
50
|
+
"PlannerAgent",
|
|
51
|
+
"ExecutorAgent",
|
|
52
|
+
"ValidatorAgent",
|
|
53
|
+
"DynamicRouter",
|
|
54
|
+
"BudgetRouter",
|
|
55
|
+
"BudgetMode",
|
|
56
|
+
"CircuitBreaker",
|
|
57
|
+
"Bulkhead",
|
|
58
|
+
"BulkheadRegistry",
|
|
59
|
+
"ResponseCache",
|
|
60
|
+
"Tracer",
|
|
61
|
+
"MetricsCollector",
|
|
62
|
+
"IntentParser",
|
|
63
|
+
"LLMIntentParser",
|
|
64
|
+
"HybridIntentParser",
|
|
65
|
+
"LLMProvider",
|
|
66
|
+
"DeterministicMockProvider",
|
|
67
|
+
"CallableLLMProvider",
|
|
68
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Autonomous AI agents for API orchestration."""
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Base Agent — abstract foundation for all orchestration agents.
|
|
3
|
+
|
|
4
|
+
Agents are autonomous units that collaborate through the shared
|
|
5
|
+
OrchestrationContext. Each agent has a specific role in the
|
|
6
|
+
orchestration lifecycle and can communicate with other agents
|
|
7
|
+
via context events.
|
|
8
|
+
|
|
9
|
+
Author: Venkata Pavan Kumar Gummadi
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import logging
|
|
15
|
+
import uuid
|
|
16
|
+
from abc import ABC, abstractmethod
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
19
|
+
from agentflow.core.context import EventType, OrchestrationContext
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class BaseAgent(ABC):
|
|
25
|
+
"""
|
|
26
|
+
Abstract base for orchestration agents.
|
|
27
|
+
|
|
28
|
+
Each agent has:
|
|
29
|
+
- A unique identity for audit tracking
|
|
30
|
+
- Access to the shared OrchestrationContext
|
|
31
|
+
- Ability to emit events to the journal
|
|
32
|
+
- A defined role in the orchestration pipeline
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def __init__(
|
|
36
|
+
self,
|
|
37
|
+
agent_id: str | None = None,
|
|
38
|
+
name: str = "BaseAgent",
|
|
39
|
+
config: dict[str, Any] | None = None,
|
|
40
|
+
):
|
|
41
|
+
self.agent_id = agent_id or f"{name.lower()}-{uuid.uuid4().hex[:6]}"
|
|
42
|
+
self.name = name
|
|
43
|
+
self.config = config or {}
|
|
44
|
+
self._logger = logging.getLogger(f"agentflow.agents.{name}")
|
|
45
|
+
|
|
46
|
+
def emit_event(
|
|
47
|
+
self,
|
|
48
|
+
context: OrchestrationContext,
|
|
49
|
+
event_type: EventType,
|
|
50
|
+
message: str = "",
|
|
51
|
+
step_id: str | None = None,
|
|
52
|
+
payload: dict[str, Any] | None = None,
|
|
53
|
+
) -> None:
|
|
54
|
+
"""Record an event in the orchestration journal."""
|
|
55
|
+
context.record_event(
|
|
56
|
+
event_type=event_type,
|
|
57
|
+
agent_id=self.agent_id,
|
|
58
|
+
step_id=step_id,
|
|
59
|
+
payload=payload or {},
|
|
60
|
+
message=message,
|
|
61
|
+
)
|
|
62
|
+
self._logger.debug("[%s] %s: %s", self.agent_id, event_type.value, message)
|
|
63
|
+
|
|
64
|
+
@abstractmethod
|
|
65
|
+
async def execute(self, context: OrchestrationContext, **kwargs: Any) -> Any:
|
|
66
|
+
"""Execute the agent's primary function."""
|
|
67
|
+
...
|