Integrating with Existing AI Frameworks

Kubiya seamlessly integrates with popular AI frameworks, allowing you to enhance your existing agent systems with production-grade orchestration, execution, and scaling capabilities. Instead of replacing your current setup, Kubiya acts as an execution layer that brings deterministic workflows and enterprise features to your AI agents.

Why Integrate with Kubiya?

Supported Frameworks

Integration Patterns

There are three main patterns for integrating existing AI frameworks with Kubiya:

1. Workflow Wrapping Pattern

Wrap your existing agent code within Kubiya workflows for execution orchestration:

from kubiya_workflow_sdk import workflow, step

@workflow
def langgraph_agent_workflow():
    # Your existing LangGraph code
    result = step("langgraph_execution").python(
        code="""
import langgraph
from your_existing_code import create_agent_graph

# Your existing LangGraph setup
graph = create_agent_graph()
result = graph.invoke({"messages": [{"role": "user", "content": "${INPUT}"}]})
return result
        """,
        requirements=["langgraph", "langchain"]
    )
    
    return result

2. Agent Server Integration

Deploy your framework as a custom agent server provider:

from kubiya_workflow_sdk.providers import BaseProvider

class LangGraphProvider(BaseProvider):
    def __init__(self):
        self.graph = self.create_langgraph_agent()
    
    async def compose(self, task: str, mode: str = "act"):
        # Your existing LangGraph logic
        result = await self.graph.ainvoke({
            "messages": [{"role": "user", "content": task}]
        })
        return result
    
    def create_langgraph_agent(self):
        # Your existing agent creation code
        from langgraph import StateGraph
        # ... your graph setup
        return compiled_graph

3. Hybrid Architecture

Combine Kubiya’s orchestration with your framework’s agent logic:

from kubiya_workflow_sdk import workflow, step

@workflow
def hybrid_ai_pipeline():
    # Use Kubiya's ADK for planning
    plan = step("planning").adk_compose(
        task="Create a plan for: ${INPUT}",
        mode="plan"
    )
    
    # Use your existing framework for execution
    execution = step("crewai_execution").python(
        code="""
from your_existing_code import execute_plan_with_crewai
result = execute_plan_with_crewai("${plan.strategy}")
return result
        """,
        requirements=["crewai"]
    ).depends("planning")
    
    # Use Kubiya for monitoring and reporting
    report = step("reporting").adk_compose(
        task="Generate report for execution: ${execution}",
        mode="act"
    ).depends("crewai_execution")

Key Integration Benefits

Kubernetes-Native Scaling

Your existing AI agents automatically gain:

  • Horizontal pod autoscaling
  • Resource management and limits
  • Load balancing across replicas
  • Multi-zone deployments
# Your LangGraph agents now scale automatically
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: langgraph-agent-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: langgraph-agent
  minReplicas: 2
  maxReplicas: 20
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70

Migration Strategies

Gradual Migration

1

Start with Workflow Wrapping

Begin by wrapping your existing agents in Kubiya workflows without changing core logic

2

Add Orchestration Features

Gradually add streaming, monitoring, and error handling capabilities

3

Optimize for Production

Refactor critical paths to use native Kubiya features for better performance

4

Full Integration

Move to custom providers or hybrid architectures for maximum benefit

Parallel Development

1

Deploy Side by Side

Run your existing system alongside Kubiya-integrated versions

2

A/B Testing

Compare performance and reliability between implementations

3

Gradual Traffic Shift

Slowly move traffic from legacy to Kubiya-integrated agents

4

Sunset Legacy

Retire old implementation once migration is complete

Common Integration Scenarios

Getting Started

Choose your framework and follow the specific integration guide:

Support & Community