kailash 0.1.4__tar.gz → 0.1.5__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.
- {kailash-0.1.4/src/kailash.egg-info → kailash-0.1.5}/PKG-INFO +191 -2
- {kailash-0.1.4 → kailash-0.1.5}/README.md +190 -1
- {kailash-0.1.4 → kailash-0.1.5}/pyproject.toml +1 -1
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/__init__.py +36 -0
- kailash-0.1.5/src/kailash/nodes/ai/a2a.py +1143 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/agents.py +116 -2
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/ai_providers.py +206 -8
- kailash-0.1.5/src/kailash/nodes/ai/intelligent_agent_orchestrator.py +2114 -0
- kailash-0.1.5/src/kailash/nodes/ai/self_organizing.py +1624 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/http.py +106 -25
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/rest.py +116 -21
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/readers.py +100 -47
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/logic/async_operations.py +48 -9
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/logic/operations.py +25 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/logic/workflow.py +26 -18
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/transform/__init__.py +8 -1
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/transform/processors.py +119 -4
- {kailash-0.1.4 → kailash-0.1.5/src/kailash.egg-info}/PKG-INFO +191 -2
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/SOURCES.txt +3 -0
- {kailash-0.1.4 → kailash-0.1.5}/LICENSE +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/MANIFEST.in +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/setup.cfg +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/setup.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/__main__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/api/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/api/gateway.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/api/mcp_integration.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/api/workflow_api.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/cli/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/cli/commands.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/manifest.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/embedding_generator.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/llm_agent.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/ai/models.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/auth.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/graphql.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/api/rate_limiting.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/base.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/base_async.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/code/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/code/python.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/retrieval.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/sharepoint_graph.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/sources.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/sql.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/streaming.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/vector_db.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/data/writers.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/logic/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/mcp/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/mcp/client.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/mcp/resource.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/mcp/server.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/transform/chunkers.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/nodes/transform/formatters.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/async_local.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/docker.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/local.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/parallel.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/runner.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/runtime/testing.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/sdk_exceptions.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/manager.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/metrics_collector.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/models.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/storage/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/storage/base.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/storage/database.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/tracking/storage/filesystem.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/utils/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/utils/export.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/utils/templates.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/visualization/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/visualization/api.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/visualization/dashboard.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/visualization/performance.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/visualization/reports.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/__init__.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/builder.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/graph.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/mermaid_visualizer.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/mock_registry.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/runner.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/state.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash/workflow/visualization.py +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/dependency_links.txt +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/entry_points.txt +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/not-zip-safe +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/requires.txt +0 -0
- {kailash-0.1.4 → kailash-0.1.5}/src/kailash.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kailash
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.5
|
4
4
|
Summary: Python SDK for the Kailash container-node architecture
|
5
5
|
Home-page: https://github.com/integrum/kailash-python-sdk
|
6
6
|
Author: Integrum
|
@@ -92,6 +92,8 @@ Dynamic: requires-python
|
|
92
92
|
- 🧠 **Retrieval-Augmented Generation**: Full RAG pipeline with intelligent document processing
|
93
93
|
- 🌐 **REST API Wrapper**: Expose any workflow as a production-ready API in 3 lines
|
94
94
|
- 🚪 **Multi-Workflow Gateway**: Manage multiple workflows through unified API with MCP integration
|
95
|
+
- 🤖 **Self-Organizing Agents**: Autonomous agent pools with intelligent team formation and convergence detection
|
96
|
+
- 🧠 **Agent-to-Agent Communication**: Shared memory pools and intelligent caching for coordinated multi-agent systems
|
95
97
|
|
96
98
|
## 🎯 Who Is This For?
|
97
99
|
|
@@ -410,6 +412,173 @@ gateway.run(port=8000)
|
|
410
412
|
|
411
413
|
See the [Gateway examples](examples/integration_examples/gateway_comprehensive_demo.py) for complete implementation patterns.
|
412
414
|
|
415
|
+
### Self-Organizing Agent Pools - Autonomous Multi-Agent Systems
|
416
|
+
|
417
|
+
Build intelligent agent systems that can autonomously form teams, share information, and solve complex problems collaboratively:
|
418
|
+
|
419
|
+
```python
|
420
|
+
from kailash import Workflow
|
421
|
+
from kailash.runtime import LocalRuntime
|
422
|
+
from kailash.nodes.ai.intelligent_agent_orchestrator import (
|
423
|
+
OrchestrationManagerNode,
|
424
|
+
IntelligentCacheNode,
|
425
|
+
ConvergenceDetectorNode
|
426
|
+
)
|
427
|
+
from kailash.nodes.ai.self_organizing import (
|
428
|
+
AgentPoolManagerNode,
|
429
|
+
TeamFormationNode,
|
430
|
+
ProblemAnalyzerNode
|
431
|
+
)
|
432
|
+
from kailash.nodes.ai.a2a import SharedMemoryPoolNode, A2AAgentNode
|
433
|
+
|
434
|
+
# Create self-organizing agent workflow
|
435
|
+
workflow = Workflow("self_organizing_research")
|
436
|
+
|
437
|
+
# Shared infrastructure
|
438
|
+
memory_pool = SharedMemoryPoolNode(
|
439
|
+
memory_size_limit=1000,
|
440
|
+
attention_window=50
|
441
|
+
)
|
442
|
+
workflow.add_node("memory", memory_pool)
|
443
|
+
|
444
|
+
# Intelligent caching to prevent redundant operations
|
445
|
+
cache = IntelligentCacheNode(
|
446
|
+
ttl=3600, # 1 hour cache
|
447
|
+
similarity_threshold=0.8,
|
448
|
+
max_entries=1000
|
449
|
+
)
|
450
|
+
workflow.add_node("cache", cache)
|
451
|
+
|
452
|
+
# Problem analysis and team formation
|
453
|
+
problem_analyzer = ProblemAnalyzerNode()
|
454
|
+
team_former = TeamFormationNode(
|
455
|
+
formation_strategy="capability_matching",
|
456
|
+
optimization_rounds=3
|
457
|
+
)
|
458
|
+
workflow.add_node("analyzer", problem_analyzer)
|
459
|
+
workflow.add_node("team_former", team_former)
|
460
|
+
|
461
|
+
# Self-organizing agent pool
|
462
|
+
pool_manager = AgentPoolManagerNode(
|
463
|
+
max_active_agents=20,
|
464
|
+
agent_timeout=120
|
465
|
+
)
|
466
|
+
workflow.add_node("pool", pool_manager)
|
467
|
+
|
468
|
+
# Convergence detection for stopping criteria
|
469
|
+
convergence = ConvergenceDetectorNode(
|
470
|
+
quality_threshold=0.85,
|
471
|
+
improvement_threshold=0.02,
|
472
|
+
max_iterations=10
|
473
|
+
)
|
474
|
+
workflow.add_node("convergence", convergence)
|
475
|
+
|
476
|
+
# Orchestration manager coordinates the entire system
|
477
|
+
orchestrator = OrchestrationManagerNode(
|
478
|
+
max_iterations=10,
|
479
|
+
quality_threshold=0.85,
|
480
|
+
parallel_execution=True
|
481
|
+
)
|
482
|
+
workflow.add_node("orchestrator", orchestrator)
|
483
|
+
|
484
|
+
# Execute with complex business problem
|
485
|
+
runtime = LocalRuntime()
|
486
|
+
result, _ = runtime.execute(workflow, parameters={
|
487
|
+
"orchestrator": {
|
488
|
+
"query": "Analyze market trends and develop growth strategy for fintech",
|
489
|
+
"agent_pool_size": 12,
|
490
|
+
"mcp_servers": [
|
491
|
+
{"name": "market_data", "command": "python", "args": ["-m", "market_mcp"]},
|
492
|
+
{"name": "financial", "command": "python", "args": ["-m", "finance_mcp"]},
|
493
|
+
{"name": "research", "command": "python", "args": ["-m", "research_mcp"]}
|
494
|
+
],
|
495
|
+
"context": {
|
496
|
+
"domain": "fintech",
|
497
|
+
"depth": "comprehensive",
|
498
|
+
"output_format": "strategic_report"
|
499
|
+
}
|
500
|
+
}
|
501
|
+
})
|
502
|
+
|
503
|
+
print(f"Solution Quality: {result['orchestrator']['quality_score']:.2%}")
|
504
|
+
print(f"Agents Used: {result['orchestrator']['agents_deployed']}")
|
505
|
+
print(f"Iterations: {result['orchestrator']['iterations_completed']}")
|
506
|
+
print(f"Final Strategy: {result['orchestrator']['final_solution']['strategy']}")
|
507
|
+
```
|
508
|
+
|
509
|
+
#### Key Self-Organizing Features
|
510
|
+
|
511
|
+
- **Autonomous Team Formation**: Agents automatically form optimal teams based on:
|
512
|
+
- Capability matching for skill-specific tasks
|
513
|
+
- Swarm-based formation for exploration
|
514
|
+
- Market-based allocation for resource constraints
|
515
|
+
- Hierarchical organization for complex problems
|
516
|
+
|
517
|
+
- **Intelligent Information Sharing**:
|
518
|
+
- **SharedMemoryPoolNode**: Selective attention mechanisms for relevant information
|
519
|
+
- **IntelligentCacheNode**: Semantic similarity detection prevents redundant operations
|
520
|
+
- **A2AAgentNode**: Direct agent-to-agent communication with context awareness
|
521
|
+
|
522
|
+
- **Convergence Detection**: Automatic termination when:
|
523
|
+
- Solution quality exceeds threshold (e.g., 85% confidence)
|
524
|
+
- Improvement rate drops below minimum (e.g., <2% per iteration)
|
525
|
+
- Maximum iterations reached
|
526
|
+
- Time limits exceeded
|
527
|
+
|
528
|
+
- **MCP Integration**: Agents can access external tools and data sources:
|
529
|
+
- File systems, databases, APIs
|
530
|
+
- Web scraping and research tools
|
531
|
+
- Specialized domain knowledge bases
|
532
|
+
- Real-time data streams
|
533
|
+
|
534
|
+
- **Performance Optimization**:
|
535
|
+
- Multi-level caching strategies
|
536
|
+
- Parallel agent execution
|
537
|
+
- Resource management and monitoring
|
538
|
+
- Cost tracking for API usage
|
539
|
+
|
540
|
+
See the [Self-Organizing Agents examples](examples/integration_examples/) for complete implementation patterns and the [Agent Systems Guide](docs/guides/self_organizing_agents.rst) for detailed documentation.
|
541
|
+
|
542
|
+
### Zero-Code MCP Ecosystem - Visual Workflow Builder
|
543
|
+
|
544
|
+
Build and deploy workflows through an interactive web interface without writing any code:
|
545
|
+
|
546
|
+
```python
|
547
|
+
from kailash.api.gateway import WorkflowAPIGateway
|
548
|
+
from kailash.api.mcp_integration import MCPServerRegistry
|
549
|
+
|
550
|
+
# Run the MCP ecosystem demo
|
551
|
+
# cd examples/integration_examples
|
552
|
+
# ./run_ecosystem.sh
|
553
|
+
|
554
|
+
# Or run programmatically:
|
555
|
+
python examples/integration_examples/mcp_ecosystem_demo.py
|
556
|
+
```
|
557
|
+
|
558
|
+
#### Features
|
559
|
+
|
560
|
+
- **Drag-and-Drop Builder**: Visual interface for creating workflows
|
561
|
+
- Drag nodes from palette (CSV Reader, Python Code, JSON Writer, etc.)
|
562
|
+
- Drop onto canvas to build workflows
|
563
|
+
- Deploy with one click
|
564
|
+
|
565
|
+
- **Live Dashboard**: Real-time monitoring and statistics
|
566
|
+
- Connected MCP server status
|
567
|
+
- Running workflow count
|
568
|
+
- Execution logs with timestamps
|
569
|
+
|
570
|
+
- **Pre-built Templates**: One-click deployment
|
571
|
+
- GitHub → Slack Notifier
|
572
|
+
- Data Processing Pipeline (CSV → Transform → JSON)
|
573
|
+
- AI Research Assistant
|
574
|
+
|
575
|
+
- **Technology Stack**: Lightweight and fast
|
576
|
+
- Backend: FastAPI + Kailash SDK
|
577
|
+
- Frontend: Vanilla HTML/CSS/JavaScript (no frameworks)
|
578
|
+
- Zero build process required
|
579
|
+
|
580
|
+
See the [MCP Ecosystem example](examples/integration_examples/) for the complete zero-code workflow deployment platform.
|
581
|
+
|
413
582
|
## 📚 Documentation
|
414
583
|
|
415
584
|
| Resource | Description |
|
@@ -471,6 +640,21 @@ The SDK includes a rich set of pre-built nodes for common operations:
|
|
471
640
|
- `SentimentAnalyzer` - Sentiment analysis
|
472
641
|
- `NamedEntityRecognizer` - NER extraction
|
473
642
|
|
643
|
+
**Self-Organizing Agent Nodes**
|
644
|
+
- `SharedMemoryPoolNode` - Agent memory sharing
|
645
|
+
- `A2AAgentNode` - Agent-to-agent communication
|
646
|
+
- `A2ACoordinatorNode` - Multi-agent coordination
|
647
|
+
- `IntelligentCacheNode` - Semantic caching system
|
648
|
+
- `MCPAgentNode` - MCP-enabled agents
|
649
|
+
- `QueryAnalysisNode` - Query complexity analysis
|
650
|
+
- `OrchestrationManagerNode` - System orchestration
|
651
|
+
- `ConvergenceDetectorNode` - Solution convergence
|
652
|
+
- `AgentPoolManagerNode` - Agent pool management
|
653
|
+
- `ProblemAnalyzerNode` - Problem decomposition
|
654
|
+
- `TeamFormationNode` - Optimal team creation
|
655
|
+
- `SolutionEvaluatorNode` - Multi-criteria evaluation
|
656
|
+
- `SelfOrganizingAgentNode` - Adaptive individual agents
|
657
|
+
|
474
658
|
</td>
|
475
659
|
<td width="50%">
|
476
660
|
|
@@ -1104,7 +1288,7 @@ pre-commit run pytest-check
|
|
1104
1288
|
<td width="40%">
|
1105
1289
|
|
1106
1290
|
### ✅ Completed
|
1107
|
-
- Core node system with
|
1291
|
+
- Core node system with 66+ node types
|
1108
1292
|
- Workflow builder with DAG validation
|
1109
1293
|
- Local & async execution engines
|
1110
1294
|
- Task tracking with metrics
|
@@ -1115,6 +1299,11 @@ pre-commit run pytest-check
|
|
1115
1299
|
- API integration with rate limiting
|
1116
1300
|
- OAuth 2.0 authentication
|
1117
1301
|
- SharePoint Graph API integration
|
1302
|
+
- **Self-organizing agent pools with 13 specialized nodes**
|
1303
|
+
- **Agent-to-agent communication and shared memory**
|
1304
|
+
- **Intelligent caching and convergence detection**
|
1305
|
+
- **MCP integration for external tool access**
|
1306
|
+
- **Multi-strategy team formation algorithms**
|
1118
1307
|
- **Real-time performance metrics collection**
|
1119
1308
|
- **Performance visualization dashboards**
|
1120
1309
|
- **Real-time monitoring dashboard with WebSocket streaming**
|
@@ -32,6 +32,8 @@
|
|
32
32
|
- 🧠 **Retrieval-Augmented Generation**: Full RAG pipeline with intelligent document processing
|
33
33
|
- 🌐 **REST API Wrapper**: Expose any workflow as a production-ready API in 3 lines
|
34
34
|
- 🚪 **Multi-Workflow Gateway**: Manage multiple workflows through unified API with MCP integration
|
35
|
+
- 🤖 **Self-Organizing Agents**: Autonomous agent pools with intelligent team formation and convergence detection
|
36
|
+
- 🧠 **Agent-to-Agent Communication**: Shared memory pools and intelligent caching for coordinated multi-agent systems
|
35
37
|
|
36
38
|
## 🎯 Who Is This For?
|
37
39
|
|
@@ -350,6 +352,173 @@ gateway.run(port=8000)
|
|
350
352
|
|
351
353
|
See the [Gateway examples](examples/integration_examples/gateway_comprehensive_demo.py) for complete implementation patterns.
|
352
354
|
|
355
|
+
### Self-Organizing Agent Pools - Autonomous Multi-Agent Systems
|
356
|
+
|
357
|
+
Build intelligent agent systems that can autonomously form teams, share information, and solve complex problems collaboratively:
|
358
|
+
|
359
|
+
```python
|
360
|
+
from kailash import Workflow
|
361
|
+
from kailash.runtime import LocalRuntime
|
362
|
+
from kailash.nodes.ai.intelligent_agent_orchestrator import (
|
363
|
+
OrchestrationManagerNode,
|
364
|
+
IntelligentCacheNode,
|
365
|
+
ConvergenceDetectorNode
|
366
|
+
)
|
367
|
+
from kailash.nodes.ai.self_organizing import (
|
368
|
+
AgentPoolManagerNode,
|
369
|
+
TeamFormationNode,
|
370
|
+
ProblemAnalyzerNode
|
371
|
+
)
|
372
|
+
from kailash.nodes.ai.a2a import SharedMemoryPoolNode, A2AAgentNode
|
373
|
+
|
374
|
+
# Create self-organizing agent workflow
|
375
|
+
workflow = Workflow("self_organizing_research")
|
376
|
+
|
377
|
+
# Shared infrastructure
|
378
|
+
memory_pool = SharedMemoryPoolNode(
|
379
|
+
memory_size_limit=1000,
|
380
|
+
attention_window=50
|
381
|
+
)
|
382
|
+
workflow.add_node("memory", memory_pool)
|
383
|
+
|
384
|
+
# Intelligent caching to prevent redundant operations
|
385
|
+
cache = IntelligentCacheNode(
|
386
|
+
ttl=3600, # 1 hour cache
|
387
|
+
similarity_threshold=0.8,
|
388
|
+
max_entries=1000
|
389
|
+
)
|
390
|
+
workflow.add_node("cache", cache)
|
391
|
+
|
392
|
+
# Problem analysis and team formation
|
393
|
+
problem_analyzer = ProblemAnalyzerNode()
|
394
|
+
team_former = TeamFormationNode(
|
395
|
+
formation_strategy="capability_matching",
|
396
|
+
optimization_rounds=3
|
397
|
+
)
|
398
|
+
workflow.add_node("analyzer", problem_analyzer)
|
399
|
+
workflow.add_node("team_former", team_former)
|
400
|
+
|
401
|
+
# Self-organizing agent pool
|
402
|
+
pool_manager = AgentPoolManagerNode(
|
403
|
+
max_active_agents=20,
|
404
|
+
agent_timeout=120
|
405
|
+
)
|
406
|
+
workflow.add_node("pool", pool_manager)
|
407
|
+
|
408
|
+
# Convergence detection for stopping criteria
|
409
|
+
convergence = ConvergenceDetectorNode(
|
410
|
+
quality_threshold=0.85,
|
411
|
+
improvement_threshold=0.02,
|
412
|
+
max_iterations=10
|
413
|
+
)
|
414
|
+
workflow.add_node("convergence", convergence)
|
415
|
+
|
416
|
+
# Orchestration manager coordinates the entire system
|
417
|
+
orchestrator = OrchestrationManagerNode(
|
418
|
+
max_iterations=10,
|
419
|
+
quality_threshold=0.85,
|
420
|
+
parallel_execution=True
|
421
|
+
)
|
422
|
+
workflow.add_node("orchestrator", orchestrator)
|
423
|
+
|
424
|
+
# Execute with complex business problem
|
425
|
+
runtime = LocalRuntime()
|
426
|
+
result, _ = runtime.execute(workflow, parameters={
|
427
|
+
"orchestrator": {
|
428
|
+
"query": "Analyze market trends and develop growth strategy for fintech",
|
429
|
+
"agent_pool_size": 12,
|
430
|
+
"mcp_servers": [
|
431
|
+
{"name": "market_data", "command": "python", "args": ["-m", "market_mcp"]},
|
432
|
+
{"name": "financial", "command": "python", "args": ["-m", "finance_mcp"]},
|
433
|
+
{"name": "research", "command": "python", "args": ["-m", "research_mcp"]}
|
434
|
+
],
|
435
|
+
"context": {
|
436
|
+
"domain": "fintech",
|
437
|
+
"depth": "comprehensive",
|
438
|
+
"output_format": "strategic_report"
|
439
|
+
}
|
440
|
+
}
|
441
|
+
})
|
442
|
+
|
443
|
+
print(f"Solution Quality: {result['orchestrator']['quality_score']:.2%}")
|
444
|
+
print(f"Agents Used: {result['orchestrator']['agents_deployed']}")
|
445
|
+
print(f"Iterations: {result['orchestrator']['iterations_completed']}")
|
446
|
+
print(f"Final Strategy: {result['orchestrator']['final_solution']['strategy']}")
|
447
|
+
```
|
448
|
+
|
449
|
+
#### Key Self-Organizing Features
|
450
|
+
|
451
|
+
- **Autonomous Team Formation**: Agents automatically form optimal teams based on:
|
452
|
+
- Capability matching for skill-specific tasks
|
453
|
+
- Swarm-based formation for exploration
|
454
|
+
- Market-based allocation for resource constraints
|
455
|
+
- Hierarchical organization for complex problems
|
456
|
+
|
457
|
+
- **Intelligent Information Sharing**:
|
458
|
+
- **SharedMemoryPoolNode**: Selective attention mechanisms for relevant information
|
459
|
+
- **IntelligentCacheNode**: Semantic similarity detection prevents redundant operations
|
460
|
+
- **A2AAgentNode**: Direct agent-to-agent communication with context awareness
|
461
|
+
|
462
|
+
- **Convergence Detection**: Automatic termination when:
|
463
|
+
- Solution quality exceeds threshold (e.g., 85% confidence)
|
464
|
+
- Improvement rate drops below minimum (e.g., <2% per iteration)
|
465
|
+
- Maximum iterations reached
|
466
|
+
- Time limits exceeded
|
467
|
+
|
468
|
+
- **MCP Integration**: Agents can access external tools and data sources:
|
469
|
+
- File systems, databases, APIs
|
470
|
+
- Web scraping and research tools
|
471
|
+
- Specialized domain knowledge bases
|
472
|
+
- Real-time data streams
|
473
|
+
|
474
|
+
- **Performance Optimization**:
|
475
|
+
- Multi-level caching strategies
|
476
|
+
- Parallel agent execution
|
477
|
+
- Resource management and monitoring
|
478
|
+
- Cost tracking for API usage
|
479
|
+
|
480
|
+
See the [Self-Organizing Agents examples](examples/integration_examples/) for complete implementation patterns and the [Agent Systems Guide](docs/guides/self_organizing_agents.rst) for detailed documentation.
|
481
|
+
|
482
|
+
### Zero-Code MCP Ecosystem - Visual Workflow Builder
|
483
|
+
|
484
|
+
Build and deploy workflows through an interactive web interface without writing any code:
|
485
|
+
|
486
|
+
```python
|
487
|
+
from kailash.api.gateway import WorkflowAPIGateway
|
488
|
+
from kailash.api.mcp_integration import MCPServerRegistry
|
489
|
+
|
490
|
+
# Run the MCP ecosystem demo
|
491
|
+
# cd examples/integration_examples
|
492
|
+
# ./run_ecosystem.sh
|
493
|
+
|
494
|
+
# Or run programmatically:
|
495
|
+
python examples/integration_examples/mcp_ecosystem_demo.py
|
496
|
+
```
|
497
|
+
|
498
|
+
#### Features
|
499
|
+
|
500
|
+
- **Drag-and-Drop Builder**: Visual interface for creating workflows
|
501
|
+
- Drag nodes from palette (CSV Reader, Python Code, JSON Writer, etc.)
|
502
|
+
- Drop onto canvas to build workflows
|
503
|
+
- Deploy with one click
|
504
|
+
|
505
|
+
- **Live Dashboard**: Real-time monitoring and statistics
|
506
|
+
- Connected MCP server status
|
507
|
+
- Running workflow count
|
508
|
+
- Execution logs with timestamps
|
509
|
+
|
510
|
+
- **Pre-built Templates**: One-click deployment
|
511
|
+
- GitHub → Slack Notifier
|
512
|
+
- Data Processing Pipeline (CSV → Transform → JSON)
|
513
|
+
- AI Research Assistant
|
514
|
+
|
515
|
+
- **Technology Stack**: Lightweight and fast
|
516
|
+
- Backend: FastAPI + Kailash SDK
|
517
|
+
- Frontend: Vanilla HTML/CSS/JavaScript (no frameworks)
|
518
|
+
- Zero build process required
|
519
|
+
|
520
|
+
See the [MCP Ecosystem example](examples/integration_examples/) for the complete zero-code workflow deployment platform.
|
521
|
+
|
353
522
|
## 📚 Documentation
|
354
523
|
|
355
524
|
| Resource | Description |
|
@@ -411,6 +580,21 @@ The SDK includes a rich set of pre-built nodes for common operations:
|
|
411
580
|
- `SentimentAnalyzer` - Sentiment analysis
|
412
581
|
- `NamedEntityRecognizer` - NER extraction
|
413
582
|
|
583
|
+
**Self-Organizing Agent Nodes**
|
584
|
+
- `SharedMemoryPoolNode` - Agent memory sharing
|
585
|
+
- `A2AAgentNode` - Agent-to-agent communication
|
586
|
+
- `A2ACoordinatorNode` - Multi-agent coordination
|
587
|
+
- `IntelligentCacheNode` - Semantic caching system
|
588
|
+
- `MCPAgentNode` - MCP-enabled agents
|
589
|
+
- `QueryAnalysisNode` - Query complexity analysis
|
590
|
+
- `OrchestrationManagerNode` - System orchestration
|
591
|
+
- `ConvergenceDetectorNode` - Solution convergence
|
592
|
+
- `AgentPoolManagerNode` - Agent pool management
|
593
|
+
- `ProblemAnalyzerNode` - Problem decomposition
|
594
|
+
- `TeamFormationNode` - Optimal team creation
|
595
|
+
- `SolutionEvaluatorNode` - Multi-criteria evaluation
|
596
|
+
- `SelfOrganizingAgentNode` - Adaptive individual agents
|
597
|
+
|
414
598
|
</td>
|
415
599
|
<td width="50%">
|
416
600
|
|
@@ -1044,7 +1228,7 @@ pre-commit run pytest-check
|
|
1044
1228
|
<td width="40%">
|
1045
1229
|
|
1046
1230
|
### ✅ Completed
|
1047
|
-
- Core node system with
|
1231
|
+
- Core node system with 66+ node types
|
1048
1232
|
- Workflow builder with DAG validation
|
1049
1233
|
- Local & async execution engines
|
1050
1234
|
- Task tracking with metrics
|
@@ -1055,6 +1239,11 @@ pre-commit run pytest-check
|
|
1055
1239
|
- API integration with rate limiting
|
1056
1240
|
- OAuth 2.0 authentication
|
1057
1241
|
- SharePoint Graph API integration
|
1242
|
+
- **Self-organizing agent pools with 13 specialized nodes**
|
1243
|
+
- **Agent-to-agent communication and shared memory**
|
1244
|
+
- **Intelligent caching and convergence detection**
|
1245
|
+
- **MCP integration for external tool access**
|
1246
|
+
- **Multi-strategy team formation algorithms**
|
1058
1247
|
- **Real-time performance metrics collection**
|
1059
1248
|
- **Performance visualization dashboards**
|
1060
1249
|
- **Real-time monitoring dashboard with WebSocket streaming**
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"""AI and ML nodes for the Kailash SDK."""
|
2
2
|
|
3
|
+
# Import A2A communication nodes
|
4
|
+
from .a2a import A2AAgentNode, A2ACoordinatorNode, SharedMemoryPoolNode
|
3
5
|
from .agents import ChatAgent, FunctionCallingAgent, PlanningAgent, RetrievalAgent
|
4
6
|
|
5
7
|
# Import from unified ai_providers module
|
@@ -14,6 +16,15 @@ from .ai_providers import (
|
|
14
16
|
get_provider,
|
15
17
|
)
|
16
18
|
from .embedding_generator import EmbeddingGeneratorNode
|
19
|
+
|
20
|
+
# Import intelligent orchestration nodes
|
21
|
+
from .intelligent_agent_orchestrator import (
|
22
|
+
ConvergenceDetectorNode,
|
23
|
+
IntelligentCacheNode,
|
24
|
+
MCPAgentNode,
|
25
|
+
OrchestrationManagerNode,
|
26
|
+
QueryAnalysisNode,
|
27
|
+
)
|
17
28
|
from .llm_agent import LLMAgentNode
|
18
29
|
from .models import (
|
19
30
|
ModelPredictor,
|
@@ -24,6 +35,15 @@ from .models import (
|
|
24
35
|
TextSummarizer,
|
25
36
|
)
|
26
37
|
|
38
|
+
# Import self-organizing nodes
|
39
|
+
from .self_organizing import (
|
40
|
+
AgentPoolManagerNode,
|
41
|
+
ProblemAnalyzerNode,
|
42
|
+
SelfOrganizingAgentNode,
|
43
|
+
SolutionEvaluatorNode,
|
44
|
+
TeamFormationNode,
|
45
|
+
)
|
46
|
+
|
27
47
|
__all__ = [
|
28
48
|
# Agents
|
29
49
|
"ChatAgent",
|
@@ -31,6 +51,22 @@ __all__ = [
|
|
31
51
|
"FunctionCallingAgent",
|
32
52
|
"PlanningAgent",
|
33
53
|
"LLMAgentNode",
|
54
|
+
# A2A Communication
|
55
|
+
"A2AAgentNode",
|
56
|
+
"SharedMemoryPoolNode",
|
57
|
+
"A2ACoordinatorNode",
|
58
|
+
# Self-Organizing Agents
|
59
|
+
"AgentPoolManagerNode",
|
60
|
+
"ProblemAnalyzerNode",
|
61
|
+
"SelfOrganizingAgentNode",
|
62
|
+
"SolutionEvaluatorNode",
|
63
|
+
"TeamFormationNode",
|
64
|
+
# Intelligent Orchestration
|
65
|
+
"ConvergenceDetectorNode",
|
66
|
+
"IntelligentCacheNode",
|
67
|
+
"MCPAgentNode",
|
68
|
+
"OrchestrationManagerNode",
|
69
|
+
"QueryAnalysisNode",
|
34
70
|
# Embedding and Vector Operations
|
35
71
|
"EmbeddingGeneratorNode",
|
36
72
|
# Provider Infrastructure
|