kailash 0.8.1__py3-none-any.whl → 0.8.3__py3-none-any.whl
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.
- kailash/__init__.py +1 -1
- kailash/middleware/database/base_models.py +7 -1
- kailash/nodes/code/python.py +1 -0
- kailash/runtime/local.py +66 -0
- kailash/runtime/secret_provider.py +293 -0
- kailash/workflow/builder.py +88 -9
- kailash-0.8.3.dist-info/METADATA +532 -0
- {kailash-0.8.1.dist-info → kailash-0.8.3.dist-info}/RECORD +12 -11
- kailash-0.8.1.dist-info/METADATA +0 -745
- {kailash-0.8.1.dist-info → kailash-0.8.3.dist-info}/WHEEL +0 -0
- {kailash-0.8.1.dist-info → kailash-0.8.3.dist-info}/entry_points.txt +0 -0
- {kailash-0.8.1.dist-info → kailash-0.8.3.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.8.1.dist-info → kailash-0.8.3.dist-info}/top_level.txt +0 -0
kailash-0.8.1.dist-info/METADATA
DELETED
@@ -1,745 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: kailash
|
3
|
-
Version: 0.8.1
|
4
|
-
Summary: Python SDK for the Kailash container-node architecture
|
5
|
-
Home-page: https://github.com/integrum/kailash-python-sdk
|
6
|
-
Author: Integrum
|
7
|
-
Author-email: Integrum <info@integrum.com>
|
8
|
-
Project-URL: Homepage, https://github.com/integrum/kailash-python-sdk
|
9
|
-
Project-URL: Bug Tracker, https://github.com/integrum/kailash-python-sdk/issues
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
11
|
-
Classifier: Intended Audience :: Developers
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
15
|
-
Requires-Python: >=3.11
|
16
|
-
Description-Content-Type: text/markdown
|
17
|
-
License-File: LICENSE
|
18
|
-
Requires-Dist: networkx>=2.7
|
19
|
-
Requires-Dist: pydantic>=1.9
|
20
|
-
Requires-Dist: matplotlib>=3.5
|
21
|
-
Requires-Dist: pyyaml>=6.0
|
22
|
-
Requires-Dist: click>=8.0
|
23
|
-
Requires-Dist: pytest>=8.3.5
|
24
|
-
Requires-Dist: mcp[cli]==1.11.0
|
25
|
-
Requires-Dist: pandas>=2.2.3
|
26
|
-
Requires-Dist: numpy>=2.2.5
|
27
|
-
Requires-Dist: scipy>=1.15.3
|
28
|
-
Requires-Dist: scikit-learn>=1.6.1
|
29
|
-
Requires-Dist: requests>=2.32.3
|
30
|
-
Requires-Dist: pytest-cov>=6.1.1
|
31
|
-
Requires-Dist: isort>=6.0.1
|
32
|
-
Requires-Dist: aiohttp>=3.12.4
|
33
|
-
Requires-Dist: aiohttp-cors>=0.7.0
|
34
|
-
Requires-Dist: ruff>=0.11.12
|
35
|
-
Requires-Dist: msal>=1.32.3
|
36
|
-
Requires-Dist: sphinx>=8.2.3
|
37
|
-
Requires-Dist: sphinx-rtd-theme>=3.0.2
|
38
|
-
Requires-Dist: sphinx-copybutton>=0.5.2
|
39
|
-
Requires-Dist: sphinxcontrib-mermaid>=1.0.0
|
40
|
-
Requires-Dist: sphinx-autobuild>=2024.10.3
|
41
|
-
Requires-Dist: autodoc>=0.5.0
|
42
|
-
Requires-Dist: myst-parser>=4.0.1
|
43
|
-
Requires-Dist: black>=25.1.0
|
44
|
-
Requires-Dist: psutil>=7.0.0
|
45
|
-
Requires-Dist: fastapi>=0.115.12
|
46
|
-
Requires-Dist: uvicorn[standard]>=0.31.0
|
47
|
-
Requires-Dist: pytest-asyncio>=1.0.0
|
48
|
-
Requires-Dist: pre-commit>=4.2.0
|
49
|
-
Requires-Dist: twine>=6.1.0
|
50
|
-
Requires-Dist: ollama>=0.5.1
|
51
|
-
Requires-Dist: sqlalchemy>=2.0.0
|
52
|
-
Requires-Dist: psycopg2-binary>=2.9.0
|
53
|
-
Requires-Dist: pymysql>=1.1.0
|
54
|
-
Requires-Dist: aiosqlite>=0.19.0
|
55
|
-
Requires-Dist: websockets>=12.0
|
56
|
-
Requires-Dist: httpx>=0.25.0
|
57
|
-
Requires-Dist: python-jose>=3.5.0
|
58
|
-
Requires-Dist: pytest-xdist>=3.6.0
|
59
|
-
Requires-Dist: pytest-timeout>=2.3.0
|
60
|
-
Requires-Dist: pytest-split>=0.9.0
|
61
|
-
Requires-Dist: pytest-forked>=1.6.0
|
62
|
-
Requires-Dist: asyncpg>=0.30.0
|
63
|
-
Requires-Dist: aiomysql>=0.2.0
|
64
|
-
Requires-Dist: twilio>=9.6.3
|
65
|
-
Requires-Dist: qrcode>=8.2
|
66
|
-
Requires-Dist: aiofiles>=24.1.0
|
67
|
-
Requires-Dist: bcrypt>=4.3.0
|
68
|
-
Requires-Dist: plotly>=6.2.0
|
69
|
-
Requires-Dist: redis[asyncio]>=6.2.0
|
70
|
-
Requires-Dist: faker>=37.4.0
|
71
|
-
Requires-Dist: structlog>=25.4.0
|
72
|
-
Requires-Dist: authlib>=1.6.0
|
73
|
-
Requires-Dist: slowapi>=0.1.9
|
74
|
-
Requires-Dist: limits>=5.4.0
|
75
|
-
Requires-Dist: prometheus-client>=0.22.1
|
76
|
-
Requires-Dist: opentelemetry-api>=1.34.1
|
77
|
-
Requires-Dist: opentelemetry-sdk>=1.34.1
|
78
|
-
Requires-Dist: passlib>=1.7.4
|
79
|
-
Requires-Dist: pyotp>=2.9.0
|
80
|
-
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.55b1
|
81
|
-
Requires-Dist: seaborn>=0.13.2
|
82
|
-
Requires-Dist: sqlparse>=0.5.3
|
83
|
-
Provides-Extra: dev
|
84
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
85
|
-
Requires-Dist: pytest-cov>=3.0; extra == "dev"
|
86
|
-
Requires-Dist: black>=22.0; extra == "dev"
|
87
|
-
Requires-Dist: isort>=5.10; extra == "dev"
|
88
|
-
Requires-Dist: mypy>=0.9; extra == "dev"
|
89
|
-
Dynamic: author
|
90
|
-
Dynamic: home-page
|
91
|
-
Dynamic: license-file
|
92
|
-
Dynamic: requires-python
|
93
|
-
|
94
|
-
# Kailash Python SDK
|
95
|
-
|
96
|
-
<p align="center">
|
97
|
-
<a href="https://pypi.org/project/kailash/"><img src="https://img.shields.io/pypi/v/kailash.svg" alt="PyPI version"></a>
|
98
|
-
<a href="https://pypi.org/project/kailash/"><img src="https://img.shields.io/pypi/pyversions/kailash.svg" alt="Python versions"></a>
|
99
|
-
<a href="https://pepy.tech/project/kailash"><img src="https://static.pepy.tech/badge/kailash" alt="Downloads"></a>
|
100
|
-
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License">
|
101
|
-
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black">
|
102
|
-
<img src="https://img.shields.io/badge/tests-production%20quality-brightgreen.svg" alt="Tests: Production Quality">
|
103
|
-
<img src="https://img.shields.io/badge/docker-integrated-blue.svg" alt="Docker: Integrated">
|
104
|
-
<img src="https://img.shields.io/badge/AI-ollama%20validated-purple.svg" alt="AI: Ollama Validated">
|
105
|
-
</p>
|
106
|
-
|
107
|
-
<p align="center">
|
108
|
-
<strong>A Pythonic SDK for the Kailash container-node architecture</strong>
|
109
|
-
</p>
|
110
|
-
|
111
|
-
<p align="center">
|
112
|
-
Build workflows that seamlessly integrate with Kailash's production environment while maintaining the flexibility to prototype quickly and iterate locally.
|
113
|
-
</p>
|
114
|
-
|
115
|
-
---
|
116
|
-
|
117
|
-
## 🔥 Latest Release: v0.6.3 (July 5, 2025)
|
118
|
-
|
119
|
-
**Comprehensive MCP Platform & Documentation Improvements**
|
120
|
-
|
121
|
-
- 🚀 **MCP Testing**: 407 tests with 100% pass rate across 8 MCP components
|
122
|
-
- 📚 **Documentation**: Fixed 200+ code examples, all now execute correctly
|
123
|
-
- 🏢 **Enterprise**: Complete MCP platform integration with production workflows
|
124
|
-
- 🔧 **Platform**: Resolved namespace collision (kailash.mcp → kailash.mcp_server)
|
125
|
-
|
126
|
-
[Full Changelog](changelogs/releases/v0.6.3-2025-07-05.md) | [Previous Release](changelogs/releases/v0.6.1-2025-01-26.md)
|
127
|
-
|
128
|
-
## ✨ Highlights
|
129
|
-
|
130
|
-
- 🚀 **Rapid Prototyping**: Create and test workflows locally without containerization
|
131
|
-
- 🏗️ **Architecture-Aligned**: Automatically ensures compliance with Kailash standards
|
132
|
-
- 🔄 **Seamless Handoff**: Export prototypes directly to production-ready formats
|
133
|
-
- 📊 **Real-time Monitoring**: Live dashboards with WebSocket streaming and performance metrics
|
134
|
-
- 🧩 **Extensible**: Easy to create custom nodes for domain-specific operations
|
135
|
-
- ⚡ **Fast Installation**: Uses `uv` for lightning-fast Python package management
|
136
|
-
- 🤖 **AI-Powered**: Complete LLM agents, embeddings, and hierarchical RAG architecture
|
137
|
-
- 🧠 **Retrieval-Augmented Generation**: Full RAG pipeline with intelligent document processing
|
138
|
-
- 🌐 **REST API Wrapper**: Expose any workflow as a production-ready API in 3 lines
|
139
|
-
- 🚪 **Multi-Workflow Gateway**: Manage multiple workflows through unified API with MCP integration
|
140
|
-
- 🤖 **Self-Organizing Agents**: Autonomous agent pools with intelligent team formation and convergence detection
|
141
|
-
- 🧠 **Agent-to-Agent Communication**: Shared memory pools and intelligent caching for coordinated multi-agent systems
|
142
|
-
- 🔒 **Production Security**: Comprehensive security framework with path traversal prevention, code sandboxing, and audit logging
|
143
|
-
- 🛡️ **Admin Tool Framework**: Complete enterprise admin infrastructure with React UI, RBAC, audit logging, and LLM-based QA testing
|
144
|
-
- 🎨 **Visual Workflow Builder**: Kailash Workflow Studio - drag-and-drop interface for creating and managing workflows (coming soon)
|
145
|
-
- 🔁 **Cyclic Workflows (v0.2.0)**: Universal Hybrid Cyclic Graph Architecture with 30,000+ iterations/second performance
|
146
|
-
- 🛠️ **Developer Tools**: CycleAnalyzer, CycleDebugger, CycleProfiler for production-ready cyclic workflows
|
147
|
-
- 📈 **High Performance**: Optimized execution engine supporting 100,000+ iteration workflows
|
148
|
-
- 📁 **Complete Finance Workflow Library (v0.3.1)**: Production-ready financial workflows with AI analysis
|
149
|
-
- 💼 **Enterprise Workflow Patterns**: Credit risk, portfolio optimization, trading signals, fraud detection
|
150
|
-
- 🔔 **Production Alert System**: Rich Discord alerts with rate limiting, retry logic, and rich embed support
|
151
|
-
- 🏭 **Session 067 Enhancements**: Business workflow templates, data lineage tracking, automatic credential rotation
|
152
|
-
- 🔄 **Zero-Downtime Operations**: Automatic credential rotation with enterprise notifications and audit trails
|
153
|
-
- 🌉 **Enterprise Middleware (v0.4.0)**: Production-ready middleware architecture with real-time agent-frontend communication, dynamic workflows, and AI chat integration
|
154
|
-
- ⚡ **Performance Revolution (v0.5.0)**: 10-100x faster parameter resolution, clear async/sync separation, automatic resource management
|
155
|
-
- 🧪 **Production-Quality Testing (v0.5.0)**: Comprehensive testing infrastructure with Docker integration, AI workflows, and real-world business scenarios
|
156
|
-
|
157
|
-
## 🏗️ Project Architecture
|
158
|
-
|
159
|
-
The Kailash project is organized into three distinct layers:
|
160
|
-
|
161
|
-
### Core Architecture (v0.5.0)
|
162
|
-
```
|
163
|
-
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
|
164
|
-
│ Frontend │ │ Middleware │ │ Kailash Core │
|
165
|
-
│ │ │ │ │ │
|
166
|
-
│ • React/Vue │◄───│ • Agent-UI │◄───│ • Workflows │
|
167
|
-
│ • JavaScript │ │ • Real-time │ │ • Nodes │
|
168
|
-
│ • Mobile Apps │ │ • API Gateway │ │ • Runtime │
|
169
|
-
│ │ │ • AI Chat │ │ • Security │
|
170
|
-
│ │ │ • WebSocket/SSE │ │ • Database │
|
171
|
-
└─────────────────┘ └──────────────────┘ └─────────────────┘
|
172
|
-
```
|
173
|
-
|
174
|
-
```
|
175
|
-
kailash_python_sdk/
|
176
|
-
├── src/kailash/ # Core SDK - Framework and building blocks
|
177
|
-
├── apps/ # Applications - Production-ready solutions built with the SDK
|
178
|
-
└── studio/ # UI Layer - Frontend interfaces and visual tools
|
179
|
-
```
|
180
|
-
|
181
|
-
### Layer Overview
|
182
|
-
|
183
|
-
1. **SDK Layer** (`src/kailash/`) - The core framework providing:
|
184
|
-
- Nodes: Reusable computational units (100+ built-in)
|
185
|
-
- Workflows: DAG-based orchestration with cyclic support
|
186
|
-
- Runtime: Unified execution engine with optimized async/sync separation (v0.5.0)
|
187
|
-
- Middleware: Enterprise communication layer (v0.4.0)
|
188
|
-
- Security: RBAC/ABAC access control with audit logging
|
189
|
-
- Performance: LRU parameter caching, automatic resource pooling (NEW in v0.5.0)
|
190
|
-
|
191
|
-
2. **Application Layer** (`apps/`) - Complete applications including:
|
192
|
-
- User Management System (Django++ capabilities)
|
193
|
-
- Future: Workflow Designer, Data Pipeline, API Gateway, etc.
|
194
|
-
|
195
|
-
3. **UI Layer** (`studio/`) - Modern React interfaces for:
|
196
|
-
- Admin dashboards
|
197
|
-
- Workflow visualization
|
198
|
-
- Application UIs
|
199
|
-
|
200
|
-
### Installation Options
|
201
|
-
|
202
|
-
```bash
|
203
|
-
# Core SDK only
|
204
|
-
pip install kailash
|
205
|
-
|
206
|
-
# SDK with User Management
|
207
|
-
pip install kailash[user-management]
|
208
|
-
|
209
|
-
# Everything
|
210
|
-
pip install kailash[all]
|
211
|
-
```
|
212
|
-
|
213
|
-
## 🎯 Who Is This For?
|
214
|
-
|
215
|
-
The Kailash Python SDK is designed for:
|
216
|
-
|
217
|
-
- **AI Business Coaches (ABCs)** who need to prototype workflows quickly
|
218
|
-
- **Data Scientists** building ML pipelines compatible with production infrastructure
|
219
|
-
- **Engineers** who want to test Kailash workflows locally before deployment
|
220
|
-
- **Teams** looking to standardize their workflow development process
|
221
|
-
|
222
|
-
## 🚀 Quick Start
|
223
|
-
|
224
|
-
### Installation
|
225
|
-
|
226
|
-
**Requirements:** Python 3.11 or higher
|
227
|
-
|
228
|
-
```bash
|
229
|
-
# Install uv if you haven't already
|
230
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
231
|
-
|
232
|
-
# For users: Install from PyPI
|
233
|
-
pip install kailash
|
234
|
-
|
235
|
-
# For developers: Clone and sync
|
236
|
-
git clone https://github.com/integrum/kailash-python-sdk.git
|
237
|
-
cd kailash-python-sdk
|
238
|
-
uv sync
|
239
|
-
|
240
|
-
# Set up SDK development infrastructure (optional but recommended)
|
241
|
-
./scripts/setup-sdk-environment.sh
|
242
|
-
```
|
243
|
-
|
244
|
-
### Your First Workflow
|
245
|
-
|
246
|
-
```python
|
247
|
-
from kailash.workflow import Workflow
|
248
|
-
from kailash.nodes.data import CSVReaderNode
|
249
|
-
from kailash.nodes.code import PythonCodeNode
|
250
|
-
from kailash.runtime.local import LocalRuntime
|
251
|
-
import pandas as pd
|
252
|
-
|
253
|
-
# Create a workflow
|
254
|
-
workflow = Workflow("customer_analysis", name="customer_analysis")
|
255
|
-
|
256
|
-
# Add data reader
|
257
|
-
reader = CSVReaderNode(file_path="customers.csv")
|
258
|
-
workflow.add_node("read_customers", reader)
|
259
|
-
|
260
|
-
# Add custom processing using Python code
|
261
|
-
def analyze_customers(data):
|
262
|
-
"""Analyze customer data and compute metrics."""
|
263
|
-
df = pd.DataFrame(data)
|
264
|
-
# Convert total_spent to numeric
|
265
|
-
df['total_spent'] = pd.to_numeric(df['total_spent'])
|
266
|
-
return {
|
267
|
-
"result": {
|
268
|
-
"total_customers": len(df),
|
269
|
-
"avg_spend": df["total_spent"].mean(),
|
270
|
-
"top_customers": df.nlargest(10, "total_spent").to_dict("records")
|
271
|
-
}
|
272
|
-
}
|
273
|
-
|
274
|
-
processor = PythonCodeNode(code=analyze_customers)
|
275
|
-
workflow.add_node("analyze", processor)
|
276
|
-
|
277
|
-
# Connect nodes
|
278
|
-
workflow.connect("read_customers", "analyze", mapping={"data": "data"})
|
279
|
-
|
280
|
-
# Run locally
|
281
|
-
runtime = LocalRuntime()
|
282
|
-
results, run_id = runtime.execute(workflow, parameters={
|
283
|
-
"read_customers": {"file_path": "customers.csv"}
|
284
|
-
})
|
285
|
-
|
286
|
-
print(f"Total customers: {results['analyze']['result']['total_customers']}")
|
287
|
-
print(f"Average spend: ${results['analyze']['result']['avg_spend']:.2f}")
|
288
|
-
```
|
289
|
-
|
290
|
-
### Export to Production
|
291
|
-
|
292
|
-
```python
|
293
|
-
# Export to Kailash container format
|
294
|
-
from kailash.utils.export import export_workflow
|
295
|
-
|
296
|
-
export_workflow(workflow, "customer_analysis.yaml")
|
297
|
-
```
|
298
|
-
|
299
|
-
## 💼 Finance Workflow Library (New in v0.3.1)
|
300
|
-
|
301
|
-
Complete production-ready financial workflows using AI and modern quantitative methods:
|
302
|
-
|
303
|
-
### Credit Risk Assessment
|
304
|
-
|
305
|
-
```python
|
306
|
-
from kailash.workflow import Workflow
|
307
|
-
from kailash.nodes.data import CSVReaderNode
|
308
|
-
from kailash.nodes.code import PythonCodeNode
|
309
|
-
from kailash.nodes.ai import LLMAgentNode
|
310
|
-
|
311
|
-
def calculate_risk_metrics(customers, transactions):
|
312
|
-
"""Calculate comprehensive risk metrics."""
|
313
|
-
# Modern risk scoring with AI analysis
|
314
|
-
# 100+ lines of production risk calculation
|
315
|
-
return {"result": risk_scores}
|
316
|
-
|
317
|
-
workflow = Workflow("credit-risk", "Credit Risk Assessment")
|
318
|
-
workflow.add_node("customer_reader", CSVReaderNode())
|
319
|
-
workflow.add_node("risk_calculator", PythonCodeNode.from_function(func=calculate_risk_metrics))
|
320
|
-
workflow.add_node("ai_analyzer", LLMAgentNode(model="gpt-4",
|
321
|
-
system_prompt="You are a financial risk expert..."))
|
322
|
-
```
|
323
|
-
|
324
|
-
### Portfolio Optimization
|
325
|
-
|
326
|
-
```python
|
327
|
-
def optimize_portfolio(holdings, market_data, risk_profile="moderate"):
|
328
|
-
"""Modern Portfolio Theory optimization with rebalancing."""
|
329
|
-
# Sharpe ratio optimization, correlation analysis
|
330
|
-
# Risk-adjusted returns with AI market insights
|
331
|
-
return {"result": optimization_plan}
|
332
|
-
|
333
|
-
workflow = Workflow("portfolio-opt", "Portfolio Optimization")
|
334
|
-
workflow.add_node("optimizer", PythonCodeNode.from_function(func=optimize_portfolio))
|
335
|
-
# Generates rebalancing trades, risk metrics, AI market analysis
|
336
|
-
```
|
337
|
-
|
338
|
-
### Trading Signals & Fraud Detection
|
339
|
-
|
340
|
-
- **Trading Signals**: Technical indicators (RSI, MACD, Bollinger Bands) + AI sentiment
|
341
|
-
- **Fraud Detection**: Real-time transaction monitoring with velocity analysis
|
342
|
-
|
343
|
-
**See complete examples**: `sdk-users/workflows/by-industry/finance/`
|
344
|
-
|
345
|
-
## 📚 Documentation
|
346
|
-
|
347
|
-
### For SDK Users
|
348
|
-
|
349
|
-
**Build solutions with the SDK:**
|
350
|
-
- `sdk-users/` - Everything you need to build with Kailash
|
351
|
-
- `developer/` - Node creation patterns and troubleshooting
|
352
|
-
- `workflows/` - Complete production workflow library (v0.3.1)
|
353
|
-
- Finance workflows: Credit risk, portfolio optimization, trading signals, fraud detection
|
354
|
-
- Quick-start patterns (30-second workflows)
|
355
|
-
- Industry-specific solutions by vertical
|
356
|
-
- Enterprise integration patterns
|
357
|
-
- `essentials/` - Quick reference and cheatsheets
|
358
|
-
- `nodes/` - Comprehensive node catalog (93+ nodes including Session 067 enhancements)
|
359
|
-
- `patterns/` - Architectural patterns
|
360
|
-
|
361
|
-
### For SDK Contributors
|
362
|
-
|
363
|
-
**Develop the SDK itself:**
|
364
|
-
- `sdk-contributors/` - Internal SDK development resources
|
365
|
-
- `architecture/` - ADRs and design decisions
|
366
|
-
- `project/` - TODOs and development tracking
|
367
|
-
- `training/` - LLM training examples
|
368
|
-
|
369
|
-
### Shared Resources
|
370
|
-
|
371
|
-
- `shared/` - Resources for both users and contributors
|
372
|
-
- `mistakes/` - Common error patterns and solutions
|
373
|
-
- `frontend/` - UI development resources
|
374
|
-
|
375
|
-
### Quick Links
|
376
|
-
|
377
|
-
- [SDK User Guide](sdk-users/README.md) - Build with the SDK
|
378
|
-
- [SDK Contributor Guide](sdk-contributors/README.md) - Develop the SDK
|
379
|
-
- [API Documentation](https://integrum.github.io/kailash-python-sdk)
|
380
|
-
- [Examples](examples/)
|
381
|
-
- [Release Notes](CHANGELOG.md)
|
382
|
-
|
383
|
-
## 🌉 Enterprise Middleware (v0.4.0)
|
384
|
-
|
385
|
-
### Production-Ready Communication Layer
|
386
|
-
|
387
|
-
The new middleware architecture provides enterprise-grade components for building production applications:
|
388
|
-
|
389
|
-
```python
|
390
|
-
from kailash.middleware import (
|
391
|
-
AgentUIMiddleware,
|
392
|
-
APIGateway,
|
393
|
-
create_gateway,
|
394
|
-
RealtimeMiddleware,
|
395
|
-
AIChatMiddleware
|
396
|
-
)
|
397
|
-
|
398
|
-
# Create enterprise middleware stack
|
399
|
-
agent_ui = AgentUIMiddleware(
|
400
|
-
max_sessions=1000,
|
401
|
-
session_timeout_minutes=60,
|
402
|
-
enable_persistence=True
|
403
|
-
)
|
404
|
-
|
405
|
-
# API Gateway with authentication
|
406
|
-
gateway = create_gateway(
|
407
|
-
title="My Production API",
|
408
|
-
cors_origins=["https://myapp.com"],
|
409
|
-
enable_docs=True
|
410
|
-
)
|
411
|
-
|
412
|
-
# Real-time communication
|
413
|
-
realtime = RealtimeMiddleware(agent_ui)
|
414
|
-
|
415
|
-
# AI chat integration
|
416
|
-
ai_chat = AIChatMiddleware(
|
417
|
-
agent_ui,
|
418
|
-
enable_vector_search=True,
|
419
|
-
llm_provider="ollama"
|
420
|
-
)
|
421
|
-
```
|
422
|
-
|
423
|
-
### Key Middleware Features
|
424
|
-
|
425
|
-
- **Dynamic Workflow Creation**: Create workflows from frontend configurations using `WorkflowBuilder.from_dict()`
|
426
|
-
- **Real-time Communication**: WebSocket and SSE support for live updates
|
427
|
-
- **Session Management**: Multi-tenant isolation with automatic cleanup
|
428
|
-
- **AI Chat Integration**: Natural language workflow generation with context awareness
|
429
|
-
- **Database Persistence**: Repository pattern with audit logging
|
430
|
-
- **JWT Authentication**: Enterprise security with RBAC/ABAC access control
|
431
|
-
- **Health Monitoring**: Built-in health checks and performance metrics
|
432
|
-
|
433
|
-
### Frontend Integration
|
434
|
-
|
435
|
-
```python
|
436
|
-
# Create session for frontend client
|
437
|
-
session_id = await agent_ui.create_session("user123")
|
438
|
-
|
439
|
-
# Dynamic workflow from frontend
|
440
|
-
workflow_config = {
|
441
|
-
"name": "data_pipeline",
|
442
|
-
"nodes": [...],
|
443
|
-
"connections": [...]
|
444
|
-
}
|
445
|
-
|
446
|
-
workflow_id = await agent_ui.create_dynamic_workflow(
|
447
|
-
session_id, workflow_config
|
448
|
-
)
|
449
|
-
|
450
|
-
# Execute with real-time updates
|
451
|
-
execution_id = await agent_ui.execute_workflow(
|
452
|
-
session_id, workflow_id, inputs={}
|
453
|
-
)
|
454
|
-
```
|
455
|
-
|
456
|
-
**Test Excellence**: 17/17 integration tests passing with 100% reliability for production deployment.
|
457
|
-
|
458
|
-
See [Middleware Integration Guide](sdk-users/developer/16-middleware-integration-guide.md) for complete documentation.
|
459
|
-
|
460
|
-
## 🔥 Advanced Features
|
461
|
-
|
462
|
-
### Unified Access Control (v0.3.3)
|
463
|
-
|
464
|
-
Single interface for all access control strategies:
|
465
|
-
|
466
|
-
```python
|
467
|
-
from kailash.access_control import AccessControlManager
|
468
|
-
|
469
|
-
# Choose your strategy
|
470
|
-
manager = AccessControlManager(strategy="abac") # or "rbac" or "hybrid"
|
471
|
-
|
472
|
-
# ABAC example with helper functions
|
473
|
-
from kailash.access_control import create_attribute_condition
|
474
|
-
|
475
|
-
condition = create_attribute_condition(
|
476
|
-
path="user.attributes.department",
|
477
|
-
operator="hierarchical_match",
|
478
|
-
value="finance"
|
479
|
-
)
|
480
|
-
|
481
|
-
# Database integration
|
482
|
-
db_node = AsyncSQLDatabaseNode(
|
483
|
-
name="financial_query",
|
484
|
-
query="SELECT * FROM sensitive_data",
|
485
|
-
access_control_manager=manager
|
486
|
-
)
|
487
|
-
```
|
488
|
-
|
489
|
-
### Cyclic Workflows (Enhanced in v0.2.2)
|
490
|
-
|
491
|
-
Build iterative workflows with the new CycleBuilder API:
|
492
|
-
|
493
|
-
```python
|
494
|
-
# Create an optimization cycle
|
495
|
-
workflow.create_cycle("optimization_loop")
|
496
|
-
.connect("processor", "processor")
|
497
|
-
.max_iterations(100)
|
498
|
-
.converge_when("quality >= 0.95")
|
499
|
-
.timeout(30)
|
500
|
-
.build()
|
501
|
-
```
|
502
|
-
|
503
|
-
### Self-Organizing Agent Pools
|
504
|
-
|
505
|
-
Create teams of AI agents that autonomously coordinate:
|
506
|
-
|
507
|
-
```python
|
508
|
-
from kailash.nodes.ai import SelfOrganizingAgentPoolNode
|
509
|
-
|
510
|
-
agent_pool = SelfOrganizingAgentPoolNode(
|
511
|
-
formation_strategy="capability_matching",
|
512
|
-
convergence_strategy="quality_voting",
|
513
|
-
min_agents=3,
|
514
|
-
max_agents=10
|
515
|
-
)
|
516
|
-
workflow.add_node("agent_team", agent_pool)
|
517
|
-
```
|
518
|
-
|
519
|
-
### Hierarchical RAG Pipeline
|
520
|
-
|
521
|
-
Build sophisticated document processing systems:
|
522
|
-
|
523
|
-
```python
|
524
|
-
from kailash.nodes.data import DocumentSourceNode, HierarchicalChunkerNode
|
525
|
-
from kailash.nodes.ai import EmbeddingGeneratorNode
|
526
|
-
|
527
|
-
# Build a complete RAG pipeline
|
528
|
-
workflow.add_node("docs", DocumentSourceNode(directory="./knowledge"))
|
529
|
-
workflow.add_node("chunker", HierarchicalChunkerNode(chunk_size=512))
|
530
|
-
workflow.add_node("embedder", EmbeddingGeneratorNode(provider="openai"))
|
531
|
-
```
|
532
|
-
|
533
|
-
### REST API Wrapper
|
534
|
-
|
535
|
-
Transform any workflow into a production API:
|
536
|
-
|
537
|
-
```python
|
538
|
-
from kailash.api import WorkflowAPI
|
539
|
-
|
540
|
-
# Create API from workflow
|
541
|
-
api = WorkflowAPI(workflow, host="0.0.0.0", port=8000)
|
542
|
-
api.run()
|
543
|
-
|
544
|
-
# Your workflow is now available at:
|
545
|
-
# POST http://localhost:8000/execute
|
546
|
-
# GET http://localhost:8000/workflow/info
|
547
|
-
```
|
548
|
-
|
549
|
-
## 🏗️ Key Components
|
550
|
-
|
551
|
-
### Nodes (85+ built-in)
|
552
|
-
|
553
|
-
- **Data**: CSVReaderNode, JSONReaderNode, SQLDatabaseNode, AsyncSQLDatabaseNode, DirectoryReaderNode
|
554
|
-
- **Admin**: UserManagementNode, RoleManagementNode, PermissionCheckNode, AuditLogNode, SecurityEventNode
|
555
|
-
- **Transform**: DataTransformer, DataFrameFilter, DataFrameJoiner
|
556
|
-
- **AI/ML**: LLMAgentNode, EmbeddingGeneratorNode, A2ACoordinatorNode, MCPAgentNode
|
557
|
-
- **API**: RESTClientNode, GraphQLNode, AuthNode, HTTPRequestNode
|
558
|
-
- **Logic**: SwitchNode, MergeNode, ConvergenceCheckerNode
|
559
|
-
- **Code**: PythonCodeNode, WorkflowNode
|
560
|
-
- **Alerts**: DiscordAlertNode with rich embeds and rate limiting
|
561
|
-
- **Security**: EnhancedAccessControlManager (ABAC with 16 operators)
|
562
|
-
|
563
|
-
### Runtimes
|
564
|
-
|
565
|
-
- **LocalRuntime**: Test workflows on your machine
|
566
|
-
- **DockerRuntime**: Run in containers (coming soon)
|
567
|
-
- **ParallelRuntime**: Execute nodes concurrently
|
568
|
-
- **CyclicWorkflowExecutor**: Optimized for iterative workflows
|
569
|
-
|
570
|
-
### Visualization
|
571
|
-
|
572
|
-
- **Mermaid diagrams**: Workflow structure visualization
|
573
|
-
- **Real-time dashboard**: Monitor execution with WebSocket streaming
|
574
|
-
- **Performance metrics**: Track execution time, resource usage
|
575
|
-
|
576
|
-
## 🧪 Testing Your Workflows
|
577
|
-
|
578
|
-
```python
|
579
|
-
# Use the testing runtime for unit tests
|
580
|
-
from kailash.runtime.testing import TestingRuntime
|
581
|
-
|
582
|
-
runtime = TestingRuntime()
|
583
|
-
runtime.set_mock_result("read_customers", {"data": test_data})
|
584
|
-
results, run_id = runtime.execute(workflow)
|
585
|
-
assert results["analyze"]["result"]["total_customers"] == len(test_data)
|
586
|
-
```
|
587
|
-
|
588
|
-
## 🚢 Production Deployment
|
589
|
-
|
590
|
-
1. **Export your workflow**:
|
591
|
-
```python
|
592
|
-
export_workflow(workflow, "workflow.yaml", format="kailash")
|
593
|
-
```
|
594
|
-
|
595
|
-
2. **Deploy to Kailash**:
|
596
|
-
```bash
|
597
|
-
kailash deploy workflow.yaml --environment production
|
598
|
-
```
|
599
|
-
|
600
|
-
3. **Monitor in real-time**:
|
601
|
-
```python
|
602
|
-
from kailash.visualization import DashboardServer
|
603
|
-
|
604
|
-
server = DashboardServer(port=8080)
|
605
|
-
server.start()
|
606
|
-
# Open http://localhost:8080 for live monitoring
|
607
|
-
```
|
608
|
-
|
609
|
-
## 🤝 Contributing
|
610
|
-
|
611
|
-
We welcome contributions! We use a **Claude Code-driven workflow** for all team collaboration.
|
612
|
-
|
613
|
-
### 🚀 New Team Member?
|
614
|
-
**Start Here → [NEW_TEAM_MEMBER.md](NEW_TEAM_MEMBER.md)**
|
615
|
-
|
616
|
-
### For Contributors
|
617
|
-
- **SDK Users**: See [sdk-users/CLAUDE.md](sdk-users/CLAUDE.md) for building with the SDK
|
618
|
-
- **SDK Contributors**: See [sdk-contributors/CLAUDE.md](sdk-contributors/CLAUDE.md) for SDK development
|
619
|
-
- **Team Collaboration**: Use [Claude Code Workflow System](sdk-contributors/operations/claude-code-workflows/) for all project management
|
620
|
-
|
621
|
-
### Claude Code Workflow
|
622
|
-
All project management is done through conversational interaction with Claude Code:
|
623
|
-
- **No manual TODO editing** - Claude Code handles all updates
|
624
|
-
- **No direct GitHub issues** - Created through planning sessions
|
625
|
-
- **All progress tracked** - Through natural conversation
|
626
|
-
|
627
|
-
See [Contributing Guide](CONTRIBUTING.md) for complete details.
|
628
|
-
|
629
|
-
### Development Setup
|
630
|
-
|
631
|
-
```bash
|
632
|
-
# Clone the repository
|
633
|
-
git clone https://github.com/integrum/kailash-python-sdk.git
|
634
|
-
cd kailash-python-sdk
|
635
|
-
|
636
|
-
# Install with development dependencies
|
637
|
-
uv sync
|
638
|
-
|
639
|
-
# Run tests
|
640
|
-
pytest
|
641
|
-
|
642
|
-
# Run linting
|
643
|
-
black .
|
644
|
-
isort .
|
645
|
-
ruff check .
|
646
|
-
|
647
|
-
# Test all examples
|
648
|
-
python scripts/test-all-examples.py
|
649
|
-
```
|
650
|
-
|
651
|
-
## 🧪 Tests & Examples
|
652
|
-
|
653
|
-
### Comprehensive Test Suite
|
654
|
-
The SDK features a fully reorganized test suite with 127 tests organized by purpose:
|
655
|
-
|
656
|
-
```bash
|
657
|
-
# Run all tests
|
658
|
-
pytest
|
659
|
-
|
660
|
-
# Fast unit tests (92 tests)
|
661
|
-
pytest tests/unit/
|
662
|
-
|
663
|
-
# Integration tests (31 tests)
|
664
|
-
pytest tests/integration/
|
665
|
-
|
666
|
-
# End-to-end tests (4 tests)
|
667
|
-
pytest tests/e2e/
|
668
|
-
|
669
|
-
# Specific component tests
|
670
|
-
pytest tests/unit/nodes/ai/
|
671
|
-
```
|
672
|
-
|
673
|
-
**Test Structure:**
|
674
|
-
- **Unit Tests**: Fast, isolated component validation
|
675
|
-
- **Integration Tests**: Component interaction testing
|
676
|
-
- **E2E Tests**: Complete scenario validation
|
677
|
-
- **Unified Configuration**: Single `conftest.py` with 76+ fixtures
|
678
|
-
|
679
|
-
### Production Workflows & Examples
|
680
|
-
Clear separation of purpose for maximum value:
|
681
|
-
|
682
|
-
**Business Workflows** (`sdk-users/workflows/`):
|
683
|
-
```
|
684
|
-
sdk-users/workflows/
|
685
|
-
├── quickstart/ # 5-minute success stories
|
686
|
-
├── by-industry/ # Finance, healthcare, manufacturing
|
687
|
-
├── by-pattern/ # Data processing, AI/ML, API integration
|
688
|
-
├── integrations/ # Third-party platform connections
|
689
|
-
└── production-ready/ # Enterprise deployment patterns
|
690
|
-
```
|
691
|
-
|
692
|
-
**SDK Development** (`examples/`):
|
693
|
-
```
|
694
|
-
examples/
|
695
|
-
├── feature-validation/ # SDK component testing
|
696
|
-
├── test-harness/ # Development utilities
|
697
|
-
└── utils/ # Shared development tools
|
698
|
-
```
|
699
|
-
|
700
|
-
**Key Principles:**
|
701
|
-
- **Workflows**: Production business value, real-world solutions
|
702
|
-
- **Examples**: SDK development, feature validation
|
703
|
-
- **Tests**: Quality assurance, regression prevention
|
704
|
-
|
705
|
-
## 📈 Project Status
|
706
|
-
|
707
|
-
### ✅ v0.4.0 - Enterprise Middleware Architecture
|
708
|
-
- **Middleware Layer**: Complete refactor from monolithic to composable middleware
|
709
|
-
- **Real-time Communication**: WebSocket/SSE with comprehensive event streaming
|
710
|
-
- **AI Integration**: Built-in chat middleware with workflow generation
|
711
|
-
- **Test Excellence**: 799 tests passing (100% pass rate), organized structure
|
712
|
-
- **Gateway Integration**: Updated for middleware-based architecture
|
713
|
-
- **Performance**: Excluded slow tests from CI, builds complete in <2 minutes
|
714
|
-
|
715
|
-
### ✅ Previous Releases
|
716
|
-
- ✅ Core workflow engine with 100+ production-ready nodes
|
717
|
-
- ✅ Unified LocalRuntime (async + enterprise features)
|
718
|
-
- ✅ Export to container format
|
719
|
-
- ✅ Reorganized test suite (unit/integration/e2e structure)
|
720
|
-
- ✅ Self-organizing agent systems and hierarchical RAG
|
721
|
-
- ✅ Cyclic workflow support with CycleBuilder API
|
722
|
-
- ✅ Production security framework with RBAC/ABAC/Hybrid
|
723
|
-
- ✅ Async database infrastructure with pgvector support
|
724
|
-
- ✅ Admin tool framework with React UI and QA testing
|
725
|
-
- ✅ Comprehensive workflow library (finance, enterprise patterns)
|
726
|
-
|
727
|
-
### 🚧 In Progress
|
728
|
-
- 🚧 Visual workflow builder (Studio UI)
|
729
|
-
- 🚧 Docker runtime integration
|
730
|
-
- 🚧 Cloud deployment tools
|
731
|
-
- 🚧 Advanced RAG toolkit validation
|
732
|
-
|
733
|
-
## 📄 License
|
734
|
-
|
735
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
736
|
-
|
737
|
-
## 🙏 Acknowledgments
|
738
|
-
|
739
|
-
Built with ❤️ by the Integrum team for the Kailash ecosystem.
|
740
|
-
|
741
|
-
---
|
742
|
-
|
743
|
-
<p align="center">
|
744
|
-
<strong>Ready to build your first workflow? Check out our <a href="examples/">examples</a> or dive into the <a href="sdk-users/README.md">documentation</a>!</strong>
|
745
|
-
</p>
|